[Fb-contrib-commit] SF.net SVN: fb-contrib: [628] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-09-04 04:29:27
|
Revision: 628 http://svn.sourceforge.net/fb-contrib/?rev=628&view=rev Author: dbrosius Date: 2006-09-03 21:29:23 -0700 (Sun, 03 Sep 2006) Log Message: ----------- fix array return value handling 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 04:08:09 UTC (rev 627) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java 2006-09-04 04:29:23 UTC (rev 628) @@ -90,15 +90,15 @@ if (returnTypes.size() > 1) { JavaClass cls = findCommonType(returnTypes.keySet()); BugInstance bug = null; - if ((cls == null) || isInherited) { - bug = new BugInstance(this, "URV_UNRELATED_RETURN_VALUES", NORMAL_PRIORITY) - .addClass(this) - .addMethod(this); - } else if (!isInherited) { + if ((cls != null) && !isInherited) { bug = new BugInstance(this, "URV_CHANGE_RETURN_TYPE", NORMAL_PRIORITY) - .addClass(this) - .addMethod(this); + .addClass(this) + .addMethod(this); bug.addString(cls.getClassName()); + } else { + bug = new BugInstance(this, "URV_UNRELATED_RETURN_VALUES", NORMAL_PRIORITY) + .addClass(this) + .addMethod(this); } if (bug != null) { for (Integer pc : returnTypes.values()) { @@ -144,6 +144,9 @@ classes.remove("java/lang/Object"); boolean populate = true; for (JavaClass cls : classes) { + if (cls == null) { //array + return null; + } JavaClass[] infs = cls.getAllInterfaces(); JavaClass[] supers = cls.getSuperClasses(); if (populate) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |