[Fb-contrib-commit] SF.net SVN: fb-contrib: [458] trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/det
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-04-17 03:46:52
|
Revision: 458 Author: dbrosius Date: 2006-04-16 20:46:47 -0700 (Sun, 16 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=458&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java 2006-04-17 03:44:46 UTC (rev 457) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CopiedOverriddenMethod.java 2006-04-17 03:46:47 UTC (rev 458) @@ -41,10 +41,10 @@ /** * Looks for methods that are direct copies of the implementation in the super class */ -public class CopiedOverriddenMethod extends DismantleBytecode implements Detector, StatelessDetector +public class CopiedOverriddenMethod extends DismantleBytecode implements Detector { private BugReporter bugReporter; - private Map<String, Code> superclassCode = new HashMap<String, Code>(); + private Map<String, Code> superclassCode; private ClassContext classContext; private String curMethodInfo; private ConstantPoolGen childPoolGen, parentPoolGen; @@ -59,16 +59,6 @@ } /** - * 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 to accept classes derived from non java.lang.Object classes. * * @param classContext the context object of the currently parsed class @@ -79,7 +69,7 @@ String superName = cls.getSuperclassName(); if (!"java.lang.Object".equals(superName)) { this.classContext = classContext; - superclassCode.clear(); + superclassCode = new HashMap<String, Code>(); JavaClass superCls = cls.getSuperClass(); childPoolGen = new ConstantPoolGen(cls.getConstantPool()); parentPoolGen = new ConstantPoolGen(superCls.getConstantPool()); @@ -94,12 +84,14 @@ } } cls.accept(this); - superclassCode.clear(); - childPoolGen = null; - parentPoolGen = null; } } catch (ClassNotFoundException cnfe) { bugReporter.reportMissingClass(cnfe); + } finally { + superclassCode = null; + classContext = null; + childPoolGen = null; + parentPoolGen = null; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |