Thread: [Fb-contrib-commit] SF.net SVN: fb-contrib: [412] trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/det
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-04-08 14:10:12
|
Revision: 412 Author: dbrosius Date: 2006-04-08 07:10:00 -0700 (Sat, 08 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=412&view=rev Log Message: ----------- javadoc Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java 2006-04-07 16:25:09 UTC (rev 411) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java 2006-04-08 14:10:00 UTC (rev 412) @@ -64,11 +64,21 @@ return super.clone(); } + /** + * implements the visitor to clear the forLoops set + * + * @param obj the context object for the currently parsed method + */ @Override public void visitMethod(Method obj) { forLoops.clear(); } + /** + * implements the visitor to find for loops using floating point indexes + * + * @param seen the opcode of the currently parsed instruction + */ @Override public void sawOpcode(int seen) { if (forLoops.size() > 0) { @@ -87,6 +97,9 @@ forLoops.add(new FloatForLoop(seen - DLOAD_0, getPC())); } + /** + * maintains the state of a previously found for loop + */ public class FloatForLoop { private int state; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 15:49:39
|
Revision: 466 Author: dbrosius Date: 2006-04-17 08:49:33 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=466&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java 2006-04-17 15:47:18 UTC (rev 465) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java 2006-04-17 15:49:33 UTC (rev 466) @@ -22,13 +22,12 @@ import java.util.Iterator; import java.util.Set; -import org.apache.bcel.classfile.Method; +import org.apache.bcel.classfile.Code; import org.apache.bcel.generic.Type; import edu.umd.cs.findbugs.BugInstance; import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; -import edu.umd.cs.findbugs.StatelessDetector; /** * looks for methods that use floating point indexes for loops. Since floating point @@ -36,7 +35,7 @@ * hard to find problems. It is usually better to use integer indexing, and calculating * the correct floating point value from the index. */ -public class FloatingPointLoops extends BytecodeScanningDetector implements StatelessDetector +public class FloatingPointLoops extends BytecodeScanningDetector { private static final int SEEN_LOAD = 1; private static final int SEEN_CMPX = 2; @@ -67,11 +66,13 @@ /** * implements the visitor to clear the forLoops set * - * @param obj the context object for the currently parsed method + * @param obj the context object for the currently parsed code block */ @Override - public void visitMethod(Method obj) { - forLoops.clear(); + public void visitCode(Code obj) { + forLoops = new HashSet<FloatForLoop>(); + super.visitCode(obj); + forLoops = null; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-04-17 15:50:25
|
Revision: 467 Author: dbrosius Date: 2006-04-17 08:50:21 -0700 (Mon, 17 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=467&view=rev Log Message: ----------- Manually cleanup memory now that StatelessDetector is removed. Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java 2006-04-17 15:49:33 UTC (rev 466) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java 2006-04-17 15:50:21 UTC (rev 467) @@ -54,16 +54,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(); - } - - /** * implements the visitor to clear the forLoops set * * @param obj the context object for the currently parsed code block This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |