[Fb-contrib-commit] SF.net SVN: fb-contrib: [632] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-09-04 05:33:08
|
Revision: 632 http://svn.sourceforge.net/fb-contrib/?rev=632&view=rev Author: dbrosius Date: 2006-09-03 22:32:59 -0700 (Sun, 03 Sep 2006) Log Message: ----------- if java.lang.Object is one of the actual return types, then lower the priority. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java 2006-09-04 05:19:30 UTC (rev 631) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java 2006-09-04 05:32:59 UTC (rev 632) @@ -88,19 +88,27 @@ returnTypes.clear(); super.visitCode(obj); if (returnTypes.size() > 1) { + int priority = NORMAL_PRIORITY; + for (JavaClass cls : returnTypes.keySet()) { + if ((cls != null) && "java.lang.Object".equals(cls.getClassName())) { + priority = LOW_PRIORITY; + break; + } + } + JavaClass cls = findCommonType(returnTypes.keySet()); BugInstance bug = null; if ((cls != null) && !isInherited) { - bug = new BugInstance(this, "URV_CHANGE_RETURN_TYPE", NORMAL_PRIORITY) + bug = new BugInstance(this, "URV_CHANGE_RETURN_TYPE", priority) .addClass(this) .addMethod(this); bug.addString(cls.getClassName()); } else if (!isInherited) { - bug = new BugInstance(this, "URV_UNRELATED_RETURN_VALUES", NORMAL_PRIORITY) + bug = new BugInstance(this, "URV_UNRELATED_RETURN_VALUES", priority) .addClass(this) .addMethod(this); } else { - bug = new BugInstance(this, "URV_INHERITED_METHOD_WITH_RELATED_TYPES", NORMAL_PRIORITY) + bug = new BugInstance(this, "URV_INHERITED_METHOD_WITH_RELATED_TYPES", priority) .addClass(this) .addMethod(this); if (cls != null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |