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.
|