Jtest logo




Contents  Previous  Next  Index

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.


Contents  Previous  Next  Index

ParaSoft logo
(888) 305-0041 info@parasoft.com Copyright © 1996-2001 ParaSoft