fb-contrib-commit Mailing List for fb-contrib (Page 74)
Brought to you by:
dbrosius
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(56) |
Oct
(60) |
Nov
(58) |
Dec
(89) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(66) |
Feb
(55) |
Mar
(85) |
Apr
(115) |
May
(35) |
Jun
(28) |
Jul
(3) |
Aug
(48) |
Sep
(37) |
Oct
(22) |
Nov
(14) |
Dec
(66) |
2007 |
Jan
(45) |
Feb
(63) |
Mar
(10) |
Apr
(1) |
May
(1) |
Jun
(12) |
Jul
|
Aug
|
Sep
(25) |
Oct
(21) |
Nov
(39) |
Dec
|
2008 |
Jan
(7) |
Feb
|
Mar
(26) |
Apr
(5) |
May
(2) |
Jun
(32) |
Jul
(9) |
Aug
(10) |
Sep
|
Oct
(3) |
Nov
(1) |
Dec
|
2009 |
Jan
(10) |
Feb
(31) |
Mar
(32) |
Apr
(35) |
May
(25) |
Jun
|
Jul
(31) |
Aug
(10) |
Sep
(95) |
Oct
(35) |
Nov
(10) |
Dec
(34) |
2010 |
Jan
(90) |
Feb
(4) |
Mar
(7) |
Apr
(20) |
May
(20) |
Jun
(13) |
Jul
(7) |
Aug
(18) |
Sep
(25) |
Oct
(4) |
Nov
(16) |
Dec
(2) |
2011 |
Jan
(1) |
Feb
|
Mar
(11) |
Apr
(3) |
May
(2) |
Jun
(26) |
Jul
(10) |
Aug
(2) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
2012 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(14) |
Nov
(3) |
Dec
(4) |
2013 |
Jan
(3) |
Feb
(2) |
Mar
(1) |
Apr
(4) |
May
|
Jun
(1) |
Jul
(3) |
Aug
|
Sep
|
Oct
(4) |
Nov
(3) |
Dec
(3) |
2014 |
Jan
(4) |
Feb
(2) |
Mar
(4) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(3) |
Dec
(3) |
2016 |
Jan
(2) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
(2) |
Nov
(7) |
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
(5) |
May
(2) |
Jun
|
Jul
(2) |
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
(3) |
2018 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
(5) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Dave B. <dbr...@us...> - 2005-10-19 04:22:18
|
Update of /cvsroot/fb-contrib/fb-contrib/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31277/etc Modified Files: findbugs.xml Log Message: tweak categories Index: findbugs.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/etc/findbugs.xml,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- findbugs.xml 10 Oct 2005 07:05:01 -0000 1.22 +++ findbugs.xml 19 Oct 2005 04:22:10 -0000 1.23 @@ -43,7 +43,8 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.ClassEnvy" speed="fast" - reports="CE_CLASS_ENVY" /> + reports="CE_CLASS_ENVY" + disabled="true" /> <!-- <Detector class="com.mebigfatguy.fbcontrib.detect.FinalParameters" @@ -74,14 +75,14 @@ <BugPattern abbrev="SCI" type="SCI_SYNCHRONIZED_COLLECTION_ITERATORS" category="CORRECTNESS" /> <BugPattern abbrev="CC" type="CC_CYCLOMATIC_COMPLEXITY" category="STYLE" /> <BugPattern abbrev="OCP" type="OCP_OVERLY_CONCRETE_PARAMETER" category="STYLE" /> - <BugPattern abbrev="LII" type="LII_LIST_INDEXED_ITERATING" category="PERFORMANCE" /> + <BugPattern abbrev="LII" type="LII_LIST_INDEXED_ITERATING" category="STYLE" /> <BugPattern abbrev="UCC" type="UCC_UNRELATED_COLLECTION_CONTENTS" category="STYLE" /> <BugPattern abbrev="DRE" type="DRE_DECLARED_RUNTIME_EXCEPTION" category="STYLE" /> <BugPattern abbrev="CE" type="CE_CLASS_ENVY" category="STYLE" experimental="true" /> <BugPattern abbrev="FP" type="FP_FINAL_PARAMETERS" category="STYLE" experimental="true" /> - <BugPattern abbrev="LSC" type="LSC_LITERAL_STRING_COMPARISON" category="STYLE" experimental="true" /> - <BugPattern abbrev="PCOA" type="PCOA_PARTIALLY_CONSTRUCTED_OBJECT_ACCESS" category="CORRECTNESS" experimental="true" /> - <BugPattern abbrev="DLC" type="DLC_DUBIOUS_LIST_COLLECTION" category="PERFORMANCE" experimental="true" /> - <BugPattern abbrev="PL" type="PL_PARALLEL_LISTS" category="STYLE" experimental="true" /> + <BugPattern abbrev="LSC" type="LSC_LITERAL_STRING_COMPARISON" category="STYLE" /> + <BugPattern abbrev="PCOA" type="PCOA_PARTIALLY_CONSTRUCTED_OBJECT_ACCESS" category="CORRECTNESS" /> + <BugPattern abbrev="DLC" type="DLC_DUBIOUS_LIST_COLLECTION" category="PERFORMANCE" /> + <BugPattern abbrev="PL" type="PL_PARALLEL_LISTS" category="STYLE" /> </FindbugsPlugin> \ No newline at end of file |
From: Dave B. <dbr...@us...> - 2005-10-19 04:11:09
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29567/src/com/mebigfatguy/fbcontrib/detect Modified Files: ClassEnvy.java Log Message: don't be envious of common classes/interfaces Index: ClassEnvy.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- ClassEnvy.java 18 Oct 2005 05:06:29 -0000 1.13 +++ ClassEnvy.java 19 Oct 2005 04:11:01 -0000 1.14 @@ -240,11 +240,6 @@ if (className.startsWith("java.") || className.startsWith("javax.")) return true; -// Come back and fix this code, comment out for now -// For some crazy reason, getAllInterfaces is throwing a ClassCastExceptions, trying to add -// the second JavaClass to the TreeSet, because the compare apparently sees different kinds -// of JavaClass objects. Is my ClassLoader screwed? wacky? I have no idea - /* try { JavaClass cls = Repository.lookupClass(className); JavaClass[] infs = cls.getAllInterfaces(); @@ -275,7 +270,7 @@ bugReporter.reportMissingClass(cfne); return true; } -*/ + return false; } |
From: Dave B. <dbr...@us...> - 2005-10-19 04:08:56
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29094/src/com/mebigfatguy/fbcontrib/detect Modified Files: OverlyConcreteParameter.java Log Message: ocp doesn't abstract to Comparable Index: OverlyConcreteParameter.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- OverlyConcreteParameter.java 10 Oct 2005 07:05:01 -0000 1.20 +++ OverlyConcreteParameter.java 19 Oct 2005 04:08:48 -0000 1.21 @@ -224,6 +224,8 @@ Map<JavaClass, List<String>> definers = new HashMap<JavaClass, List<String>>(); for (JavaClass ci : cls.getAllInterfaces()) { + if ("java.lang.Comparable".equals(ci.getClassName())) + continue; List<String> methodInfos = getPublicMethodInfos(ci); if (methodInfos.size() > 0) { definers.put(ci, methodInfos); |
From: Dave B. <dbr...@us...> - 2005-10-18 05:06:39
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31271/src/com/mebigfatguy/fbcontrib/detect Modified Files: ClassEnvy.java Log Message: warnings Index: ClassEnvy.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ClassEnvy.java 14 Oct 2005 07:53:31 -0000 1.12 +++ ClassEnvy.java 18 Oct 2005 05:06:29 -0000 1.13 @@ -43,8 +43,6 @@ public class ClassEnvy extends BytecodeScanningDetector implements StatelessDetector { private static final String ENVY_PERCENT_PROPERTY = "fb-contrib.ce.percent"; - private static final String ENVY_MIN_PROPERTY = "fb-contrib.ce.min"; - private static final Integer ONE = new Integer(1); private static final Set<String> ignorableInterfaces = new HashSet<String>(); static { ignorableInterfaces.add("java.io.Serializable"); |
From: Dave B. <dbr...@us...> - 2005-10-18 04:22:51
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23849/src/com/mebigfatguy/fbcontrib/detect Modified Files: InefficientStringBuffering.java Log Message: Index: InefficientStringBuffering.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- InefficientStringBuffering.java 18 Oct 2005 03:56:57 -0000 1.4 +++ InefficientStringBuffering.java 18 Oct 2005 04:22:42 -0000 1.5 @@ -65,7 +65,7 @@ if ("Ljava/lang/StringBuffer;".equals(signature) || "Ljava/lang/StringBuilder;".equals(signature)) { bugReporter.reportBug( - new BugInstance(this, "ISB_INEFFICIENT_STRING_BUFFERING", "toString".equals(this.getMethodName()) ? LOW_PRIORITY : NORMAL_PRIORITY) + new BugInstance(this, "ISB_INEFFICIENT_STRING_BUFFERING", "toString".equals(getMethodName()) ? LOW_PRIORITY : NORMAL_PRIORITY) .addClass(this) .addMethod(this) .addSourceLine(this)); |
From: Dave B. <dbr...@us...> - 2005-10-18 04:22:51
|
Update of /cvsroot/fb-contrib/fb-contrib/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23849/samples Modified Files: ISB_Sample.java Log Message: Index: ISB_Sample.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/samples/ISB_Sample.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ISB_Sample.java 3 Sep 2005 05:06:34 -0000 1.1 +++ ISB_Sample.java 18 Oct 2005 04:22:42 -0000 1.2 @@ -37,4 +37,14 @@ String msg = a + "false positive" + b + ((c == null) ? "" : (a + d)); return msg; } + + public String toString() + { + String a = System.getProperty("foo"); + String b = System.getProperty("boo"); + StringBuffer sb = new StringBuffer(); + sb.append("info: "); + sb.append(a + ":" + b); + return sb.toString(); + } } |
From: Dave B. <dbr...@us...> - 2005-10-18 04:07:03
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21373/src/com/mebigfatguy/fbcontrib/detect Modified Files: ListIndexedIterating.java Log Message: if the for loop is limited by a constant, don't report LII Index: ListIndexedIterating.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ListIndexedIterating.java 14 Oct 2005 03:31:00 -0000 1.6 +++ ListIndexedIterating.java 18 Oct 2005 04:06:46 -0000 1.7 @@ -144,6 +144,13 @@ continue; } if (seen == IF_ICMPGE) { + if (stack.getStackDepth() > 1) { + OpcodeStack.Item itm = stack.getStackItem(0); + if (itm.getConstant() != null) { + it.remove(); + continue; + } + } int branchTarget = getBranchTarget(); if ((branchTarget >= (fl.getLoopEnd() + 3)) && (branchTarget <= (fl.getLoopEnd() + 5))) { fl.setLoopState(LOOP_IN_BODY); |
From: Dave B. <dbr...@us...> - 2005-10-18 04:07:03
|
Update of /cvsroot/fb-contrib/fb-contrib/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21373/samples Modified Files: LII_Sample.java Log Message: if the for loop is limited by a constant, don't report LII Index: LII_Sample.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/samples/LII_Sample.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- LII_Sample.java 12 Oct 2005 04:26:21 -0000 1.2 +++ LII_Sample.java 18 Oct 2005 04:06:46 -0000 1.3 @@ -48,4 +48,13 @@ } return sb.toString(); } + + public String test6FP(List<String> l) + { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < 3; i++) + sb.append(l.get(i)); + + return sb.toString(); + } } \ No newline at end of file |
From: Dave B. <dbr...@us...> - 2005-10-18 03:57:05
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19825/src/com/mebigfatguy/fbcontrib/detect Modified Files: InefficientStringBuffering.java Log Message: report ISB at LOW for toString methods Index: InefficientStringBuffering.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- InefficientStringBuffering.java 1 Oct 2005 07:38:02 -0000 1.3 +++ InefficientStringBuffering.java 18 Oct 2005 03:56:57 -0000 1.4 @@ -65,7 +65,7 @@ if ("Ljava/lang/StringBuffer;".equals(signature) || "Ljava/lang/StringBuilder;".equals(signature)) { bugReporter.reportBug( - new BugInstance(this, "ISB_INEFFICIENT_STRING_BUFFERING", NORMAL_PRIORITY) + new BugInstance(this, "ISB_INEFFICIENT_STRING_BUFFERING", "toString".equals(this.getMethodName()) ? LOW_PRIORITY : NORMAL_PRIORITY) .addClass(this) .addMethod(this) .addSourceLine(this)); |
From: Dave B. <dbr...@us...> - 2005-10-15 16:34:27
|
Update of /cvsroot/fb-contrib/fb-contrib/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26160/etc Modified Files: messages.xml Log Message: spilleng Index: messages.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/etc/messages.xml,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- messages.xml 14 Oct 2005 03:32:36 -0000 1.22 +++ messages.xml 15 Oct 2005 16:34:20 -0000 1.23 @@ -208,7 +208,7 @@ <BugPattern type="OCP_OVERLY_CONCRETE_PARAMETER"> <ShortDescription>method needlessly defines parameter with concrete classes</ShortDescription> - <LongDescription>method {1} needlessly defines parameter with concrete classesx</LongDescription> + <LongDescription>method {1} needlessly defines parameter with concrete classes</LongDescription> <Details> <![CDATA[ <p> This method uses concrete classes for parameters when only methods defined in an implemented |
From: Dave B. <dbr...@us...> - 2005-10-14 07:53:39
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26348/src/com/mebigfatguy/fbcontrib/detect Modified Files: ClassEnvy.java Log Message: add more comments Index: ClassEnvy.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ClassEnvy.java 14 Oct 2005 07:37:54 -0000 1.11 +++ ClassEnvy.java 14 Oct 2005 07:53:31 -0000 1.12 @@ -242,8 +242,11 @@ if (className.startsWith("java.") || className.startsWith("javax.")) return true; -// Come back and fix this code, comment out for now - /* +// Come back and fix this code, comment out for now +// For some crazy reason, getAllInterfaces is throwing a ClassCastExceptions, trying to add +// the second JavaClass to the TreeSet, because the compare apparently sees different kinds +// of JavaClass objects. Is my ClassLoader screwed? wacky? I have no idea + /* try { JavaClass cls = Repository.lookupClass(className); JavaClass[] infs = cls.getAllInterfaces(); |
From: Dave B. <dbr...@us...> - 2005-10-14 07:38:03
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24186/src/com/mebigfatguy/fbcontrib/detect Modified Files: ClassEnvy.java Log Message: java 1.5 (at least) replicates code in finally blocks for both the try and catch block, causing method call counts, et.al to be too high. If the LineNumberTable exists, keep track of counts of distinct lines, so that this doesn't happen Index: ClassEnvy.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ClassEnvy.java 14 Oct 2005 07:13:17 -0000 1.10 +++ ClassEnvy.java 14 Oct 2005 07:37:54 -0000 1.11 @@ -28,6 +28,7 @@ import org.apache.bcel.Repository; import org.apache.bcel.classfile.Code; import org.apache.bcel.classfile.JavaClass; +import org.apache.bcel.classfile.LineNumberTable; import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.Type; @@ -43,6 +44,7 @@ { private static final String ENVY_PERCENT_PROPERTY = "fb-contrib.ce.percent"; private static final String ENVY_MIN_PROPERTY = "fb-contrib.ce.min"; + private static final Integer ONE = new Integer(1); private static final Set<String> ignorableInterfaces = new HashSet<String>(); static { ignorableInterfaces.add("java.io.Serializable"); @@ -54,7 +56,7 @@ private OpcodeStack stack; private String packageName; private String clsName; - private Map<String, Integer> clsAccessCount; + private Map<String, Set<Integer>> clsAccessCount; private int thisClsAccessCount; private String methodName; private boolean methodIsStatic; @@ -97,7 +99,7 @@ @Override public void visitCode(final Code obj) { stack.resetForMethodEntry(this); - clsAccessCount = new HashMap<String, Integer>(); + clsAccessCount = new HashMap<String, Set<Integer>>(); thisClsAccessCount = 0; if ("<clinit>".equals(methodName)) return; @@ -105,16 +107,16 @@ super.visitCode(obj); if (clsAccessCount.size() > 0) { - Map.Entry<String, Integer>[]envies = clsAccessCount.entrySet().toArray(new Map.Entry[clsAccessCount.size()]); - Arrays.sort(envies, new Comparator<Map.Entry<String, Integer>>() + Map.Entry<String, Set<Integer>>[]envies = clsAccessCount.entrySet().toArray(new Map.Entry[clsAccessCount.size()]); + Arrays.sort(envies, new Comparator<Map.Entry<String, Set<Integer>>>() { - public int compare(Map.Entry<String, Integer> entry1, Map.Entry<String, Integer> entry2) { - return entry2.getValue().intValue() - entry1.getValue().intValue(); + public int compare(Map.Entry<String, Set<Integer>> entry1, Map.Entry<String, Set<Integer>> entry2) { + return entry2.getValue().size() - entry1.getValue().size(); } }); - Map.Entry<String, Integer> bestEnvyEntry = envies[0]; - int bestEnvyCount = bestEnvyEntry.getValue().intValue(); + Map.Entry<String, Set<Integer>> bestEnvyEntry = envies[0]; + int bestEnvyCount = bestEnvyEntry.getValue().size(); if (bestEnvyCount < envyMin) return; String bestEnvy = bestEnvyEntry.getKey(); @@ -142,9 +144,6 @@ || (seen == INVOKESTATIC) || (seen == INVOKESPECIAL)) { String calledClass = getClassConstantOperand().replace('/', '.'); - if (calledClass.startsWith("java.") - || calledClass.startsWith("javax.")) - return; if (seen == INVOKEINTERFACE) { int parmCount = Type.getArgumentTypes(this.getSigConstantOperand()).length; @@ -212,19 +211,39 @@ thisClsAccessCount++; else { String calledPackage = getPackageName(calledClass); - if (similarPackages(calledPackage, packageName, 2)) { - Integer cnt = clsAccessCount.get(calledClass); - if (cnt == null) { - cnt = new Integer(1); - clsAccessCount.put(calledClass, cnt); + if (similarPackages(calledPackage, packageName, 2) && !generalPurpose(calledClass)) { + Set<Integer> lineNumbers = clsAccessCount.get(calledClass); + if (lineNumbers == null) { + lineNumbers = new HashSet<Integer>(); + addLineNumber(lineNumbers); + clsAccessCount.put(calledClass, lineNumbers); } else { - clsAccessCount.put(calledClass, new Integer(cnt.intValue() + 1)); + addLineNumber(lineNumbers); } } } } + private void addLineNumber(Set<Integer> lineNumbers) { + LineNumberTable lnt = getCode().getLineNumberTable(); + if (lnt == null) + lineNumbers.add(new Integer(-lineNumbers.size())); + else { + int line = lnt.getSourceLine(getPC()); + if (line < 0) + lineNumbers.add(new Integer(lineNumbers.size())); + else { + lineNumbers.add(new Integer(line)); + } + } + } private boolean generalPurpose(final String className) { + + if (className.startsWith("java.") || className.startsWith("javax.")) + return true; + +// Come back and fix this code, comment out for now + /* try { JavaClass cls = Repository.lookupClass(className); JavaClass[] infs = cls.getAllInterfaces(); @@ -255,6 +274,7 @@ bugReporter.reportMissingClass(cfne); return true; } +*/ return false; } |
From: Dave B. <dbr...@us...> - 2005-10-14 07:13:25
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20070/src/com/mebigfatguy/fbcontrib/detect Modified Files: ClassEnvy.java Log Message: count invokespecial as well Index: ClassEnvy.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ClassEnvy.java 14 Oct 2005 06:34:35 -0000 1.9 +++ ClassEnvy.java 14 Oct 2005 07:13:17 -0000 1.10 @@ -139,7 +139,8 @@ try { if ((seen == INVOKEVIRTUAL) || (seen == INVOKEINTERFACE) - || (seen == INVOKESTATIC)) { + || (seen == INVOKESTATIC) + || (seen == INVOKESPECIAL)) { String calledClass = getClassConstantOperand().replace('/', '.'); if (calledClass.startsWith("java.") || calledClass.startsWith("javax.")) |
From: Dave B. <dbr...@us...> - 2005-10-14 06:34:44
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11534/src/com/mebigfatguy/fbcontrib/detect Modified Files: ClassEnvy.java Log Message: better envy calculations, and make the min count configurable Index: ClassEnvy.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ClassEnvy.java 12 Oct 2005 05:25:45 -0000 1.8 +++ ClassEnvy.java 14 Oct 2005 06:34:35 -0000 1.9 @@ -18,9 +18,10 @@ */ package com.mebigfatguy.fbcontrib.detect; +import java.util.Arrays; +import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.Map; import java.util.Set; @@ -41,6 +42,7 @@ public class ClassEnvy extends BytecodeScanningDetector implements StatelessDetector { private static final String ENVY_PERCENT_PROPERTY = "fb-contrib.ce.percent"; + private static final String ENVY_MIN_PROPERTY = "fb-contrib.ce.min"; private static final Set<String> ignorableInterfaces = new HashSet<String>(); static { ignorableInterfaces.add("java.io.Serializable"); @@ -57,6 +59,7 @@ private String methodName; private boolean methodIsStatic; private double envyPercent = 0.90; + private int envyMin = 5; public ClassEnvy(final BugReporter bugReporter) { this.bugReporter = bugReporter; @@ -69,6 +72,9 @@ //Stick with original } } + Integer min = Integer.getInteger("ENVY_MIN_PROPERTY"); + if (min != null) + envyMin = min.intValue(); } @Override @@ -97,35 +103,34 @@ return; super.visitCode(obj); - - String bestEnvy = null; - double bestPercent = envyPercent; - Iterator<Map.Entry<String,Integer>> it = clsAccessCount.entrySet().iterator(); - while (it.hasNext()) { - Map.Entry<String,Integer> entry = it.next(); - if (generalPurpose(entry.getKey())) - continue; - - Integer mc = entry.getValue(); - if (mc.intValue() < 3) - continue; + + if (clsAccessCount.size() > 0) { + Map.Entry<String, Integer>[]envies = clsAccessCount.entrySet().toArray(new Map.Entry[clsAccessCount.size()]); + Arrays.sort(envies, new Comparator<Map.Entry<String, Integer>>() + { + public int compare(Map.Entry<String, Integer> entry1, Map.Entry<String, Integer> entry2) { + return entry2.getValue().intValue() - entry1.getValue().intValue(); + } + }); - double percent = ((double)mc.intValue()) / ((double)(mc.intValue() + thisClsAccessCount)); - if (percent > bestPercent) { - bestPercent = percent; - bestEnvy = entry.getKey(); - } - } - - if (bestPercent > envyPercent) { - if (implementsCommonInterface(bestEnvy)) + Map.Entry<String, Integer> bestEnvyEntry = envies[0]; + int bestEnvyCount = bestEnvyEntry.getValue().intValue(); + if (bestEnvyCount < envyMin) return; + String bestEnvy = bestEnvyEntry.getKey(); - bugReporter.reportBug( new BugInstance( this, "CE_CLASS_ENVY", NORMAL_PRIORITY) - .addClass(this) - .addMethod(this) - .addSourceLineRange(this, 0, obj.getCode().length-1) - .addString(bestEnvy)); + double bestPercent = ((double)bestEnvyCount) / ((double) (bestEnvyCount + thisClsAccessCount)); + + if (bestPercent > envyPercent) { + if (implementsCommonInterface(bestEnvy)) + return; + + bugReporter.reportBug( new BugInstance( this, "CE_CLASS_ENVY", NORMAL_PRIORITY) + .addClass(this) + .addMethod(this) + .addSourceLineRange(this, 0, obj.getCode().length-1) + .addString(bestEnvy)); + } } } |
From: Dave B. <dbr...@us...> - 2005-10-14 03:32:45
|
Update of /cvsroot/fb-contrib/fb-contrib/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17538/etc Modified Files: messages.xml Log Message: be more precise in documentation Index: messages.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/etc/messages.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- messages.xml 25 Sep 2005 06:11:03 -0000 1.21 +++ messages.xml 14 Oct 2005 03:32:36 -0000 1.22 @@ -67,8 +67,8 @@ <Details> <![CDATA[ <p> Looks for for loops that iterate over a java.util.List using an integer index, and get, - rather than using an Iterator. An iterator will perform better, but more importantly will allow - the code to be converted to other collections type.</p> + rather than using an Iterator. An iterator may perform better depending List implementation, + but more importantly will allow the code to be converted to other collections type.</p> <p>It is a moderately fast detector</p> ]]> </Details> @@ -225,8 +225,8 @@ <![CDATA[ <p>This method uses an integer based for loop to iterator over a java.util.List, by calling List.get(i) each time thru the loop. The integer is not used for other reasons. It is better - to use an Iterator instead, as iterators perform better, and they also allow for exchanging of - other collection types without issue.</p> + to use an Iterator instead, as depending on List implementation, iterators can perform better, + and they also allow for exchanging of other collection types without issue.</p> ]]> </Details> </BugPattern> |
From: Dave B. <dbr...@us...> - 2005-10-14 03:31:08
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17403/src/com/mebigfatguy/fbcontrib/detect Modified Files: ListIndexedIterating.java Log Message: If a loop index is used to get values out of 2 or more collections, don't report it for LII Index: ListIndexedIterating.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ListIndexedIterating.java 12 Oct 2005 05:17:03 -0000 1.5 +++ ListIndexedIterating.java 14 Oct 2005 03:31:00 -0000 1.6 @@ -24,11 +24,10 @@ import org.apache.bcel.classfile.Code; -import sun.security.krb5.internal.crypto.n; - import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; +import edu.umd.cs.findbugs.FieldAnnotation; import edu.umd.cs.findbugs.OpcodeStack; import edu.umd.cs.findbugs.StatelessDetector; @@ -176,11 +175,14 @@ && "(I)Ljava/lang/Object;".equals(getSigConstantOperand()))) { it.remove(); } else { - if (stack.getStackDepth() > 0) { + if (stack.getStackDepth() > 1) { OpcodeStack.Item itm = stack.getStackItem(0); Integer initValue = (Integer)itm.getConstant(); if ((initValue == null) || (initValue.intValue() != 0)) it.remove(); + itm = stack.getStackItem(1); + if (fl.isSecondItem(itm)) + it.remove(); } fl.setLoopRegLoaded(false); } @@ -207,6 +209,7 @@ private int loopReg; private int loopState; private boolean loopRegLoaded; + private OpcodeStack.Item loopCollectionItem; public ForLoop( final int start, final int end, final int reg) { loopStart = start; @@ -214,6 +217,7 @@ loopReg = reg; loopState = LOOP_NOT_STARTED; loopRegLoaded = false; + loopCollectionItem = null; } public int getLoopStart() { @@ -243,5 +247,33 @@ public boolean getLoopRegLoaded() { return loopRegLoaded; } + + public boolean isSecondItem(OpcodeStack.Item itm) { + if (loopCollectionItem == null) { + loopCollectionItem = itm; + return false; + } + + int seenReg = loopCollectionItem.getRegisterNumber(); + if (seenReg >= 0) { + if (itm.getField() != null) + return true; + int newReg = itm.getRegisterNumber(); + if ((newReg >= 0) && (seenReg != newReg)) + return true; + } else { + FieldAnnotation seenField = loopCollectionItem.getField(); + if (seenField != null) { + if (itm.getRegisterNumber() >= 0) + return true; + FieldAnnotation newField = itm.getField(); + if ((newField != null) && (!newField.getFieldName().equals(seenField.getFieldName()))) + return true; + } + } + + loopCollectionItem = itm; + return false; + } } } |
From: Dave B. <dbr...@us...> - 2005-10-14 01:28:30
|
Update of /cvsroot/fb-contrib/fb-contrib/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26894/lib Modified Files: bcel.jar Log Message: Index: bcel.jar =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/lib/bcel.jar,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvs29rkYX and /tmp/cvs9YgwKM differ |
From: Dave B. <dbr...@us...> - 2005-10-12 05:25:56
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1721/src/com/mebigfatguy/fbcontrib/detect Modified Files: ClassEnvy.java Log Message: if the envy class implements a well known java.* interfaces (besides the bogus ones) then don't report it. Index: ClassEnvy.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ClassEnvy.java 10 Oct 2005 07:05:01 -0000 1.7 +++ ClassEnvy.java 12 Oct 2005 05:25:45 -0000 1.8 @@ -19,8 +19,10 @@ package com.mebigfatguy.fbcontrib.detect; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.Map; +import java.util.Set; import org.apache.bcel.Repository; import org.apache.bcel.classfile.Code; @@ -38,7 +40,14 @@ public class ClassEnvy extends BytecodeScanningDetector implements StatelessDetector { - private static final String ENVY_PERCENT_PROPERTY = "fb-contrib.ce.percentt"; + private static final String ENVY_PERCENT_PROPERTY = "fb-contrib.ce.percent"; + private static final Set<String> ignorableInterfaces = new HashSet<String>(); + static { + ignorableInterfaces.add("java.io.Serializable"); + ignorableInterfaces.add("java.lang.Cloneable"); + ignorableInterfaces.add("java.lang.Comparable"); + }; + private BugReporter bugReporter; private OpcodeStack stack; private String packageName; @@ -109,6 +118,9 @@ } if (bestPercent > envyPercent) { + if (implementsCommonInterface(bestEnvy)) + return; + bugReporter.reportBug( new BugInstance( this, "CE_CLASS_ENVY", NORMAL_PRIORITY) .addClass(this) .addMethod(this) @@ -147,6 +159,26 @@ } } + private boolean implementsCommonInterface(String name) { + try { + JavaClass cls = Repository.lookupClass(name); + JavaClass[] infs = cls.getAllInterfaces(); + + for (JavaClass inf : infs) { + String infName = inf.getClassName(); + if (ignorableInterfaces.contains(infName)) + continue; + if (infName.startsWith("java.")) + return true; + } + return false; + + } catch (ClassNotFoundException cnfe) { + bugReporter.reportMissingClass(cnfe); + return true; + } + } + private boolean countClassAccess(final int classAtStackIndex) { String calledClass = null; |
From: Dave B. <dbr...@us...> - 2005-10-12 05:17:11
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32370/src/com/mebigfatguy/fbcontrib/detect Modified Files: ListIndexedIterating.java Log Message: if the for loop variable is assigned from another variable, don't report, either Index: ListIndexedIterating.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ListIndexedIterating.java 12 Oct 2005 04:26:21 -0000 1.4 +++ ListIndexedIterating.java 12 Oct 2005 05:17:03 -0000 1.5 @@ -178,7 +178,8 @@ } else { if (stack.getStackDepth() > 0) { OpcodeStack.Item itm = stack.getStackItem(0); - if (((Integer) itm.getConstant()).intValue() != 0) + Integer initValue = (Integer)itm.getConstant(); + if ((initValue == null) || (initValue.intValue() != 0)) it.remove(); } fl.setLoopRegLoaded(false); |
From: Dave B. <dbr...@us...> - 2005-10-12 04:26:29
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24527/src/com/mebigfatguy/fbcontrib/detect Modified Files: ListIndexedIterating.java Log Message: don't report LII when the for loop does not start with 0 Index: ListIndexedIterating.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ListIndexedIterating.java 1 Oct 2005 07:38:02 -0000 1.3 +++ ListIndexedIterating.java 12 Oct 2005 04:26:21 -0000 1.4 @@ -24,6 +24,8 @@ import org.apache.bcel.classfile.Code; +import sun.security.krb5.internal.crypto.n; + import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; @@ -173,8 +175,14 @@ && "get".equals(getNameConstantOperand()) && "(I)Ljava/lang/Object;".equals(getSigConstantOperand()))) { it.remove(); - } else + } else { + if (stack.getStackDepth() > 0) { + OpcodeStack.Item itm = stack.getStackItem(0); + if (((Integer) itm.getConstant()).intValue() != 0) + it.remove(); + } fl.setLoopRegLoaded(false); + } } break; } |
From: Dave B. <dbr...@us...> - 2005-10-12 04:26:29
|
Update of /cvsroot/fb-contrib/fb-contrib/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24527/samples Modified Files: LII_Sample.java Log Message: don't report LII when the for loop does not start with 0 Index: LII_Sample.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/samples/LII_Sample.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- LII_Sample.java 10 Sep 2005 04:12:41 -0000 1.1 +++ LII_Sample.java 12 Oct 2005 04:26:21 -0000 1.2 @@ -39,4 +39,13 @@ } return sb.toString(); } + + public String test5FP(List<String> l) + { + StringBuffer sb = new StringBuffer(); + for (int i = 1; i < l.size(); i++) { + sb.append(l.get(i)); + } + return sb.toString(); + } } \ No newline at end of file |
From: Dave B. <dbr...@us...> - 2005-10-10 07:05:04
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19948/src/com/mebigfatguy/fbcontrib/detect Modified Files: ClassEnvy.java CyclomaticComplexity.java OverlyConcreteParameter.java Log Message: do better source line annotating, and re-enable ClassEnvy for now, at least it's close to sane. Index: CyclomaticComplexity.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- CyclomaticComplexity.java 1 Oct 2005 07:38:02 -0000 1.5 +++ CyclomaticComplexity.java 10 Oct 2005 07:05:01 -0000 1.6 @@ -100,7 +100,8 @@ if (branches > reportLimit) { bugReporter.reportBug( new BugInstance( this, "CC_CYCLOMATIC_COMPLEXITY", NORMAL_PRIORITY) .addClass(this) - .addMethod(this)); + .addMethod(this) + .addSourceLine(classContext, this, 0)); } } catch (CFGBuilderException cbe) { bugReporter.logError("Failure examining basic blocks for method " + classContext.getJavaClass().getClassName() + "." + obj.getName() + " in Cyclomatic Complexity detector", cbe); Index: ClassEnvy.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ClassEnvy.java 10 Oct 2005 06:36:14 -0000 1.6 +++ ClassEnvy.java 10 Oct 2005 07:05:01 -0000 1.7 @@ -112,7 +112,7 @@ bugReporter.reportBug( new BugInstance( this, "CE_CLASS_ENVY", NORMAL_PRIORITY) .addClass(this) .addMethod(this) - .addSourceLine(this, 0) + .addSourceLineRange(this, 0, obj.getCode().length-1) .addString(bestEnvy)); } } Index: OverlyConcreteParameter.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- OverlyConcreteParameter.java 5 Oct 2005 06:07:26 -0000 1.19 +++ OverlyConcreteParameter.java 10 Oct 2005 07:05:01 -0000 1.20 @@ -182,6 +182,7 @@ bugReporter.reportBug( new BugInstance( this, "OCP_OVERLY_CONCRETE_PARAMETER", NORMAL_PRIORITY) .addClass(this) .addMethod(this) + .addSourceLine(this, 0) .addString("Parameter [" + reg.intValue() + "] " + name + " implements " + infName)); } } |
From: Dave B. <dbr...@us...> - 2005-10-10 07:05:04
|
Update of /cvsroot/fb-contrib/fb-contrib/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19948/etc Modified Files: findbugs.xml Log Message: do better source line annotating, and re-enable ClassEnvy for now, at least it's close to sane. Index: findbugs.xml =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/etc/findbugs.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- findbugs.xml 5 Oct 2005 03:37:30 -0000 1.21 +++ findbugs.xml 10 Oct 2005 07:05:01 -0000 1.22 @@ -43,8 +43,8 @@ <Detector class="com.mebigfatguy.fbcontrib.detect.ClassEnvy" speed="fast" - reports="CE_CLASS_ENVY" - hidden="true" /> + reports="CE_CLASS_ENVY" /> + <!-- <Detector class="com.mebigfatguy.fbcontrib.detect.FinalParameters" speed="fast" |
From: Dave B. <dbr...@us...> - 2005-10-10 06:36:23
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9906/src/com/mebigfatguy/fbcontrib/detect Modified Files: ClassEnvy.java Log Message: more restrictive tests for class envy. Subtract out ALOAD calls, and don't report on <clinit> Index: ClassEnvy.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ClassEnvy.java 1 Oct 2005 07:38:02 -0000 1.5 +++ ClassEnvy.java 10 Oct 2005 06:36:14 -0000 1.6 @@ -25,6 +25,7 @@ import org.apache.bcel.Repository; import org.apache.bcel.classfile.Code; import org.apache.bcel.classfile.JavaClass; +import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.Type; import edu.umd.cs.findbugs.BugInstance; @@ -44,6 +45,8 @@ private String clsName; private Map<String, Integer> clsAccessCount; private int thisClsAccessCount; + private String methodName; + private boolean methodIsStatic; private double envyPercent = 0.90; public ClassEnvy(final BugReporter bugReporter) { @@ -72,11 +75,18 @@ super.visitClassContext(classContext); } + public void visitMethod(final Method obj) { + methodName = obj.getName(); + methodIsStatic = (obj.getAccessFlags() & ACC_STATIC) != 0; + } @Override public void visitCode(final Code obj) { stack.resetForMethodEntry(this); clsAccessCount = new HashMap<String, Integer>(); thisClsAccessCount = 0; + if ("<clinit>".equals(methodName)) + return; + super.visitCode(obj); String bestEnvy = null; @@ -129,6 +139,8 @@ countClassAccess(1); } else if (seen == GETFIELD) { countClassAccess(0); + } else if ((seen == ALOAD_0) && (!methodIsStatic)) { + countClassAccess(clsName); } } finally { stack.sawOpcode(this, seen); |
From: Dave B. <dbr...@us...> - 2005-10-05 06:07:36
|
Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2434/src/com/mebigfatguy/fbcontrib/detect Modified Files: OverlyConcreteParameter.java Log Message: don't report ocp for parms that are aliased in static members, as well. Index: OverlyConcreteParameter.java =================================================================== RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- OverlyConcreteParameter.java 1 Oct 2005 07:38:02 -0000 1.18 +++ OverlyConcreteParameter.java 5 Oct 2005 06:07:26 -0000 1.19 @@ -123,7 +123,7 @@ parameterDefiners.clear(); } } - } else if ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3)) || (seen == PUTFIELD)) { + } else if ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3)) || (seen == PUTFIELD) || (seen == PUTSTATIC)) { //Don't check parameters that are aliased if (stack.getStackDepth() > 0) { OpcodeStack.Item itm = stack.getStackItem(0); |