CODSTA.NTE
Never "throw" an `Error' directly
Description
This rule flags code that "throw"s an `Error' directly.
"Throwing" an `Error' directly is too general.
Example
package CODSTA;
public class NTE {
void method () {
throw new LinkageError ();
}
void method2 () {
throw new Error ();
}
}
Repair
Explicitly deal with the subclasses of a superclass derived from `Error' to avoid potential bugs.
|