[Fb-contrib-commit] fb-contrib/src/com/mebigfatguy/fbcontrib/detect DeclaredRuntimeException.java,1.
Brought to you by:
dbrosius
From: Dave B. <dbr...@us...> - 2005-09-16 02:36:27
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20192/src/com/mebigfatguy/fbcontrib/detect Modified Files: DeclaredRuntimeException.java Log Message: report non java.lang exceptions as low priority Index: DeclaredRuntimeException.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- DeclaredRuntimeException.java 15 Sep 2005 04:03:12 -0000 1.1 +++ DeclaredRuntimeException.java 16 Sep 2005 02:36:19 -0000 1.2 @@ -49,6 +49,7 @@ if (et != null) { String[] exNames = et.getExceptionNames(); Set<String> methodRTExceptions = new HashSet<String>(); + int priority = LOW_PRIORITY; boolean foundRuntime = false; for (String ex : exNames) { boolean isRuntime = false; @@ -59,6 +60,8 @@ JavaClass exClass = Repository.lookupClass(ex); if (exClass.instanceOf(runtimeExceptionClass)) { runtimeExceptions.add(ex); + if (ex.startsWith("java.lang.")) + priority = NORMAL_PRIORITY; isRuntime = true; } } catch (ClassNotFoundException cnfe) { @@ -75,7 +78,7 @@ } if (foundRuntime) { - BugInstance bug = new BugInstance(this, "DRE_DECLARED_RUNTIME_EXCEPTION", NORMAL_PRIORITY) + BugInstance bug = new BugInstance(this, "DRE_DECLARED_RUNTIME_EXCEPTION", priority) .addClass(this) .addMethod(this); |