[Fb-contrib-commit] SF.net SVN: fb-contrib: [495] trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/det
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-04-19 01:07:43
|
Revision: 495 Author: dbrosius Date: 2006-04-18 18:07:38 -0700 (Tue, 18 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=495&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java 2006-04-19 01:06:26 UTC (rev 494) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/StaticMethodInstanceInvocation.java 2006-04-19 01:07:38 UTC (rev 495) @@ -34,6 +34,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 make static method calls using an instance reference. @@ -42,8 +43,8 @@ */ public class StaticMethodInstanceInvocation extends BytecodeScanningDetector { private BugReporter bugReporter; - private OpcodeStack stack = new OpcodeStack(); - private List<PopInfo> popStack = new ArrayList<PopInfo>(); + private OpcodeStack stack; + private List<PopInfo> popStack; /** * constructs a SMII detector given the reporter to report bugs on @@ -52,17 +53,18 @@ public StaticMethodInstanceInvocation(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(); + public void visitClassContext(ClassContext classContext) { + try { + stack = new OpcodeStack(); + popStack = new ArrayList<PopInfo>(); + super.visitClassContext(classContext); + } finally { + stack = null; + popStack = null; + } } - /** * looks for methods that contain a INVOKESTATIC opcodes * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |