fb-contrib-commit Mailing List for fb-contrib (Page 56)
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: <dbr...@us...> - 2006-04-17 15:47:26
|
Revision: 465 Author: dbrosius Date: 2006-04-17 08:47:18 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=465&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java 2006-04-17 15:43:17 UTC (rev 464) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java 2006-04-17 15:47:18 UTC (rev 465) @@ -39,7 +39,6 @@ import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; import edu.umd.cs.findbugs.SourceLineAnnotation; -import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.AnalysisContext; import edu.umd.cs.findbugs.ba.ClassContext; import edu.umd.cs.findbugs.ba.SourceFile; @@ -50,7 +49,7 @@ * help the jvm optimize the invocation of this method, you should consider defining these parameters * as final. */ -public class FinalParameters extends BytecodeScanningDetector implements StatelessDetector +public class FinalParameters extends BytecodeScanningDetector { private BugReporter bugReporter; private Set<Integer> changedParms; @@ -72,16 +71,6 @@ } /** - * clone this detector so that it can be a StatelessDetector - * - * @return a clone of this object - */ - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - /** * overrides the visitor to initialize the 'has source' flag * * @param classContext the context object for the currently parsed class @@ -110,6 +99,8 @@ parmCount = Type.getArgumentTypes(obj.getSignature()).length; super.visitMethod(obj); + srcLineAnnotation = null; + sourceLines = null; } /** @@ -216,6 +207,7 @@ } bi.addString(parmName); } + changedParms = null; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 15:43:30
|
Revision: 464 Author: dbrosius Date: 2006-04-17 08:43:17 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=464&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/.classpath trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java Modified: trunk/fb-contrib/.classpath =================================================================== --- trunk/fb-contrib/.classpath 2006-04-17 15:40:42 UTC (rev 463) +++ trunk/fb-contrib/.classpath 2006-04-17 15:43:17 UTC (rev 464) @@ -3,8 +3,8 @@ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="samples"/> - <classpathentry kind="lib" path="O:/fb-contrib/fb-contrib/lib/findbugs.jar"/> - <classpathentry kind="lib" path="O:/fb-contrib/fb-contrib/lib/bcel.jar"/> - <classpathentry kind="lib" path="O:/fb-contrib/fb-contrib/samples/lib/jsp-api.jar"/> + <classpathentry kind="lib" path="C:/fb-contrib/fb-contrib/lib/findbugs.jar"/> + <classpathentry kind="lib" path="C:/fb-contrib/fb-contrib/lib/bcel.jar"/> + <classpathentry kind="lib" path="C:/fb-contrib/fb-contrib/samples/lib/jsp-api.jar"/> <classpathentry kind="output" path="classes"/> </classpath> Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2006-04-17 15:40:42 UTC (rev 463) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2006-04-17 15:43:17 UTC (rev 464) @@ -42,7 +42,6 @@ import edu.umd.cs.findbugs.BytecodeScanningDetector; import edu.umd.cs.findbugs.FieldAnnotation; import edu.umd.cs.findbugs.SourceLineAnnotation; -import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.BasicBlock; import edu.umd.cs.findbugs.ba.CFG; import edu.umd.cs.findbugs.ba.ClassContext; @@ -53,14 +52,14 @@ * finds fields that are used in a locals only fashion, specifically private fields * that are accessed first in each method with a store vs. a load. */ -public class FieldCouldBeLocal extends BytecodeScanningDetector implements StatelessDetector { - +public class FieldCouldBeLocal extends BytecodeScanningDetector +{ private BugReporter bugReporter; private ClassContext clsContext; - private Map<String, FieldInfo> localizableFields = new HashMap<String, FieldInfo>(); + private Map<String, FieldInfo> localizableFields; private CFG cfg; private ConstantPoolGen cpg; - private BitSet visitedBlocks = new BitSet(); + private BitSet visitedBlocks; /** * constructs a FCBL detector given the reporter to report bugs on. @@ -72,17 +71,6 @@ } /** - * clone this detector so that it can be a StatelessDetector. - * - * @return a clone of this object - * @throws CloneNotSupportedException should not happen - */ - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - /** * overrides the visitor to collect localizable fields, and then report those that * survive all method checks. * @@ -90,7 +78,8 @@ */ @Override public void visitClassContext(ClassContext classContext) { - localizableFields.clear(); + localizableFields = new HashMap<String, FieldInfo>(); + visitedBlocks = new BitSet(); clsContext = classContext; JavaClass cls = classContext.getJavaClass(); Field[] fields = cls.getFields(); @@ -114,6 +103,9 @@ bugReporter.reportBug(bug); } } + localizableFields = null; + visitedBlocks = null; + clsContext = null; } /** @@ -140,6 +132,9 @@ catch (Exception e) { localizableFields.clear(); } + finally { + cfg = null; + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 15:40:47
|
Revision: 463 Author: dbrosius Date: 2006-04-17 08:40:42 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=463&view=rev Log Message: ----------- oi Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java 2006-04-17 15:37:01 UTC (rev 462) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java 2006-04-17 15:40:42 UTC (rev 463) @@ -29,7 +29,6 @@ import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.Detector; -import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.StringAnnotation; import edu.umd.cs.findbugs.ba.ClassContext; import edu.umd.cs.findbugs.visitclass.PreorderVisitor; @@ -40,7 +39,7 @@ * If a RuntimeException is declared, it implies that this exception type is expected to happen, * which if true, should be handled in code, and not propogated. */ -public class DeclaredRuntimeException extends PreorderVisitor implements Detector, StatelessDetector +public class DeclaredRuntimeException extends PreorderVisitor implements Detector { private BugReporter bugReporter; private static final Set<String> runtimeExceptions = new HashSet<String>(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 15:37:12
|
Revision: 462 Author: dbrosius Date: 2006-04-17 08:37:01 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=462&view=rev Log Message: ----------- oops, fix booboo Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DateComparison.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java 2006-04-17 15:29:54 UTC (rev 461) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java 2006-04-17 15:37:01 UTC (rev 462) @@ -29,8 +29,9 @@ import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; import edu.umd.cs.findbugs.OpcodeStack; -import edu.umd.cs.findbugs.StatelessDetector; +import edu.umd.cs.findbugs.ba.ClassContext; + /** * looks for methods that build xml based strings by concatenation strings * and custom values together. Doing so makes brittle code, that is difficult to Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java 2006-04-17 15:29:54 UTC (rev 461) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java 2006-04-17 15:37:01 UTC (rev 462) @@ -18,7 +18,25 @@ */ package com.mebigfatguy.fbcontrib.detect; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import org.apache.bcel.classfile.Code; +import org.apache.bcel.classfile.Method; + +import edu.umd.cs.findbugs.BugInstance; +import edu.umd.cs.findbugs.BugReporter; +import edu.umd.cs.findbugs.Detector; +import edu.umd.cs.findbugs.ba.BasicBlock; +import edu.umd.cs.findbugs.ba.CFG; +import edu.umd.cs.findbugs.ba.CFGBuilderException; +import edu.umd.cs.findbugs.ba.ClassContext; +import edu.umd.cs.findbugs.ba.Edge; +import edu.umd.cs.findbugs.ba.EdgeTypes; +import edu.umd.cs.findbugs.visitclass.PreorderVisitor; + + /** * Calculates the McCabe Cyclomatic Complexity measure and reports methods that have an * excessive value. This report value can be set with system property 'fb-contrib.cc.limit'. Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DateComparison.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DateComparison.java 2006-04-17 15:29:54 UTC (rev 461) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DateComparison.java 2006-04-17 15:37:01 UTC (rev 462) @@ -26,13 +26,13 @@ import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; -import edu.umd.cs.findbugs.StatelessDetector; + /** * Looks for inefficient comparison of Date objects using two comparisons when one would do. */ -public class DateComparison extends BytecodeScanningDetector implements StatelessDetector { - +public class DateComparison extends BytecodeScanningDetector +{ private static final int SEEN_NOTHING = 0; private static final int SEEN_LOAD1_1 = 1; private static final int SEEN_LOAD1_2 = 2; @@ -65,17 +65,6 @@ } /** - * clone this detector so that it can be a StatelessDetector - * - * @return a clone of this object - */ - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - - /** * overrides the visitor to reset the registers * * @param obj the method of the currently parsed method This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 15:30:10
|
Revision: 461 Author: dbrosius Date: 2006-04-17 08:29:54 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=461&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java 2006-04-17 15:28:23 UTC (rev 460) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java 2006-04-17 15:29:54 UTC (rev 461) @@ -18,30 +18,12 @@ */ package com.mebigfatguy.fbcontrib.detect; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; -import org.apache.bcel.classfile.Code; -import org.apache.bcel.classfile.Method; - -import edu.umd.cs.findbugs.BugInstance; -import edu.umd.cs.findbugs.BugReporter; -import edu.umd.cs.findbugs.Detector; -import edu.umd.cs.findbugs.StatelessDetector; -import edu.umd.cs.findbugs.ba.BasicBlock; -import edu.umd.cs.findbugs.ba.CFG; -import edu.umd.cs.findbugs.ba.CFGBuilderException; -import edu.umd.cs.findbugs.ba.ClassContext; -import edu.umd.cs.findbugs.ba.Edge; -import edu.umd.cs.findbugs.ba.EdgeTypes; -import edu.umd.cs.findbugs.visitclass.PreorderVisitor; - /** * Calculates the McCabe Cyclomatic Complexity measure and reports methods that have an * excessive value. This report value can be set with system property 'fb-contrib.cc.limit'. */ -public class CyclomaticComplexity extends PreorderVisitor implements Detector, StatelessDetector +public class CyclomaticComplexity extends PreorderVisitor implements Detector { public static final String LIMIT_PROPERTY = "fb-contrib.cc.limit"; private BugReporter bugReporter; @@ -60,16 +42,6 @@ } /** - * clone this detector so that it can be a StatelessDetector - * - * @return a clone of this object - */ - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - /** * overrides the visitor to store the class context * * @param context the context object for the currently parsed class @@ -77,6 +49,7 @@ public void visitClassContext(final ClassContext context) { classContext = context; classContext.getJavaClass().accept(this); + classContext = null; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 15:28:33
|
Revision: 460 Author: dbrosius Date: 2006-04-17 08:28:23 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=460&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java 2006-04-17 03:47:47 UTC (rev 459) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java 2006-04-17 15:28:23 UTC (rev 460) @@ -37,7 +37,7 @@ * modify, validate and understand. It is cleaner to create external xml files that are * transformed at runtime, using parameters set through Transformer.setParameter. */ -public class CustomBuiltXML extends BytecodeScanningDetector implements StatelessDetector +public class CustomBuiltXML extends BytecodeScanningDetector { private static final Map<Pattern, Boolean> xmlPatterns = new HashMap<Pattern, Boolean>(); static { @@ -54,7 +54,7 @@ } private static final String CBX_MIN_REPORTABLE_ITEMS = "fb-contrib.cbx.minxmlitems"; private BugReporter bugReporter; - private OpcodeStack stack = new OpcodeStack(); + private OpcodeStack stack; private int xmlItemCount = 0; private int xmlConfidentCount = 0; private int lowReportingThreshold; @@ -75,17 +75,19 @@ highReportingThreshold = lowReportingThreshold << 2; } + /** + * overrides the visitor to create and destroy the stack + * + * @param classContext the context object of the currently parsed class + */ + @Override + public void visitClassContext(ClassContext classContext) { + stack = new OpcodeStack(); + super.visitClassContext(classContext); + stack = null; + } + /** - * clone this detector so that it can be a StatelessDetector - * - * @return a clone of this object - */ - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - /** * overrides the visitor reset the opcode stack * * @param obj the code object of the currently parsed method This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 03:47:51
|
Revision: 459 Author: dbrosius Date: 2006-04-16 20:47:47 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=459&view=rev Log Message: ----------- oi Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java 2006-04-17 03:46:47 UTC (rev 458) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java 2006-04-17 03:47:47 UTC (rev 459) @@ -34,7 +34,6 @@ import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.Detector; -import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.ClassContext; import edu.umd.cs.findbugs.visitclass.DismantleBytecode; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 03:46:52
|
Revision: 458 Author: dbrosius Date: 2006-04-16 20:46:47 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=458&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java 2006-04-17 03:44:46 UTC (rev 457) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java 2006-04-17 03:46:47 UTC (rev 458) @@ -41,10 +41,10 @@ /** * Looks for methods that are direct copies of the implementation in the super class */ -public class CopiedOverriddenMethod extends DismantleBytecode implements Detector, StatelessDetector +public class CopiedOverriddenMethod extends DismantleBytecode implements Detector { private BugReporter bugReporter; - private Map<String, Code> superclassCode = new HashMap<String, Code>(); + private Map<String, Code> superclassCode; private ClassContext classContext; private String curMethodInfo; private ConstantPoolGen childPoolGen, parentPoolGen; @@ -59,16 +59,6 @@ } /** - * clone this detector so that it can be a StatelessDetector - * - * @return a clone of this object - */ - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - /** * overrides the visitor to accept classes derived from non java.lang.Object classes. * * @param classContext the context object of the currently parsed class @@ -79,7 +69,7 @@ String superName = cls.getSuperclassName(); if (!"java.lang.Object".equals(superName)) { this.classContext = classContext; - superclassCode.clear(); + superclassCode = new HashMap<String, Code>(); JavaClass superCls = cls.getSuperClass(); childPoolGen = new ConstantPoolGen(cls.getConstantPool()); parentPoolGen = new ConstantPoolGen(superCls.getConstantPool()); @@ -94,12 +84,14 @@ } } cls.accept(this); - superclassCode.clear(); - childPoolGen = null; - parentPoolGen = null; } } catch (ClassNotFoundException cnfe) { bugReporter.reportMissingClass(cnfe); + } finally { + superclassCode = null; + classContext = null; + childPoolGen = null; + parentPoolGen = null; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 03:44:50
|
Revision: 457 Author: dbrosius Date: 2006-04-16 20:44:46 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=457&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java 2006-04-17 03:42:48 UTC (rev 456) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java 2006-04-17 03:44:46 UTC (rev 457) @@ -29,7 +29,7 @@ import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; -import edu.umd.cs.findbugs.StatelessDetector; +import edu.umd.cs.findbugs.ba.ClassContext; /** * looks for methods that access arrays or classes that implement java.util.List @@ -37,7 +37,8 @@ * variable, but if specific indices mean certain things, perhaps a first class object * would be a better choice for a container. */ -public class ConstantListIndex extends BytecodeScanningDetector implements StatelessDetector { +public class ConstantListIndex extends BytecodeScanningDetector +{ private static final String MAX_ICONST0_LOOP_DISTANCE_PROPERTY = "fb-contrib.cli.maxloopdistance"; private static final int SEEN_NOTHING = 0; private static final int SEEN_CONSTANT_0 = 1; @@ -45,7 +46,7 @@ private BugReporter bugReporter; private int state; - private Set<Integer> iConst0Looped = new HashSet<Integer>(); + private Set<Integer> iConst0Looped; private int max_iConst0LoopDistance; /** @@ -56,15 +57,17 @@ this.bugReporter = bugReporter; max_iConst0LoopDistance = Integer.getInteger(MAX_ICONST0_LOOP_DISTANCE_PROPERTY, 30).intValue(); } - + /** - * clone this detector so that it can be a StatelessDetector + * implements the visitor to create and clear the const0loop set * - * @return a clone of this object + * @param classContext the context object of the currently parsed class */ @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); + public void visitClassContext(ClassContext classContext) { + iConst0Looped = new HashSet<Integer>(); + super.visitClassContext(classContext); + iConst0Looped = null; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 03:42:52
|
Revision: 456 Author: dbrosius Date: 2006-04-16 20:42:48 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=456&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverloading.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverloading.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverloading.java 2006-04-17 03:41:44 UTC (rev 455) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingAutoboxedOverloading.java 2006-04-17 03:42:48 UTC (rev 456) @@ -30,7 +30,6 @@ import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.Detector; -import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.ClassContext; import edu.umd.cs.findbugs.visitclass.PreorderVisitor; @@ -47,7 +46,7 @@ * </pre> * but instead maps to one that takes an int long, float or double. */ -public class ConfusingAutoboxedOverloading extends PreorderVisitor implements Detector, StatelessDetector +public class ConfusingAutoboxedOverloading extends PreorderVisitor implements Detector { private static final int JDK15_MAJOR = 49; @@ -69,16 +68,6 @@ } /** - * clone this detector so that it can be a StatelessDetector - * - * @return a clone of this object - */ - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - /** * overrides the visitor to look for confusing signatures * * @param classContext the context object that holds the JavaClass currently being parsed This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 03:41:49
|
Revision: 455 Author: dbrosius Date: 2006-04-16 20:41:44 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=455&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java 2006-04-17 03:38:12 UTC (rev 454) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java 2006-04-17 03:41:44 UTC (rev 455) @@ -36,14 +36,13 @@ import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; import edu.umd.cs.findbugs.OpcodeStack; -import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.ClassContext; /** * finds methods that excessively use methods from another class. This probably means * these methods should be defined in that other class. */ -public class ClassEnvy extends BytecodeScanningDetector implements StatelessDetector +public class ClassEnvy extends BytecodeScanningDetector { private static final String ENVY_PERCENT_PROPERTY = "fb-contrib.ce.percent"; private static final Set<String> ignorableInterfaces = new HashSet<String>(); @@ -70,7 +69,6 @@ */ public ClassEnvy(final BugReporter bugReporter) { this.bugReporter = bugReporter; - stack = new OpcodeStack(); String percent = System.getProperty(ENVY_PERCENT_PROPERTY); if (percent != null) { try { @@ -85,16 +83,6 @@ } /** - * clone this detector so that it can be a StatelessDetector - * - * @return a clone of this object - */ - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - /** * overrides the visitor to collect package and class names * * @param classContext the context object that holds the JavaClass being parsed @@ -104,7 +92,10 @@ JavaClass cls = classContext.getJavaClass(); packageName = cls.getPackageName(); clsName = cls.getClassName(); + stack = new OpcodeStack(); super.visitClassContext(classContext); + stack = null; + clsAccessCount = null; } /** @@ -127,11 +118,11 @@ @Override public void visitCode(final Code obj) { stack.resetForMethodEntry(this); - clsAccessCount = new HashMap<String, Set<Integer>>(); thisClsAccessCount = 0; if ("<clinit>".equals(methodName)) return; + clsAccessCount = new HashMap<String, Set<Integer>>(); super.visitCode(obj); if (clsAccessCount.size() > 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 03:38:17
|
Revision: 454 Author: dbrosius Date: 2006-04-16 20:38:12 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=454&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java 2006-04-17 03:36:08 UTC (rev 453) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java 2006-04-17 03:38:12 UTC (rev 454) @@ -35,20 +35,20 @@ import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; import edu.umd.cs.findbugs.OpcodeStack; -import edu.umd.cs.findbugs.StatelessDetector; +import edu.umd.cs.findbugs.ba.ClassContext; /** * looks for methods that are implemented using synchronized blocks, but are overly * synchronized because the beginning of the block only accesses local variables, * and not member variables, or this. */ -public class BloatedSynchronizedBlock extends BytecodeScanningDetector implements StatelessDetector +public class BloatedSynchronizedBlock extends BytecodeScanningDetector { private final BugReporter bugReporter; private static final String BSB_MIN_SAFE_CODE_SIZE = "fb-contrib.bsb.minsize"; - private final OpcodeStack stack = new OpcodeStack(); - private final Set<Integer> unsafeAliases = new HashSet<Integer>(); - private final Map<Integer, Integer> branchInfo = new HashMap<Integer, Integer>(); + private OpcodeStack stack; + private Set<Integer> unsafeAliases; + private Map<Integer, Integer> branchInfo; private int syncPC; private boolean isStatic; private final int minSafeCodeLength; @@ -64,15 +64,15 @@ minSafeCodeLength = Integer.getInteger(BSB_MIN_SAFE_CODE_SIZE, 16).intValue(); } - /** - * clone this detector so that it can be a StatelessDetector - * - * @return a clone of this object - * - * @throws CloneNotSupportedException never - */ - public final Object clone() throws CloneNotSupportedException { - return super.clone(); + @Override + public void visitClassContext(ClassContext classContext) { + stack = new OpcodeStack(); + unsafeAliases = new HashSet<Integer>(); + branchInfo = new HashMap<Integer, Integer>(); + super.visitClassContext(classContext); + stack = null; + unsafeAliases = null; + branchInfo = null; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 03:36:12
|
Revision: 453 Author: dbrosius Date: 2006-04-16 20:36:08 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=453&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java 2006-04-17 03:33:31 UTC (rev 452) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java 2006-04-17 03:36:08 UTC (rev 453) @@ -33,14 +33,14 @@ import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; import edu.umd.cs.findbugs.OpcodeStack; -import edu.umd.cs.findbugs.StatelessDetector; +import edu.umd.cs.findbugs.ba.ClassContext; /** * looks for methods that use an array of length one to pass a variable to achieve call * by pointer ala C++. It is better to define a proper return class type that holds all * the relevant information retrieved from the called method. */ -public class ArrayWrappedCallByReference extends BytecodeScanningDetector implements StatelessDetector { +public class ArrayWrappedCallByReference extends BytecodeScanningDetector { static class WrapperInfo { public int wrappedReg; @@ -53,8 +53,8 @@ } private BugReporter bugReporter; - private OpcodeStack stack = new OpcodeStack(); - private Map<Integer, WrapperInfo> wrappers = new HashMap<Integer, WrapperInfo>(); + private OpcodeStack stack; + private Map<Integer, WrapperInfo> wrappers; /** * constructs a AWCBR detector given the reporter to report bugs on @@ -65,17 +65,21 @@ this.bugReporter = bugReporter; } - /** - * clone this detector so that it can be a StatelessDetector - * - * @return a clone of this object - */ + /** + * implement the visitor to create and clear the stack and wrappers + * + * @param classContext the context object of the currently parsed class + */ @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); + public void visitClassContext(ClassContext classContext) { + stack = new OpcodeStack(); + wrappers = new HashMap<Integer, WrapperInfo>(); + super.visitClassContext(classContext); + stack = null; + wrappers = null; } - /** + /** * looks for methods that contain a NEWARRAY or ANEWARRAY opcodes * * @param method the context object of the current method This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 03:33:38
|
Revision: 452 Author: dbrosius Date: 2006-04-16 20:33:31 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=452&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java 2006-04-17 03:30:58 UTC (rev 451) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java 2006-04-17 03:33:31 UTC (rev 452) @@ -28,7 +28,6 @@ import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; import edu.umd.cs.findbugs.OpcodeStack; -import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.ClassContext; /** @@ -37,12 +36,12 @@ * do not, and cannot define an equals method, reference equality is used for these * collections, which is probably not desired. */ -public class ArrayBasedCollections extends BytecodeScanningDetector implements StatelessDetector +public class ArrayBasedCollections extends BytecodeScanningDetector { private BugReporter bugReporter; - private OpcodeStack stack = new OpcodeStack(); - private List<BugInstance> mapBugs = new ArrayList<BugInstance>(); - private List<BugInstance> setBugs = new ArrayList<BugInstance>(); + private OpcodeStack stack; + private List<BugInstance> mapBugs; + private List<BugInstance> setBugs; private boolean hasMapComparator; private boolean hasSetComparator; @@ -55,16 +54,6 @@ this.bugReporter = bugReporter; } - /** - * clone this detector so that it can be a StatelessDetector - * - * @return a clone of this object - */ - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - /** * implement the visitor to report bugs if no Tree comparators were found * @@ -72,8 +61,9 @@ */ @Override public void visitClassContext(ClassContext classContext) { - mapBugs.clear(); - setBugs.clear(); + stack = new OpcodeStack(); + mapBugs = new ArrayList<BugInstance>(); + setBugs = new ArrayList<BugInstance>(); hasMapComparator = false; hasSetComparator = false; super.visitClassContext(classContext); @@ -88,6 +78,9 @@ bugReporter.reportBug(bi); } } + stack = null; + mapBugs = null; + setBugs = null; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 03:31:14
|
Revision: 451 Author: dbrosius Date: 2006-04-16 20:30:58 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=451&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java 2006-04-17 03:29:28 UTC (rev 450) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java 2006-04-17 03:30:58 UTC (rev 451) @@ -25,14 +25,13 @@ import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.Detector; -import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.ClassContext; import edu.umd.cs.findbugs.visitclass.PreorderVisitor; /** * finds methods that are declared abstract but override concrete methods in a superclass. */ -public class AbstractOverriddenMethod extends PreorderVisitor implements Detector, StatelessDetector { +public class AbstractOverriddenMethod extends PreorderVisitor implements Detector { private BugReporter bugReporter; private ClassContext clsContext; private JavaClass[] superClasses; @@ -46,15 +45,6 @@ } /** - * clone this detector so that it can be a StatelessDetector - * - * @return a clone of this object - */ - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - /** * implements the detector to collect the super classes * * @param classContext the context object for the currently parsed class @@ -69,6 +59,9 @@ cls.accept(this); } catch (ClassNotFoundException cnfe) { bugReporter.reportMissingClass(cnfe); + } finally { + clsContext = null; + superClasses = null; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 03:29:34
|
Revision: 450 Author: dbrosius Date: 2006-04-16 20:29:28 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=450&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractClassEmptyMethods.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractClassEmptyMethods.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractClassEmptyMethods.java 2006-04-17 03:28:15 UTC (rev 449) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractClassEmptyMethods.java 2006-04-17 03:29:28 UTC (rev 450) @@ -27,14 +27,13 @@ import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; -import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.ClassContext; /** * finds methods of abstract classes that do nothing, or just throw exceptions. Since this is an * abstract class, it may be more correct to just leave the method abstract. */ -public class AbstractClassEmptyMethods extends BytecodeScanningDetector implements StatelessDetector +public class AbstractClassEmptyMethods extends BytecodeScanningDetector { public static final int SEEN_NOTHING = 0; public static final int SEEN_NEW = 1; @@ -64,17 +63,6 @@ } /** - * clone this detector so that it can be a StatelessDetector. - * - * @return a clone of this object - * @throws CloneNotSupportedException never - */ - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - /** * overrides the visitor to check for abstract classes. * * @param classContext the context object that holds the JavaClass being parsed This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 03:28:21
|
Revision: 449 Author: dbrosius Date: 2006-04-16 20:28:15 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=449&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java 2006-04-17 00:44:22 UTC (rev 448) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java 2006-04-17 03:28:15 UTC (rev 449) @@ -27,16 +27,15 @@ import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; -import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.ClassContext; /** * find methods that return or throw exception from a finally block. Doing so short-circuits the * return or exception thrown from the try block, and masks it. */ -public class AbnormalFinallyBlockReturn extends BytecodeScanningDetector implements StatelessDetector { +public class AbnormalFinallyBlockReturn extends BytecodeScanningDetector { private BugReporter bugReporter; - private List<FinallyBlockInfo> fbInfo = new ArrayList<FinallyBlockInfo>(); + private List<FinallyBlockInfo> fbInfo; private int loadedReg; /** @@ -47,19 +46,8 @@ public AbnormalFinallyBlockReturn(final BugReporter bugReporter) { this.bugReporter = bugReporter; } - + /** - * clone this detector so that it can be a StatelessDetector. - * - * @return a clone of this object - * @throws CloneNotSupportedException should not happen - */ - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - /** * overrides the visitor to check for java class version being as good or better than 1.4 * * @param classContext the context object that holds the JavaClass parsed @@ -67,8 +55,11 @@ @Override public void visitClassContext(ClassContext classContext) { int majorVersion = classContext.getJavaClass().getMajor(); - if (majorVersion >= MAJOR_1_4) + if (majorVersion >= MAJOR_1_4) { + fbInfo = new ArrayList<FinallyBlockInfo>(); super.visitClassContext(classContext); + fbInfo = null; + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 00:44:30
|
Revision: 448 Author: dbrosius Date: 2006-04-16 17:44:22 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=448&view=rev Log Message: ----------- always write the source line annotation for the bad write, not the good write. Modified Paths: -------------- trunk/fb-contrib/samples/NRTL_Sample.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java Modified: trunk/fb-contrib/samples/NRTL_Sample.java =================================================================== --- trunk/fb-contrib/samples/NRTL_Sample.java 2006-04-15 00:37:03 UTC (rev 447) +++ trunk/fb-contrib/samples/NRTL_Sample.java 2006-04-17 00:44:22 UTC (rev 448) @@ -4,6 +4,7 @@ public class NRTL_Sample extends TagSupport { private String sample; + private String sample2; public void setSample(String s) { sample = s; @@ -12,12 +13,17 @@ public int doStartTag() throws JspException { try { sample += Math.random(); - pageContext.getOut().print(sample); + sample2 += sample; + pageContext.getOut().print(sample2); } catch (Exception ex) { throw new JspTagException("NRTL_Sample: " + ex.getMessage()); } return SKIP_BODY; } + + public void setSample2(String s) { + sample2 = s; + } public int doEndTag() { return EVAL_PAGE; Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java 2006-04-15 00:37:03 UTC (rev 447) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java 2006-04-17 00:44:22 UTC (rev 448) @@ -71,7 +71,7 @@ /** * methodname:methodsig -> (fieldname:fieldtype)s */ - private Map<String, Set<String>> methodWrites; + private Map<String, Map<String, SourceLineAnnotation>> methodWrites; private Map<String, FieldAnnotation> fieldAnnotations; /** @@ -109,7 +109,7 @@ attributes = getAttributes(cls); if (attributes.size() > 0) { - methodWrites = new HashMap<String, Set<String>>(); + methodWrites = new HashMap<String, Map<String, SourceLineAnnotation>>(); fieldAnnotations = new HashMap<String, FieldAnnotation>(); super.visitClassContext(classContext); reportBugs(); @@ -172,18 +172,17 @@ public void sawOpcode(int seen) { if (seen == PUTFIELD) { String methodInfo = getMethodName() + ":" + getMethodSig(); - Set<String> fields = methodWrites.get(methodInfo); + Map<String, SourceLineAnnotation> fields = methodWrites.get(methodInfo); if (fields == null) { - fields = new HashSet<String>(); + fields = new HashMap<String, SourceLineAnnotation>(); methodWrites.put(methodInfo, fields); } String fieldName = getNameConstantOperand(); String fieldSig = getSigConstantOperand(); FieldAnnotation fa = new FieldAnnotation(getClassName(), fieldName, fieldSig, false); - fa.setSourceLines(SourceLineAnnotation.fromVisitedInstruction(this)); fieldAnnotations.put(fieldName, fa); - fields.add(fieldName + ":" + fieldSig); + fields.put(fieldName + ":" + fieldSig, SourceLineAnnotation.fromVisitedInstruction(this)); } } @@ -191,32 +190,35 @@ * generates all the bug reports for attributes that are not recycleable */ private void reportBugs() { - for (Map.Entry<String, String> entry : attributes.entrySet()) { - String methodInfo = entry.getKey(); - String attType = entry.getValue(); + for (Map.Entry<String, String> attEntry : attributes.entrySet()) { + String methodInfo = attEntry.getKey(); + String attType = attEntry.getValue(); - Set<String> fields = methodWrites.get(methodInfo); + Map<String, SourceLineAnnotation> fields = methodWrites.get(methodInfo); if ((fields == null) || (fields.size() != 1)) continue; - String fieldInfo = fields.iterator().next(); + + String fieldInfo = fields.keySet().iterator().next(); String fieldName = fieldInfo.substring(0, fieldInfo.indexOf(":")); String fieldType = fieldInfo.substring(fieldInfo.indexOf(":")+1); if (!attType.equals(fieldType)) continue; - int cnt = 0; - for (Set<String> allFields : methodWrites.values()) { - if (allFields.contains(fieldInfo)) - cnt++; + for (Map.Entry<String, Map<String, SourceLineAnnotation>> fwEntry : methodWrites.entrySet()) { + if (fwEntry.getKey().equals(methodInfo)) + continue; + + SourceLineAnnotation sla = fwEntry.getValue().get(fieldInfo); + if (sla != null) { + bugReporter.reportBug(new BugInstance(this, "NRTL_NON_RECYCLEABLE_TAG_LIB", NORMAL_PRIORITY) + .addClass(this) + .addField(fieldAnnotations.get(fieldName)) + .addSourceLine(sla)); + break; + } } - - if (cnt > 1) { - bugReporter.reportBug(new BugInstance(this, "NRTL_NON_RECYCLEABLE_TAG_LIB", NORMAL_PRIORITY) - .addClass(this) - .addField(fieldAnnotations.get(fieldName))); - } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-15 00:37:13
|
Revision: 447 Author: dbrosius Date: 2006-04-14 17:37:03 -0700 (Fri, 14 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=447&view=rev Log Message: ----------- add copyright Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/VersionTransition.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/VersionTransition.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/VersionTransition.java 2006-04-15 00:36:31 UTC (rev 446) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/VersionTransition.java 2006-04-15 00:37:03 UTC (rev 447) @@ -1,11 +1,24 @@ +/* + * fb-contrib - Auxilliary detectors for Java programs + * Copyright (C) 2005-2006 Dave Brosius + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ package com.mebigfatguy.fbcontrib.utils; -import java.util.BitSet; -import org.apache.bcel.classfile.Method; - -import edu.umd.cs.findbugs.ba.ClassContext; - /** * supports different versions/changes to the FindBugs.jar file, by using reflection, etc * to use different signatures. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-15 00:36:37
|
Revision: 446 Author: dbrosius Date: 2006-04-14 17:36:31 -0700 (Fri, 14 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=446&view=rev Log Message: ----------- add copyright Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java 2006-04-15 00:35:47 UTC (rev 445) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java 2006-04-15 00:36:31 UTC (rev 446) @@ -1,3 +1,21 @@ +/* + * fb-contrib - Auxilliary detectors for Java programs + * Copyright (C) 2005-2006 Dave Brosius + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ package com.mebigfatguy.fbcontrib.detect; import java.util.HashSet; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-15 00:35:53
|
Revision: 445 Author: dbrosius Date: 2006-04-14 17:35:47 -0700 (Fri, 14 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=445&view=rev Log Message: ----------- add copyright Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java 2006-04-15 00:34:50 UTC (rev 444) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java 2006-04-15 00:35:47 UTC (rev 445) @@ -1,3 +1,21 @@ +/* + * fb-contrib - Auxilliary detectors for Java programs + * Copyright (C) 2005-2006 Dave Brosius + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ package com.mebigfatguy.fbcontrib.detect; import java.util.HashMap; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-15 00:34:55
|
Revision: 444 Author: dbrosius Date: 2006-04-14 17:34:50 -0700 (Fri, 14 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=444&view=rev Log Message: ----------- add copyright Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2006-04-15 00:34:07 UTC (rev 443) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FieldCouldBeLocal.java 2006-04-15 00:34:50 UTC (rev 444) @@ -1,7 +1,6 @@ /* - * FindBugs - Find bugs in Java programs - * Copyright (C) 2005 Dave Brosius <dbr...@us...> - * Copyright (C) 2005 University of Maryland + * fb-contrib - Auxilliary detectors for Java programs + * Copyright (C) 2005-2006 Dave Brosius * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-15 00:34:15
|
Revision: 443 Author: dbrosius Date: 2006-04-14 17:34:07 -0700 (Fri, 14 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=443&view=rev Log Message: ----------- add copyright Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java 2006-04-14 23:32:27 UTC (rev 442) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java 2006-04-15 00:34:07 UTC (rev 443) @@ -1,3 +1,21 @@ +/* + * fb-contrib - Auxilliary detectors for Java programs + * Copyright (C) 2005-2006 Dave Brosius + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ package com.mebigfatguy.fbcontrib.detect; import java.util.HashMap; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-14 23:32:35
|
Revision: 442 Author: dbrosius Date: 2006-04-14 16:32:27 -0700 (Fri, 14 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=442&view=rev Log Message: ----------- don't check interfaces Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java 2006-04-12 00:56:54 UTC (rev 441) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbstractOverriddenMethod.java 2006-04-14 23:32:27 UTC (rev 442) @@ -63,6 +63,8 @@ try { clsContext = classContext; JavaClass cls = classContext.getJavaClass(); + if (cls.isInterface()) + return; superClasses = cls.getSuperClasses(); cls.accept(this); } catch (ClassNotFoundException cnfe) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-12 00:57:00
|
Revision: 441 Author: dbrosius Date: 2006-04-11 17:56:54 -0700 (Tue, 11 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=441&view=rev Log Message: ----------- simplify Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java 2006-04-11 14:34:15 UTC (rev 440) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java 2006-04-12 00:56:54 UTC (rev 441) @@ -235,27 +235,25 @@ * @return true if the class is counted */ private boolean countClassAccess(final int classAtStackIndex) { - String calledClass = null; + String calledClass; try { if (stack.getStackDepth() > classAtStackIndex) { OpcodeStack.Item itm = stack.getStackItem(classAtStackIndex); JavaClass cls = itm.getJavaClass(); - if (cls != null) + if (cls != null) { calledClass = cls.getClassName(); - else - return false; - } else - return false; - } catch (ClassNotFoundException cfne) { + countClassAccess(calledClass); + return true; + } + } + } catch (ClassNotFoundException cfne) { bugReporter.reportMissingClass(cfne); - return false; } + + return false; + } - countClassAccess(calledClass); - return true; - } - /** * increment the count of class access of the specified class if it is in a similar * package to the caller, and is not general purpose This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |