[Fb-contrib-commit] SF.net SVN: fb-contrib: [977] trunk/fb-contrib
Brought to you by:
dbrosius
From: <dbr...@us...> - 2007-11-23 07:58:58
|
Revision: 977 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=977&view=rev Author: dbrosius Date: 2007-11-22 23:59:00 -0800 (Thu, 22 Nov 2007) Log Message: ----------- remove fps due to compiler generated boolean trinaries Modified Paths: -------------- trunk/fb-contrib/samples/NAB_Sample.java trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java Modified: trunk/fb-contrib/samples/NAB_Sample.java =================================================================== --- trunk/fb-contrib/samples/NAB_Sample.java 2007-11-23 03:50:50 UTC (rev 976) +++ trunk/fb-contrib/samples/NAB_Sample.java 2007-11-23 07:59:00 UTC (rev 977) @@ -123,11 +123,13 @@ d = Double.valueOf(6.0).floatValue(); } - public void testBooleanConsts() + public Boolean testBooleanConsts(String s) { boolean b = Boolean.FALSE; b = Boolean.TRUE; Boolean bb = false; bb = true; + + return Boolean.valueOf(s.equals("true") && bb.booleanValue()); } } Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java 2007-11-23 03:50:50 UTC (rev 976) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessAutoboxing.java 2007-11-23 07:59:00 UTC (rev 977) @@ -40,8 +40,9 @@ private static final int SEEN_PARSE = 3; private static final int SEEN_CTOR = 4; private static final int SEEN_VALUEOFPRIMITIVE = 5; - private static final int SEEN_ICONST = 6; - private static final int SEEN_GETSTATIC = 7; + private static final int SEEN_GOTO = 6; + private static final int SEEN_ICONST = 7; + private static final int SEEN_GETSTATIC = 8; private static final Map<String, String[]> boxClasses = new HashMap<String, String[]>(); static { @@ -88,6 +89,7 @@ switch (state) { case SEEN_NOTHING: + case SEEN_GOTO: if (seen == INVOKEVIRTUAL) { boxClass = getClassConstantOperand(); String[] boxSigs = boxClasses.get(boxClass); @@ -128,7 +130,8 @@ } } } else if ((seen == ICONST_0) || (seen == ICONST_1)) { - state = SEEN_ICONST; + if (state == SEEN_NOTHING) + state = SEEN_ICONST; } else if (seen == GETSTATIC) { String clsName = getClassConstantOperand(); String fldName = getNameConstantOperand(); @@ -136,6 +139,8 @@ if ("TRUE".equals(fldName) || "FALSE".equals(fldName)) state = SEEN_GETSTATIC; } + } else if (seen == GOTO) { + state = SEEN_GOTO; } break; @@ -237,6 +242,7 @@ } } state = SEEN_NOTHING; + sawOpcode(seen); break; case SEEN_GETSTATIC: @@ -251,8 +257,8 @@ } } state = SEEN_NOTHING; + sawOpcode(seen); break; - } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |