Menu

#7 7 - Empty Catch Block

1.0
closed
None
2016-03-31
2016-03-28
No

In classes ServerCommNet.java and ClientCommNet.java we found multiple empty catch blocks. We don't know if this is a code smell but in Robusta (a tool in eclipse that detects bad smells) it apears like one.
Empty catch blocks are not a good practise because: either the code can handle the exception, then the catch clause shouldn't been empty, or the code can not handle the exception, then there should not be a try/catch block at all.

Discussion

  • João Pedro Gonçalves da Silva

    • assigned_to: Duarte Marcelino
     
  • Joel Filipe da Silva Monteiro

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,2 +1,2 @@
     In classes ServerCommNet.java and ClientCommNet.java we found multiple empty catch blocks. We don't know if this is a code smell but in Robusta (a tool in eclipse that detects bad smells) it apears like one.
    -Empty catch blocks are not a good practise because either code can handle the exception, then the catch clause shouldn't been empty, or the code can not handle the exception, then there should not be a try/catch block at all.
    +Empty catch blocks are not a good practise because: either the code can handle the exception, then the catch clause shouldn't been empty, or the code can not handle the exception, then there should not be a try/catch block at all.
    
     
  • Duarte Marcelino

    • status: open --> closed
     

Log in to post a comment.