[Fb-contrib-commit] SF.net SVN: fb-contrib: [994] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
From: <dbr...@us...> - 2008-03-09 04:04:04
|
Revision: 994 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=994&view=rev Author: dbrosius Date: 2008-03-08 20:04:07 -0800 (Sat, 08 Mar 2008) Log Message: ----------- only report at a LOW_PRIORITY when the inheritance classes don't appear to belong to the caller. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InheritanceTypeChecking.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InheritanceTypeChecking.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InheritanceTypeChecking.java 2008-03-09 04:03:15 UTC (rev 993) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InheritanceTypeChecking.java 2008-03-09 04:04:07 UTC (rev 994) @@ -25,6 +25,7 @@ import org.apache.bcel.classfile.Code; import com.mebigfatguy.fbcontrib.utils.RegisterUtils; +import com.mebigfatguy.fbcontrib.utils.SignatureUtils; import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; @@ -156,7 +157,16 @@ } } if (matchCount > 1) { - bugReporter.reportBug(new BugInstance(bsd, "ITC_INHERITANCE_TYPE_CHECKING", NORMAL_PRIORITY) + String clsName = bsd.getClassName(); + int priority = NORMAL_PRIORITY; + for (String type : instanceOfTypes) { + if (!SignatureUtils.similarPackages(clsName, type, 2)) { + priority = LOW_PRIORITY; + break; + } + } + + bugReporter.reportBug(new BugInstance(bsd, "ITC_INHERITANCE_TYPE_CHECKING", priority) .addClass(bsd) .addMethod(bsd) .addSourceLine(bsd, firstPC)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |