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 } } } |