Synopsis: | Avoid throwing raw exception types |
Language: | Java |
Severity Level: | 3 |
Category: | StrictException |
Description: |
Avoid throwing certain exception types. Rather than throw a raw RuntimeException, Throwable,
Exception, or Error, use a subclassed exception or error instead or use an assert.public class Foo { public void bar() throws Exception { throw new Exception(); } } |