[Fb-contrib-commit] SF.net SVN: fb-contrib: [583] trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/de
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-08-04 14:25:15
|
Revision: 583 Author: dbrosius Date: 2006-08-04 07:24:59 -0700 (Fri, 04 Aug 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=583&view=rev Log Message: ----------- it would make sense if the classname was included to differentiate simple getters. duh! Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/RedundantMethodCalls.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java 2006-08-04 06:37:49 UTC (rev 582) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/CollectStatistics.java 2006-08-04 14:24:59 UTC (rev 583) @@ -67,7 +67,7 @@ case SG_SAW_GETFIELD: if ((seen >= IRETURN) && (seen <= ARETURN)) { - statistics.addSimpleGetter(getMethodName(), getMethodSig()); + statistics.addSimpleGetter(getClassName(), getMethodName(), getMethodSig()); } sgState = SG_INVALID; break; Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java 2006-08-04 06:37:49 UTC (rev 582) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/collect/Statistics.java 2006-08-04 14:24:59 UTC (rev 583) @@ -19,11 +19,11 @@ simpleGetters.clear(); } - public void addSimpleGetter(String methodName, String signature) { - simpleGetters.add(methodName + ":" + signature); + public void addSimpleGetter(String className, String methodName, String signature) { + simpleGetters.add(className + ":" + methodName + ":" + signature); } - public boolean isSimpleGetter(String methodName, String signature) { - return simpleGetters.contains(methodName + ":" + signature); + public boolean isSimpleGetter(String className, String methodName, String signature) { + return simpleGetters.contains(className + ":" + methodName + ":" + signature); } } Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/RedundantMethodCalls.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/RedundantMethodCalls.java 2006-08-04 06:37:49 UTC (rev 582) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/RedundantMethodCalls.java 2006-08-04 14:24:59 UTC (rev 583) @@ -174,7 +174,7 @@ Object[] parms = mc.getParms(); if (Arrays.equals(parms, parmConstants)) { Statistics statistics = Statistics.getStatistics(); - bugReporter.reportBug(new BugInstance(this, "RMC_REDUNDANT_METHOD_CALLS", statistics.isSimpleGetter(methodName, signature) ? LOW_PRIORITY : NORMAL_PRIORITY) + bugReporter.reportBug(new BugInstance(this, "RMC_REDUNDANT_METHOD_CALLS", statistics.isSimpleGetter(getClassConstantOperand(), methodName, signature) ? LOW_PRIORITY : NORMAL_PRIORITY) .addClass(this) .addMethod(this) .addSourceLine(this) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |