You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2014/06/29 09:11:54 UTC

[Bug 56681] New: List of Exception Management Anti-Patterns and Code Smells

https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

            Bug ID: 56681
           Summary: List of Exception Management Anti-Patterns and Code
                    Smells
           Product: Tomcat 8
           Version: 8.0.8
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Meta
          Assignee: dev@tomcat.apache.org
          Reporter: ashish@iiitd.ac.in

Code smells are defined as symptoms in the program source code which are
usually not bugs or technically incorrect but indicates a possible deeper
problem. Anti-patterns are counterparts of design patterns and are defined as
mistakes during software development that produces negative consequences and is
ineffective or counter-productive. During program execution, error events can
occur that disrupts the normal flow of the program. Programming languages
provide exception handling mechanism to developers for handling errors and
exception events. 

I mined the source -code for automatically detecting 10 exception handling
anti-patterns
(https://today.java.net/article/2006/04/04/exception-handling-antipatterns). 
In this issue report, I list the exception handling anti-patterns and
code-smells that I found in the source code. My experimental results
demonstrate presence of various exception handling anti-patterns and throw
light on their intensity. I believe my tool for automatic detection of
anti-patterns in source code and the attached results can be useful to
programmers by helping them correct mistakes and write effective code.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

Ashish Sureka <as...@iiitd.ac.in> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ashish@iiitd.ac.in

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

--- Comment #13 from Ashish Sureka <as...@iiitd.ac.in> ---
Created attachment 31772
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31772&action=edit
FILE 5 – LIST OF ANTI-PATTERNS

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

--- Comment #3 from Ashish Sureka <as...@iiitd.ac.in> ---
Created attachment 31761
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31761&action=edit
FILE 2 – LIST OF ANTI-PATTERNS

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

--- Comment #5 from Ashish Sureka <as...@iiitd.ac.in> ---
Created attachment 31763
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31763&action=edit
FILE 4 – LIST OF ANTI-PATTERNS

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

--- Comment #1 from Ashish Sureka <as...@iiitd.ac.in> ---
Created attachment 31759
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31759&action=edit
List of Exception Management Anti-Patterns and Code Smells

The text file size was more than 1000 KB and hence I have zipped it.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

--- Comment #11 from Ashish Sureka <as...@iiitd.ac.in> ---
Created attachment 31770
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31770&action=edit
FILE 3 – LIST OF ANTI-PATTERNS

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #31759|text/plain                  |application/zip
          mime type|                            |

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

--- Comment #8 from Sebb <se...@apache.org> ---
See also Bug 56682 (JMeter) where I have made notes on some inconsistencies and
problems in the report

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

Ashish Sureka <as...@iiitd.ac.in> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #31759|0                           |1
        is obsolete|                            |

--- Comment #2 from Ashish Sureka <as...@iiitd.ac.in> ---
Created attachment 31760
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31760&action=edit
FILE 1 – LIST OF ANTI-PATTERNS

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

Remy Maucherat <re...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P5
           Severity|normal                      |enhancement

--- Comment #16 from Remy Maucherat <re...@apache.org> ---
No actual issue, so downgrading.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #17 from Mark Thomas <ma...@apache.org> ---
Blindly copying the output from some random code analysis tool into a bug
without validating the results is not going to generate a useful bug report.

I looked at the first few of these and they were all false positives. I did
manage to find one valid issue and a couple of possibles but the false positive
rate is significant.

The Tomcat project does use carefully selected code analysis tools and one of
the criteria for selection is the false positive rate. The false positive rate
of the tool used for this analysis is far too high to be useful.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

--- Comment #15 from Ashish Sureka <as...@iiitd.ac.in> ---
Please refer to https://issues.apache.org/bugzilla/show_bug.cgi?id=56682#c9

I have addressed all the comments/issues mentioned in the discussion thread (of
Bug 56682) and fixed it (except the minor nit which also I will address soon).
I have attached the new report (refer to Comment 9-14 and Attachments).

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

--- Comment #6 from Ashish Sureka <as...@iiitd.ac.in> ---
Created attachment 31764
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31764&action=edit
FILE 5 – LIST OF ANTI-PATTERNS

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

--- Comment #4 from Ashish Sureka <as...@iiitd.ac.in> ---
Created attachment 31762
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31762&action=edit
FILE 3 – LIST OF ANTI-PATTERNS

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

--- Comment #10 from Ashish Sureka <as...@iiitd.ac.in> ---
Created attachment 31769
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31769&action=edit
FILE 2 – LIST OF ANTI-PATTERNS

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

--- Comment #12 from Ashish Sureka <as...@iiitd.ac.in> ---
Created attachment 31771
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31771&action=edit
FILE 4 – LIST OF ANTI-PATTERNS

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

--- Comment #14 from Ashish Sureka <as...@iiitd.ac.in> ---
Created attachment 31773
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31773&action=edit
FILE 6 – LIST OF ANTI-PATTERNS

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

--- Comment #7 from Ashish Sureka <as...@iiitd.ac.in> ---
Created attachment 31765
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31765&action=edit
FILE 6 – LIST OF ANTI-PATTERNS

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 56681] List of Exception Management Anti-Patterns and Code Smells

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56681

Ashish Sureka <as...@iiitd.ac.in> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #31760|0                           |1
        is obsolete|                            |
  Attachment #31761|0                           |1
        is obsolete|                            |
  Attachment #31762|0                           |1
        is obsolete|                            |
  Attachment #31763|0                           |1
        is obsolete|                            |
  Attachment #31764|0                           |1
        is obsolete|                            |
  Attachment #31765|0                           |1
        is obsolete|                            |

--- Comment #9 from Ashish Sureka <as...@iiitd.ac.in> ---
Created attachment 31768
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31768&action=edit
FILE 1 – LIST OF ANTI-PATTERNS

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org