Thread: [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. |
From: <dbr...@us...> - 2006-08-20 00:15:59
|
Revision: 620 Author: dbrosius Date: 2006-08-19 17:15:45 -0700 (Sat, 19 Aug 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=620&view=rev Log Message: ----------- add equalsIgnoreCase to LSC 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-08-18 03:59:33 UTC (rev 619) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java 2006-08-20 00:15:45 UTC (rev 620) @@ -85,7 +85,9 @@ String calledMethodSig = getSigConstantOperand(); if (("equals".equals(calledMethodName) && "(Ljava/lang/Object;)Z".equals(calledMethodSig)) - || ("compareTo".equals(calledMethodName) && "(Ljava/lang/String;)I".equals(calledMethodSig))) { + || ("compareTo".equals(calledMethodName) && "(Ljava/lang/String;)I".equals(calledMethodSig)) + || ("equalsIgnoreCase".equals(calledMethodName) && "(Ljava/lang/Object;)Z".equals(calledMethodSig))) { + if (stack.getStackDepth() > 0) { OpcodeStack.Item itm = stack.getStackItem(0); Object constant = itm.getConstant(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dbr...@us...> - 2006-08-20 00:41:37
|
Revision: 621 Author: dbrosius Date: 2006-08-19 17:41:27 -0700 (Sat, 19 Aug 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=621&view=rev Log Message: ----------- equalsIgnoreCase takes a String not an Object 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-08-20 00:15:45 UTC (rev 620) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LiteralStringComparison.java 2006-08-20 00:41:27 UTC (rev 621) @@ -86,7 +86,7 @@ if (("equals".equals(calledMethodName) && "(Ljava/lang/Object;)Z".equals(calledMethodSig)) || ("compareTo".equals(calledMethodName) && "(Ljava/lang/String;)I".equals(calledMethodSig)) - || ("equalsIgnoreCase".equals(calledMethodName) && "(Ljava/lang/Object;)Z".equals(calledMethodSig))) { + || ("equalsIgnoreCase".equals(calledMethodName) && "(Ljava/lang/String;)Z".equals(calledMethodSig))) { if (stack.getStackDepth() > 0) { OpcodeStack.Item itm = stack.getStackItem(0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |