Update of /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32370/src/com/mebigfatguy/fbcontrib/detect
Modified Files:
ListIndexedIterating.java
Log Message:
if the for loop variable is assigned from another variable, don't report, either
Index: ListIndexedIterating.java
===================================================================
RCS file: /cvsroot/fb-contrib/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ListIndexedIterating.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ListIndexedIterating.java 12 Oct 2005 04:26:21 -0000 1.4
+++ ListIndexedIterating.java 12 Oct 2005 05:17:03 -0000 1.5
@@ -178,7 +178,8 @@
} else {
if (stack.getStackDepth() > 0) {
OpcodeStack.Item itm = stack.getStackItem(0);
- if (((Integer) itm.getConstant()).intValue() != 0)
+ Integer initValue = (Integer)itm.getConstant();
+ if ((initValue == null) || (initValue.intValue() != 0))
it.remove();
}
fl.setLoopRegLoaded(false);
|