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