[Fb-contrib-commit] SF.net SVN: fb-contrib: [460] trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/det
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-04-17 15:28:33
|
Revision: 460 Author: dbrosius Date: 2006-04-17 08:28:23 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=460&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java 2006-04-17 03:47:47 UTC (rev 459) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CustomBuiltXML.java 2006-04-17 15:28:23 UTC (rev 460) @@ -37,7 +37,7 @@ * modify, validate and understand. It is cleaner to create external xml files that are * transformed at runtime, using parameters set through Transformer.setParameter. */ -public class CustomBuiltXML extends BytecodeScanningDetector implements StatelessDetector +public class CustomBuiltXML extends BytecodeScanningDetector { private static final Map<Pattern, Boolean> xmlPatterns = new HashMap<Pattern, Boolean>(); static { @@ -54,7 +54,7 @@ } private static final String CBX_MIN_REPORTABLE_ITEMS = "fb-contrib.cbx.minxmlitems"; private BugReporter bugReporter; - private OpcodeStack stack = new OpcodeStack(); + private OpcodeStack stack; private int xmlItemCount = 0; private int xmlConfidentCount = 0; private int lowReportingThreshold; @@ -75,17 +75,19 @@ highReportingThreshold = lowReportingThreshold << 2; } + /** + * overrides the visitor to create and destroy the stack + * + * @param classContext the context object of the currently parsed class + */ + @Override + public void visitClassContext(ClassContext classContext) { + stack = new OpcodeStack(); + super.visitClassContext(classContext); + stack = null; + } + /** - * 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(); - } - - /** * overrides the visitor reset the opcode stack * * @param obj the code object of the currently parsed method This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |