[Fb-contrib-commit] SF.net SVN: fb-contrib: [493] trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/det
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-04-19 01:05:07
|
Revision: 493 Author: dbrosius Date: 2006-04-18 18:04:58 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=493&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java 2006-04-19 01:02:44 UTC (rev 492) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java 2006-04-19 01:04:58 UTC (rev 493) @@ -24,6 +24,7 @@ import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; import edu.umd.cs.findbugs.OpcodeStack; +import edu.umd.cs.findbugs.ba.ClassContext; /** * looks for methods that compare strings against literal strings, where the literal string @@ -40,18 +41,22 @@ * @param bugReporter the sync of bug reports */ public LiteralStringComparison(final BugReporter bugReporter) { - this.bugReporter = bugReporter; - stack = new OpcodeStack(); + this.bugReporter = bugReporter; } - + /** - * clone this detector so that it can be a StatelessDetector + * implements the visitor to create and clear the stack * - * @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 { + 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. |