sloflin72 / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

List of Exception Management Anti-Patterns and Code Smells #568

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
List of Exception Management Anti-Patterns and Code Smells 
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 (H2-2014-01-18) 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. 

Original issue reported on code.google.com by ash...@iiitd.ac.in on 29 Jun 2014 at 11:53

Attachments:

GoogleCodeExporter commented 9 years ago
I understand some people may view this as an "anti-pattern", however I don't, 
for the cases you listed. 

Exceptions are for example caught in order to log them, and then re-thrown. I 
don't see anything wrong with that. If you don't agree, please explain why.

Original comment by thomas.t...@gmail.com on 30 Jun 2014 at 4:04