TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - Java Coding Standard
Search

Rule:  StrictException3Checked automatically with code checker

Synopsis:Avoid using exceptions as flow control
Language:Java
Severity Level:2
Category:StrictException


Description:
Using Exceptions as flow control leads to GOTOish code and obscures true exceptions when debugging.
public class Foo {
 void bar() {
  try {
   try {
   } catch (Exception e) {
    throw new WrapperException(e);
    // this is essentially a GOTO to the WrapperException catch block
   }
  } catch (WrapperException e) {
   // do some more stuff
  }
 }
}