fb-contrib-commit Mailing List for fb-contrib (Page 55)
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-19 00:57:14
|
Revision: 490 Author: dbrosius Date: 2006-04-18 17:57:10 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=490&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. 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-19 00:56:13 UTC (rev 489) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java 2006-04-19 00:57:10 UTC (rev 490) @@ -33,14 +33,14 @@ 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.ClassContext; /** * looks for tag libraries that are not recycleable because backing members of taglib attributes are * set in areas besides the setter method for the attribute. */ -public class NonRecycleableTaglibs extends BytecodeScanningDetector implements StatelessDetector { +public class NonRecycleableTaglibs extends BytecodeScanningDetector +{ private static final int MAX_ATTRIBUTE_CODE_LENGTH = 60; private static final Set<String> tagClasses = new HashSet<String>(); @@ -84,17 +84,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(); - } - - /** * implements the visitor to look for classes that extend the TagSupport or BodyTagSupport class * * @param classContext the context object for the currently parsed class This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-19 00:56:17
|
Revision: 489 Author: dbrosius Date: 2006-04-18 17:56:13 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=489&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java 2006-04-19 00:53:23 UTC (rev 488) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java 2006-04-19 00:56:13 UTC (rev 489) @@ -32,7 +32,6 @@ import edu.umd.cs.findbugs.BytecodeScanningDetector; import edu.umd.cs.findbugs.FieldAnnotation; import edu.umd.cs.findbugs.OpcodeStack; -import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.ClassContext; /** @@ -41,7 +40,7 @@ * is made that this collection must be multithreaded safe. However, iterator access is used, * which is explicitly unsafe. When iterators are to be used, synchronization should be done manually. */ -public class SyncCollectionIterators extends BytecodeScanningDetector implements StatelessDetector +public class SyncCollectionIterators extends BytecodeScanningDetector { private BugReporter bugReporter; private static Set<String> synchCollectionNames = new HashSet<String>(); @@ -64,10 +63,10 @@ private static final int SEEN_LOAD = 2; private int state; - private Set<String> memberCollections = new HashSet<String>(); - private Set<Integer> localCollections = new HashSet<Integer>(); - private List<Object> monitorObjects = new ArrayList<Object>(); - private OpcodeStack stack = new OpcodeStack(); + private Set<String> memberCollections; + private Set<Integer> localCollections; + private List<Object> monitorObjects; + private OpcodeStack stack; private Object collectionInfo = null; /** @@ -78,20 +77,20 @@ 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(); - } - - @Override public void visitClassContext(final ClassContext classContext) { - memberCollections.clear(); - super.visitClassContext(classContext); + try { + memberCollections = new HashSet<String>(); + localCollections = new HashSet<Integer>(); + monitorObjects = new ArrayList<Object>(); + stack = new OpcodeStack(); + super.visitClassContext(classContext); + } finally { + memberCollections = null; + localCollections = null; + monitorObjects = null; + stack = null; + } } @Override This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-19 00:53:28
|
Revision: 488 Author: dbrosius Date: 2006-04-18 17:53:23 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=488&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SluggishGui.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SluggishGui.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SluggishGui.java 2006-04-19 00:51:10 UTC (rev 487) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SluggishGui.java 2006-04-19 00:53:23 UTC (rev 488) @@ -30,7 +30,6 @@ 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; /** @@ -40,7 +39,8 @@ * use a separate thread to do the time consuming work so that the user * has a better experience. */ -public class SluggishGui extends BytecodeScanningDetector implements StatelessDetector { +public class SluggishGui extends BytecodeScanningDetector +{ private static final Set<String> expensiveCalls = new HashSet<String>(); static { @@ -76,9 +76,9 @@ } private BugReporter bugReporter; - private Set<String> expensiveThisCalls = new HashSet<String>(); - private Set<JavaClass> guiInterfaces = new HashSet<JavaClass>(); - private Map<Code,Method> listenerCode = new LinkedHashMap<Code,Method>(); + private Set<String> expensiveThisCalls; + private Set<JavaClass> guiInterfaces; + private Map<Code,Method> listenerCode; private String methodName; private String methodSig; private boolean isListenerMethod = false; @@ -94,16 +94,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 look for gui interfaces * * @param classContext the context object for the currently parsed class @@ -111,9 +101,7 @@ @Override public void visitClassContext(ClassContext classContext) { try { - guiInterfaces.clear(); - listenerCode.clear(); - expensiveThisCalls.clear(); + guiInterfaces = new HashSet<JavaClass>(); JavaClass cls = classContext.getJavaClass(); JavaClass[] infs = cls.getAllInterfaces(); for (JavaClass inf : infs) { @@ -125,10 +113,17 @@ } } - if (guiInterfaces.size() > 0) + if (guiInterfaces.size() > 0) { + listenerCode = new LinkedHashMap<Code,Method>(); + expensiveThisCalls = new HashSet<String>(); super.visitClassContext(classContext); + } } catch (ClassNotFoundException cnfe) { bugReporter.reportMissingClass(cnfe); + } finally { + guiInterfaces = null; + listenerCode = null; + expensiveThisCalls = null; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-19 00:51:14
|
Revision: 487 Author: dbrosius Date: 2006-04-18 17:51:10 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=487&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java 2006-04-19 00:50:25 UTC (rev 486) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java 2006-04-19 00:51:10 UTC (rev 487) @@ -35,7 +35,6 @@ import edu.umd.cs.findbugs.BytecodeScanningDetector; import edu.umd.cs.findbugs.OpcodeStack; import edu.umd.cs.findbugs.SourceLineAnnotation; -import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.ClassContext; /** @@ -43,7 +42,8 @@ * never stored in fields or returned from methods. As local variables are by definition * thread safe, using synchronized collections in this context makes no sense. */ -public class LocalSynchronizedCollection extends BytecodeScanningDetector implements StatelessDetector { +public class LocalSynchronizedCollection extends BytecodeScanningDetector +{ private static Set<String> syncCtors = new HashSet<String>(); static { syncCtors.add("java/util/Vector"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-19 00:50:30
|
Revision: 486 Author: dbrosius Date: 2006-04-18 17:50:25 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=486&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ParallelLists.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ParallelLists.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ParallelLists.java 2006-04-19 00:48:13 UTC (rev 485) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ParallelLists.java 2006-04-19 00:50:25 UTC (rev 486) @@ -32,7 +32,6 @@ import edu.umd.cs.findbugs.BytecodeScanningDetector; import edu.umd.cs.findbugs.FieldAnnotation; import edu.umd.cs.findbugs.OpcodeStack; -import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.ClassContext; /** @@ -40,12 +39,12 @@ * to hold two or more pieces of related information. It would be better to create a new class that holds * all of these pieces of information, and place instances of this class in one list. */ -public class ParallelLists extends BytecodeScanningDetector implements StatelessDetector +public class ParallelLists extends BytecodeScanningDetector { private BugReporter bugReporter; - private OpcodeStack stack = new OpcodeStack(); - private Set<String> listFields = new HashSet<String>(); - private Map<Integer, String> indexToFieldMap = new HashMap<Integer, String>(); + private OpcodeStack stack; + private Set<String> listFields; + private Map<Integer, String> indexToFieldMap; /** * constructs a PL detector given the reporter to report bugs on @@ -55,35 +54,33 @@ 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(); - } - - @Override public void visitClassContext(final ClassContext classContext) { - JavaClass cls = classContext.getJavaClass(); - - listFields.clear(); - Field[] flds = cls.getFields(); - for (Field f : flds) { - String sig = f.getSignature(); - if (sig.charAt(0) == 'L') { - sig = sig.substring(1, sig.length() - 1); - if (sig.startsWith("java/util/") && sig.endsWith("List")) { + try { + JavaClass cls = classContext.getJavaClass(); + + listFields = new HashSet<String>(); + Field[] flds = cls.getFields(); + for (Field f : flds) { + String sig = f.getSignature(); + if (sig.charAt(0) == 'L') { + sig = sig.substring(1, sig.length() - 1); + if (sig.startsWith("java/util/") && sig.endsWith("List")) { + listFields.add(f.getName()); + } + } else if ((sig.charAt(0) == '[') && (sig.charAt(1) != '[')) listFields.add(f.getName()); - } - } else if ((sig.charAt(0) == '[') && (sig.charAt(1) != '[')) - listFields.add(f.getName()); + } + + if (listFields.size() > 0) { + stack = new OpcodeStack(); + indexToFieldMap = new HashMap<Integer, String>(); + super.visitClassContext(classContext); + } + } finally { + stack = null; + indexToFieldMap = null; } - - if (listFields.size() > 0) - super.visitClassContext(classContext); } @Override This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-19 00:48:18
|
Revision: 485 Author: dbrosius Date: 2006-04-18 17:48:13 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=485&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. 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-19 00:46:38 UTC (rev 484) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousWaitOnConcurrentObject.java 2006-04-19 00:48:13 UTC (rev 485) @@ -29,15 +29,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 calls to the wait method on mutexes defined in the java.util.concurrent package * where it is likely that await was intended. */ -public class SuspiciousWaitOnConcurrentObject extends BytecodeScanningDetector implements StatelessDetector { - +public class SuspiciousWaitOnConcurrentObject extends BytecodeScanningDetector +{ private static final Set<String> concurrentAwaitClasses = new HashSet<String>(); static { concurrentAwaitClasses.add("java.util.concurrent.CountDownLatch"); @@ -45,7 +44,7 @@ } private BugReporter bugReporter; - private OpcodeStack stack = new OpcodeStack(); + private OpcodeStack stack; /** * constructs a SWCO detector given the reporter to report bugs on @@ -54,28 +53,23 @@ public SuspiciousWaitOnConcurrentObject(BugReporter bugReporter) { 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(); - } - - /** * implements the visitor to check for class file version 1.5 or better * * @param classContext the context object of the currently parsed class */ @Override public void visitClassContext(ClassContext classContext) { - JavaClass cls = classContext.getJavaClass(); - int major = cls.getMajor(); - if (major >= Constants.MAJOR_1_5) { - super.visitClassContext(classContext); + try { + JavaClass cls = classContext.getJavaClass(); + int major = cls.getMajor(); + if (major >= Constants.MAJOR_1_5) { + stack = new OpcodeStack(); + super.visitClassContext(classContext); + } + } finally { + stack = null; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-19 00:46:44
|
Revision: 484 Author: dbrosius Date: 2006-04-18 17:46:38 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=484&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java 2006-04-19 00:44:32 UTC (rev 483) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossibleMemoryBloat.java 2006-04-19 00:46:38 UTC (rev 484) @@ -35,7 +35,6 @@ import edu.umd.cs.findbugs.FieldAnnotation; import edu.umd.cs.findbugs.OpcodeStack; import edu.umd.cs.findbugs.SourceLineAnnotation; -import edu.umd.cs.findbugs.StatelessDetector; import edu.umd.cs.findbugs.ba.ClassContext; /** @@ -44,7 +43,8 @@ * Such class fields are likely causes of memory bloat. * */ -public class PossibleMemoryBloat extends BytecodeScanningDetector implements StatelessDetector { +public class PossibleMemoryBloat extends BytecodeScanningDetector +{ private static final Set<String> bloatableSigs = new HashSet<String>(); static { bloatableSigs.add("Ljava/util/ArrayList;"); @@ -93,8 +93,8 @@ increasingMethods.add("put"); } private BugReporter bugReporter; - private Map<FieldAnnotation, SourceLineAnnotation> bloatableFields = new HashMap<FieldAnnotation, SourceLineAnnotation>(); - private OpcodeStack stack = new OpcodeStack(); + private Map<FieldAnnotation, SourceLineAnnotation> bloatableFields; + private OpcodeStack stack; private String methodName; /** @@ -106,16 +106,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(); - } - - /** * collects static fields that are likely bloatable objects and if found * allows the visitor to proceed, at the end report all leftover fields * @@ -123,30 +113,36 @@ */ @Override public void visitClassContext(ClassContext classContext) { - bloatableFields.clear(); - JavaClass cls = classContext.getJavaClass(); - Field[] fields = cls.getFields(); - for (Field f : fields) { - if (f.isStatic()) { - String sig = f.getSignature(); - if (bloatableSigs.contains(sig)) { - bloatableFields.put(FieldAnnotation.fromBCELField(cls.getClassName(), f), null); + try { + bloatableFields = new HashMap<FieldAnnotation, SourceLineAnnotation>(); + JavaClass cls = classContext.getJavaClass(); + Field[] fields = cls.getFields(); + for (Field f : fields) { + if (f.isStatic()) { + String sig = f.getSignature(); + if (bloatableSigs.contains(sig)) { + bloatableFields.put(FieldAnnotation.fromBCELField(cls.getClassName(), f), null); + } } } - } - - if (bloatableFields.size() > 0) { - super.visitClassContext(classContext); - - for (Map.Entry<FieldAnnotation, SourceLineAnnotation> entry : bloatableFields.entrySet()) { - SourceLineAnnotation sla = entry.getValue(); - if (sla != null) { - bugReporter.reportBug(new BugInstance(this, "PMB_POSSIBLE_MEMORY_BLOAT", NORMAL_PRIORITY) - .addClass(this) - .addSourceLine(sla) - .addField(entry.getKey())); + + if (bloatableFields.size() > 0) { + stack = new OpcodeStack(); + super.visitClassContext(classContext); + + for (Map.Entry<FieldAnnotation, SourceLineAnnotation> entry : bloatableFields.entrySet()) { + SourceLineAnnotation sla = entry.getValue(); + if (sla != null) { + bugReporter.reportBug(new BugInstance(this, "PMB_POSSIBLE_MEMORY_BLOAT", NORMAL_PRIORITY) + .addClass(this) + .addSourceLine(sla) + .addField(entry.getKey())); + } } } + } finally { + stack = null; + bloatableFields = null; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-19 00:44:43
|
Revision: 483 Author: dbrosius Date: 2006-04-18 17:44:32 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=483&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpuriousThreadStates.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpuriousThreadStates.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpuriousThreadStates.java 2006-04-19 00:43:01 UTC (rev 482) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SpuriousThreadStates.java 2006-04-19 00:44:32 UTC (rev 483) @@ -25,7 +25,7 @@ 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 call wait, notify or notifyAll on an instance of a @@ -34,10 +34,10 @@ * in question, and will cause spurious thread state changes, either waking threads up * when not intended, or removing the the thread from the runnable state. */ -public class SpuriousThreadStates extends BytecodeScanningDetector implements StatelessDetector +public class SpuriousThreadStates extends BytecodeScanningDetector { private BugReporter bugReporter; - private OpcodeStack stack = new OpcodeStack(); + private OpcodeStack stack; /** * constructs a STS detector given the reporter to report bugs on @@ -47,20 +47,22 @@ this.bugReporter = bugReporter; } - /** - * clone this detector so that it can be a StatelessDetector - * - * @return a clone of this object - */ - public Object clone() throws CloneNotSupportedException { - return super.clone(); + @Override + public void visitClassContext(ClassContext classContext) { + try { + stack = new OpcodeStack(); + super.visitClassContext(classContext); + } finally { + stack = null; + } } - + @Override public void visitMethod(Method obj) { stack.resetForMethodEntry(this); super.visitMethod(obj); } + @Override public void sawOpcode(int seen) { OpcodeStack.Item itm = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-19 00:43:59
|
Revision: 482 Author: dbrosius Date: 2006-04-18 17:43:01 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=482&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SloppyClassReflection.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SloppyClassReflection.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SloppyClassReflection.java 2006-04-19 00:42:04 UTC (rev 481) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SloppyClassReflection.java 2006-04-19 00:43:01 UTC (rev 482) @@ -32,7 +32,6 @@ 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; /** @@ -42,7 +41,8 @@ * as obfuscation. Use of Class.forName should only be used when the class in question * isn't already statically bound to this context. */ -public class SloppyClassReflection extends BytecodeScanningDetector implements StatelessDetector { +public class SloppyClassReflection extends BytecodeScanningDetector +{ private static final int COLLECT = -1; private static final int SEEN_NOTHING = 0; private static final int SEEN_LDC = 1; @@ -60,30 +60,24 @@ public SloppyClassReflection(BugReporter bugReporter) { this.bugReporter = bugReporter; } - + /** - * clone this detector so that it can be a StatelessDetector - * - * @return a clone of this object - */ - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - /** * overrides the visitor to collect all class references * * @param classContext the class context of the currently visited class */ @Override public void visitClassContext(ClassContext classContext) { - refClasses = new HashSet<String>(); - refClasses.add(classContext.getJavaClass().getClassName()); - state = COLLECT; - super.visitClassContext(classContext); - state = SEEN_NOTHING; - super.visitClassContext(classContext); - refClasses = null; + try { + refClasses = new HashSet<String>(); + refClasses.add(classContext.getJavaClass().getClassName()); + state = COLLECT; + super.visitClassContext(classContext); + state = SEEN_NOTHING; + super.visitClassContext(classContext); + } finally { + refClasses = null; + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-19 00:42:16
|
Revision: 481 Author: dbrosius Date: 2006-04-18 17:42:04 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=481&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java 2006-04-19 00:39:41 UTC (rev 480) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java 2006-04-19 00:42:04 UTC (rev 481) @@ -30,12 +30,12 @@ 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 create DOM Nodes but do not add them to any DOM Document. */ -public class OrphanedDOMNode extends BytecodeScanningDetector implements StatelessDetector +public class OrphanedDOMNode extends BytecodeScanningDetector { private static final Set<String> domCreationMethods = new HashSet<String>(); static { @@ -50,9 +50,9 @@ } private BugReporter bugReporter; - private OpcodeStack stack = new OpcodeStack(); - private Map<OpcodeStack.Item, Integer> nodeCreations = new HashMap<OpcodeStack.Item, Integer>(); - private Map<Integer, Integer> nodeStores = new HashMap<Integer, Integer>(); + private OpcodeStack stack; + private Map<OpcodeStack.Item, Integer> nodeCreations; + private Map<Integer, Integer> nodeStores; /** * constructs a ODN detector given the reporter to report bugs on @@ -63,16 +63,24 @@ this.bugReporter = bugReporter; } - /** - * clone this detector so that it can be a StatelessDetector - * - * @return a clone of this object - */ + /** + * implements the visitor to create and clear the stack, node creations and store maps + * + * @param classContext the context object for the currently parsed class + */ @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); + public void visitClassContext(ClassContext classContext) { + try { + stack = new OpcodeStack(); + nodeCreations = new HashMap<OpcodeStack.Item, Integer>(); + nodeStores = new HashMap<Integer, Integer>(); + super.visitClassContext(classContext); + } finally { + stack = null; + nodeCreations = null; + nodeStores = null; + } } - /** * implements the visitor to clear the opcode stack for the next code * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-19 00:39:46
|
Revision: 480 Author: dbrosius Date: 2006-04-18 17:39:41 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=480&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java 2006-04-18 22:29:55 UTC (rev 479) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java 2006-04-19 00:39:41 UTC (rev 480) @@ -28,13 +28,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; /** * Looks for methods that store the return result in a local variable, and * then immediately returns that local variable. */ -public class UnnecessaryStoreBeforeReturn extends BytecodeScanningDetector implements StatelessDetector +public class UnnecessaryStoreBeforeReturn extends BytecodeScanningDetector { private static final int SEEN_NOTHING = 0; private static final int SEEN_STORE = 1; @@ -62,7 +62,7 @@ } private BugReporter bugReporter; - private Set<Integer> branchTargets = new HashSet<Integer>(); + private Set<Integer> branchTargets; private int state; private int storeReg; @@ -75,15 +75,19 @@ } /** - * clone this detector so that it can be a StatelessDetector + * implements the visitor to create and clear the branchTargets * - * @return a clone of this object + * @param classContext the context object for the currently parsed class */ @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); + public void visitClassContext(ClassContext classContext) { + try { + branchTargets = new HashSet<Integer>(); + super.visitClassContext(classContext); + } finally { + branchTargets = null; + } } - /** * implements the visitor to make sure method returns a value, and then clears the targets * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-18 22:29:59
|
Revision: 479 Author: dbrosius Date: 2006-04-18 15:29:55 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=479&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java 2006-04-18 22:26:38 UTC (rev 478) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java 2006-04-18 22:29:55 UTC (rev 479) @@ -36,6 +36,7 @@ import edu.umd.cs.findbugs.OpcodeStack; import edu.umd.cs.findbugs.SourceLineAnnotation; import edu.umd.cs.findbugs.StatelessDetector; +import edu.umd.cs.findbugs.ba.ClassContext; /** * looks for allocations of synchronized collections that are stored in local variables, and @@ -59,8 +60,8 @@ } private BugReporter bugReporter; - private OpcodeStack stack = new OpcodeStack(); - private Map<Integer, CollectionRegInfo> syncRegs = new HashMap<Integer, CollectionRegInfo>(); + private OpcodeStack stack; + private Map<Integer, CollectionRegInfo> syncRegs; /** * constructs a LSYC detector given the reporter to report bugs on * @param bugReporter the sync of bug reports @@ -70,15 +71,21 @@ } /** - * clone this detector so that it can be a StatelessDetector + * implements the visitor to create and clear the stack and syncRegs * - * @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) { + try { + stack = new OpcodeStack(); + syncRegs = new HashMap<Integer, CollectionRegInfo>(); + super.visitClassContext(classContext); + } finally { + stack = null; + syncRegs = null; + } + } /** * implements the visitor to collect parameter registers * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-18 22:26:44
|
Revision: 478 Author: dbrosius Date: 2006-04-18 15:26:38 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=478&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java 2006-04-18 22:24:26 UTC (rev 477) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java 2006-04-18 22:26:38 UTC (rev 478) @@ -15,7 +15,7 @@ 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 synchronize on variables that are not owned by the @@ -24,13 +24,14 @@ * synchronize on private fields of the class. Note that 'this' is not owned by * the current class and synchronization on 'this' should be avoided as well. */ -public class NonOwnedSynchronization extends BytecodeScanningDetector implements StatelessDetector { +public class NonOwnedSynchronization extends BytecodeScanningDetector +{ private static final Integer OWNED = new Integer(Integer.MAX_VALUE); private static final Integer LOW = new Integer(LOW_PRIORITY); private static final Integer NORMAL = new Integer(NORMAL_PRIORITY); private BugReporter bugReporter; - private OpcodeStack stack = new OpcodeStack(); - private Map<Integer, Integer> regPriorities = new HashMap<Integer, Integer>(); + private OpcodeStack stack; + private Map<Integer, Integer> regPriorities; /** * constructs a NOS detector given the reporter to report bugs on @@ -38,18 +39,23 @@ */ public NonOwnedSynchronization(BugReporter bugReporter) { this.bugReporter = bugReporter; } + + /** + * implements the visitor to set and clear the stack and priorities + */ + @Override + public void visitClassContext(ClassContext classContext) { + try { + stack = new OpcodeStack(); + regPriorities = new HashMap<Integer, Integer>(); + super.visitClassContext(classContext); + } finally { + stack = null; + regPriorities = 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(); - } - - /** * looks for methods that contain a MONITORENTER opcode * * @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-18 22:24:30
|
Revision: 477 Author: dbrosius Date: 2006-04-18 15:24:26 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=477&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessInstanceRetrieval.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessInstanceRetrieval.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessInstanceRetrieval.java 2006-04-18 22:23:10 UTC (rev 476) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessInstanceRetrieval.java 2006-04-18 22:24:26 UTC (rev 477) @@ -25,14 +25,14 @@ 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 methods that call a method to retrieve a reference to an object, * to use to load a constant. It is simpler and more performant to access the * static variable directly from the class itself. */ -public class NeedlessInstanceRetrieval extends BytecodeScanningDetector implements StatelessDetector { +public class NeedlessInstanceRetrieval extends BytecodeScanningDetector +{ private static final int SEEN_NOTHING = 0; private static final int SEEN_INVOKE = 1; private static final int SEEN_POP = 2; @@ -49,16 +49,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(); - } - /** * overrides the interface to collect the line number table, and reset state * @@ -66,10 +56,14 @@ */ @Override public void visitCode(Code obj) { - lnTable = obj.getLineNumberTable(); - if (lnTable != null) { - state = SEEN_NOTHING; - super.visitCode(obj); + try { + lnTable = obj.getLineNumberTable(); + if (lnTable != null) { + state = SEEN_NOTHING; + super.visitCode(obj); + } + } finally { + lnTable = null; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-18 22:23:14
|
Revision: 476 Author: dbrosius Date: 2006-04-18 15:23:10 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=476&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ManualArrayCopy.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ManualArrayCopy.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ManualArrayCopy.java 2006-04-18 03:13:27 UTC (rev 475) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ManualArrayCopy.java 2006-04-18 22:23:10 UTC (rev 476) @@ -23,13 +23,12 @@ 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 methods that copy data from one array to another using a loop. It is * better performing to use System.arraycopy to do such copying as this is a native method. */ -public class ManualArrayCopy extends BytecodeScanningDetector implements StatelessDetector +public class ManualArrayCopy extends BytecodeScanningDetector { public static final int SEEN_NOTHING = 0; public static final int SEEN_ARRAY1_LOAD = 1; @@ -56,11 +55,6 @@ * @return a clone of this object */ @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - @Override public void visitCode(Code obj) { state = SEEN_NOTHING; super.visitCode(obj); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-18 03:13:37
|
Revision: 475 Author: dbrosius Date: 2006-04-17 20:13:27 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=475&view=rev Log Message: ----------- clear stuff in the finally block Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java 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/DeclaredRuntimeException.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java 2006-04-18 03:04:50 UTC (rev 474) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/AbnormalFinallyBlockReturn.java 2006-04-18 03:13:27 UTC (rev 475) @@ -54,12 +54,15 @@ */ @Override public void visitClassContext(ClassContext classContext) { - int majorVersion = classContext.getJavaClass().getMajor(); - if (majorVersion >= MAJOR_1_4) { - fbInfo = new ArrayList<FinallyBlockInfo>(); - super.visitClassContext(classContext); - fbInfo = null; - } + try { + int majorVersion = classContext.getJavaClass().getMajor(); + if (majorVersion >= MAJOR_1_4) { + fbInfo = new ArrayList<FinallyBlockInfo>(); + super.visitClassContext(classContext); + } + } finally { + fbInfo = null; + } } /** Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java 2006-04-18 03:04:50 UTC (rev 474) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayBasedCollections.java 2006-04-18 03:13:27 UTC (rev 475) @@ -61,26 +61,29 @@ */ @Override public void visitClassContext(ClassContext classContext) { - stack = new OpcodeStack(); - mapBugs = new ArrayList<BugInstance>(); - setBugs = new ArrayList<BugInstance>(); - hasMapComparator = false; - hasSetComparator = false; - super.visitClassContext(classContext); - if (!hasMapComparator) { - for (BugInstance bi : mapBugs) { - bugReporter.reportBug(bi); + try { + stack = new OpcodeStack(); + mapBugs = new ArrayList<BugInstance>(); + setBugs = new ArrayList<BugInstance>(); + hasMapComparator = false; + hasSetComparator = false; + super.visitClassContext(classContext); + if (!hasMapComparator) { + for (BugInstance bi : mapBugs) { + bugReporter.reportBug(bi); + } } - } - - if (!hasSetComparator) { - for (BugInstance bi : setBugs) { - bugReporter.reportBug(bi); + + if (!hasSetComparator) { + for (BugInstance bi : setBugs) { + bugReporter.reportBug(bi); + } } + } finally { + stack = null; + mapBugs = null; + setBugs = null; } - stack = null; - mapBugs = null; - setBugs = null; } /** Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java 2006-04-18 03:04:50 UTC (rev 474) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ArrayWrappedCallByReference.java 2006-04-18 03:13:27 UTC (rev 475) @@ -72,11 +72,14 @@ */ @Override public void visitClassContext(ClassContext classContext) { - stack = new OpcodeStack(); - wrappers = new HashMap<Integer, WrapperInfo>(); - super.visitClassContext(classContext); - stack = null; - wrappers = null; + try { + stack = new OpcodeStack(); + wrappers = new HashMap<Integer, WrapperInfo>(); + super.visitClassContext(classContext); + } finally { + stack = null; + wrappers = null; + } } /** Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java 2006-04-18 03:04:50 UTC (rev 474) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/BloatedSynchronizedBlock.java 2006-04-18 03:13:27 UTC (rev 475) @@ -66,13 +66,16 @@ @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; + try { + stack = new OpcodeStack(); + unsafeAliases = new HashSet<Integer>(); + branchInfo = new HashMap<Integer, Integer>(); + super.visitClassContext(classContext); + } finally { + stack = null; + unsafeAliases = null; + branchInfo = null; + } } /** Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java 2006-04-18 03:04:50 UTC (rev 474) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ClassEnvy.java 2006-04-18 03:13:27 UTC (rev 475) @@ -89,13 +89,16 @@ */ @Override public void visitClassContext(final ClassContext classContext) { - JavaClass cls = classContext.getJavaClass(); - packageName = cls.getPackageName(); - clsName = cls.getClassName(); - stack = new OpcodeStack(); - super.visitClassContext(classContext); - stack = null; - clsAccessCount = null; + try { + JavaClass cls = classContext.getJavaClass(); + packageName = cls.getPackageName(); + clsName = cls.getClassName(); + stack = new OpcodeStack(); + super.visitClassContext(classContext); + } finally { + stack = null; + clsAccessCount = null; + } } /** Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java 2006-04-18 03:04:50 UTC (rev 474) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java 2006-04-18 03:13:27 UTC (rev 475) @@ -65,9 +65,12 @@ */ @Override public void visitClassContext(ClassContext classContext) { - iConst0Looped = new HashSet<Integer>(); - super.visitClassContext(classContext); - iConst0Looped = null; + try { + iConst0Looped = new HashSet<Integer>(); + super.visitClassContext(classContext); + } finally { + iConst0Looped = null; + } } /** Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java 2006-04-18 03:04:50 UTC (rev 474) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java 2006-04-18 03:13:27 UTC (rev 475) @@ -83,9 +83,12 @@ */ @Override public void visitClassContext(ClassContext classContext) { - stack = new OpcodeStack(); - super.visitClassContext(classContext); - stack = null; + try { + stack = new OpcodeStack(); + super.visitClassContext(classContext); + } finally { + stack = null; + } } /** Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java 2006-04-18 03:04:50 UTC (rev 474) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java 2006-04-18 03:13:27 UTC (rev 475) @@ -65,9 +65,12 @@ * @param context the context object for the currently parsed class */ public void visitClassContext(final ClassContext context) { - classContext = context; - classContext.getJavaClass().accept(this); - classContext = null; + try { + classContext = context; + classContext.getJavaClass().accept(this); + } finally { + classContext = null; + } } /** Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java 2006-04-18 03:04:50 UTC (rev 474) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeclaredRuntimeException.java 2006-04-18 03:13:27 UTC (rev 475) @@ -63,16 +63,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 and accepts if the Exception class was loaded * * @param classContext the context object for the currently parsed class Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java 2006-04-18 03:04:50 UTC (rev 474) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java 2006-04-18 03:13:27 UTC (rev 475) @@ -74,11 +74,14 @@ */ @Override public void visitClassContext(ClassContext classContext) { - stack = new OpcodeStack(); - possibleForLoops = new HashSet<ForLoop>(); - super.visitClassContext(classContext); - stack = null; - possibleForLoops = null; + try { + stack = new OpcodeStack(); + possibleForLoops = new HashSet<ForLoop>(); + super.visitClassContext(classContext); + } finally { + stack = null; + possibleForLoops = null; + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-18 03:04:56
|
Revision: 474 Author: dbrosius Date: 2006-04-17 20:04:50 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=474&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonCollectionMethodUse.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonCollectionMethodUse.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonCollectionMethodUse.java 2006-04-18 03:03:53 UTC (rev 473) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonCollectionMethodUse.java 2006-04-18 03:04:50 UTC (rev 474) @@ -24,13 +24,12 @@ 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 method calls to collection classes where the method is not defined by the Collections * interface, and an equivalent method exists in the interface. */ -public class NonCollectionMethodUse extends BytecodeScanningDetector implements StatelessDetector +public class NonCollectionMethodUse extends BytecodeScanningDetector { private static Set<String> oldMethods = new HashSet<String>(); static { @@ -55,17 +54,7 @@ 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(); - } - - @Override public void sawOpcode(int seen) { if (seen == INVOKEVIRTUAL) { String className = getClassConstantOperand(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-18 03:04:04
|
Revision: 473 Author: dbrosius Date: 2006-04-17 20:03:53 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=473&view=rev Log Message: ----------- oi Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java 2006-04-18 03:03:13 UTC (rev 472) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java 2006-04-18 03:03:53 UTC (rev 473) @@ -26,7 +26,6 @@ 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 methods that pass a primitive wrapper class object, to the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-18 03:03:20
|
Revision: 472 Author: dbrosius Date: 2006-04-17 20:03:13 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=472&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java 2006-04-18 03:01:31 UTC (rev 471) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java 2006-04-18 03:03:13 UTC (rev 472) @@ -32,7 +32,7 @@ * Looks for methods that pass a primitive wrapper class object, to the * same classes Constructor. */ -public class NeedlessAutoboxing extends BytecodeScanningDetector implements StatelessDetector +public class NeedlessAutoboxing extends BytecodeScanningDetector { private static final int SEEN_NOTHING = 0; private static final int SEEN_VALUE = 1; @@ -60,16 +60,6 @@ public NeedlessAutoboxing(BugReporter bugReporter) { 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(); - } @Override public void visitMethod(Method obj) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-18 03:01:46
|
Revision: 471 Author: dbrosius Date: 2006-04-17 20:01:31 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=471&view=rev Log Message: ----------- there's a false positive here somewhere, can't find a sample Modified Paths: -------------- trunk/fb-contrib/samples/FCBL_Sample.java Modified: trunk/fb-contrib/samples/FCBL_Sample.java =================================================================== --- trunk/fb-contrib/samples/FCBL_Sample.java 2006-04-18 02:54:55 UTC (rev 470) +++ trunk/fb-contrib/samples/FCBL_Sample.java 2006-04-18 03:01:31 UTC (rev 471) @@ -6,6 +6,7 @@ protected int boo; int hoo; private int fp; + private String test; public FCBL_Sample() { @@ -28,4 +29,22 @@ { boo = fp; } + + public void test3(String in) + { + boolean found = false; + if (in.equals("boo")) + test = "boo"; + else if (in.equals("hoo")) + test = "hoo"; + else if (in.equals("moo")) + { + if (test.equals("loo") && !found) + { + found = true; + } + } + + test = "woowoo"; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-18 02:55:01
|
Revision: 470 Author: dbrosius Date: 2006-04-17 19:54:55 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=470&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java 2006-04-18 02:43:21 UTC (rev 469) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java 2006-04-18 02:54:55 UTC (rev 470) @@ -32,14 +32,14 @@ import edu.umd.cs.findbugs.BytecodeScanningDetector; import edu.umd.cs.findbugs.FieldAnnotation; import edu.umd.cs.findbugs.OpcodeStack; -import edu.umd.cs.findbugs.StatelessDetector; +import edu.umd.cs.findbugs.ba.ClassContext; /** * looks for for loops that iterate over a java.util.List using an integer index, and get, * 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. */ -public class ListIndexedIterating extends BytecodeScanningDetector implements StatelessDetector +public class ListIndexedIterating extends BytecodeScanningDetector { private static final int SEEN_NOTHING = 0; private static final int SEEN_IINC = 1; @@ -65,20 +65,22 @@ */ public ListIndexedIterating(final BugReporter bugReporter) { this.bugReporter = bugReporter; - stack = new OpcodeStack(); - possibleForLoops = new HashSet<ForLoop>(); } - + /** - * clone this detector so that it can be a StatelessDetector + * overrides the interface to create and clear the stack and loops tracker * - * @return a clone of this object + * @param classContext the context object for the currently parsed class */ @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); + public void visitClassContext(ClassContext classContext) { + stack = new OpcodeStack(); + possibleForLoops = new HashSet<ForLoop>(); + super.visitClassContext(classContext); + stack = null; + possibleForLoops = null; } - + /** * looks for methods that contain a GOTO or GOTO_W opcodes * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-18 02:43:31
|
Revision: 469 Author: dbrosius Date: 2006-04-17 19:43:21 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=469&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/JDBCVendorReliance.java Modified: trunk/fb-contrib/.classpath =================================================================== --- trunk/fb-contrib/.classpath 2006-04-17 15:52:11 UTC (rev 468) +++ trunk/fb-contrib/.classpath 2006-04-18 02:43:21 UTC (rev 469) @@ -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="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="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="output" path="classes"/> </classpath> Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java 2006-04-17 15:52:11 UTC (rev 468) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java 2006-04-18 02:43:21 UTC (rev 469) @@ -31,16 +31,16 @@ 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 uses of jdbc vendor specific classes and methods making the database access code * non portable. */ -public class JDBCVendorReliance extends BytecodeScanningDetector implements StatelessDetector { - +public class JDBCVendorReliance extends BytecodeScanningDetector +{ private BugReporter bugReporter; - private OpcodeStack stack = new OpcodeStack(); + private OpcodeStack stack; private Map<Integer, Integer> jdbcLocals = new HashMap<Integer, Integer>(); /** @@ -51,17 +51,14 @@ this.bugReporter = bugReporter; } + public void visitClassContext(ClassContext classContext) { + stack = new OpcodeStack(); + jdbcLocals = new HashMap<Integer, Integer>(); + super.visitClassContext(classContext); + stack = null; + jdbcLocals = 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(); - } - - /** * implement the visitor to reset the opcode stack and set of locals that are jdbc objects * * @param obj the context param 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:52:18
|
Revision: 468 Author: dbrosius Date: 2006-04-17 08:52:11 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=468&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java 2006-04-17 15:50:21 UTC (rev 467) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InefficientStringBuffering.java 2006-04-17 15:52:11 UTC (rev 468) @@ -24,13 +24,12 @@ 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.OpcodeStack.Item; /** * looks for appending strings inside of calls to StringBuffer or StringBuilder append. */ -public class InefficientStringBuffering extends BytecodeScanningDetector implements StatelessDetector +public class InefficientStringBuffering extends BytecodeScanningDetector { private BugReporter bugReporter; private OpcodeStack opStack; @@ -41,24 +40,19 @@ */ public InefficientStringBuffering(final BugReporter bugReporter) { this.bugReporter = bugReporter; - opStack = new OpcodeStack(); } - /** - * clone this detector so that it can be a StatelessDetector - * - * @return a clone of this object - */ + /** + * implements the visitor to create and clear the stack + * + * @param obj the context object of the currently parsed code block + */ @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - @Override - public void visit(final Code c) { - if (c.getCode() != null) { - opStack.resetForMethodEntry(this); - super.visit(c); + public void visitCode(final Code obj) { + if (obj.getCode() != null) { + opStack = new OpcodeStack(); + super.visit(obj); + opStack = 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:50:25
|
Revision: 467 Author: dbrosius Date: 2006-04-17 08:50:21 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=467&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java 2006-04-17 15:49:33 UTC (rev 466) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java 2006-04-17 15:50:21 UTC (rev 467) @@ -54,16 +54,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(); - } - - /** * implements the visitor to clear the forLoops set * * @param obj the context object for the currently parsed code block 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:49:39
|
Revision: 466 Author: dbrosius Date: 2006-04-17 08:49:33 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=466&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java 2006-04-17 15:47:18 UTC (rev 465) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java 2006-04-17 15:49:33 UTC (rev 466) @@ -22,13 +22,12 @@ import java.util.Iterator; import java.util.Set; -import org.apache.bcel.classfile.Method; +import org.apache.bcel.classfile.Code; import org.apache.bcel.generic.Type; 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 methods that use floating point indexes for loops. Since floating point @@ -36,7 +35,7 @@ * hard to find problems. It is usually better to use integer indexing, and calculating * the correct floating point value from the index. */ -public class FloatingPointLoops extends BytecodeScanningDetector implements StatelessDetector +public class FloatingPointLoops extends BytecodeScanningDetector { private static final int SEEN_LOAD = 1; private static final int SEEN_CMPX = 2; @@ -67,11 +66,13 @@ /** * implements the visitor to clear the forLoops set * - * @param obj the context object for the currently parsed method + * @param obj the context object for the currently parsed code block */ @Override - public void visitMethod(Method obj) { - forLoops.clear(); + public void visitCode(Code obj) { + forLoops = new HashSet<FloatForLoop>(); + super.visitCode(obj); + forLoops = null; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |