[Fb-contrib-commit] SF.net SVN: fb-contrib: [454] trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/det
Brought to you by:
dbrosius
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. |