[Fb-contrib-commit] SF.net SVN: fb-contrib:[1448] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2010-01-05 09:02:18
|
Revision: 1448
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1448&view=rev
Author: dbrosius
Date: 2010-01-05 09:02:06 +0000 (Tue, 05 Jan 2010)
Log Message:
-----------
using 1.5 now --> use enums
Modified Paths:
--------------
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessInstanceRetrieval.java
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessInstanceRetrieval.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessInstanceRetrieval.java 2010-01-05 08:45:36 UTC (rev 1447)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessInstanceRetrieval.java 2010-01-05 09:02:06 UTC (rev 1448)
@@ -33,13 +33,11 @@
*/
public class NeedlessInstanceRetrieval extends BytecodeScanningDetector
{
- private static final int SEEN_NOTHING = 0;
- private static final int SEEN_INVOKE = 1;
- private static final int SEEN_POP = 2;
+ enum State {SEEN_NOTHING, SEEN_INVOKE, SEEN_POP}
private BugReporter bugReporter;
private LineNumberTable lnTable;
- private int state;
+ private State state;
private int invokePC;
/**
* constructs a NIR detector given the reporter to report bugs on
@@ -59,7 +57,7 @@
try {
lnTable = obj.getLineNumberTable();
if (lnTable != null) {
- state = SEEN_NOTHING;
+ state = State.SEEN_NOTHING;
super.visitCode(obj);
}
} finally {
@@ -87,7 +85,7 @@
if (!"java/lang/Object".equals(clsName)
&& !"java/lang/String".equals(clsName)) {
invokePC = getPC();
- state = SEEN_INVOKE;
+ state = State.SEEN_INVOKE;
}
}
}
@@ -95,9 +93,9 @@
case SEEN_INVOKE:
if (seen == POP)
- state = SEEN_POP;
+ state = State.SEEN_POP;
else
- state = SEEN_NOTHING;
+ state = State.SEEN_NOTHING;
break;
case SEEN_POP:
@@ -109,11 +107,11 @@
.addSourceLine(this));
}
}
- state = SEEN_NOTHING;
+ state = State.SEEN_NOTHING;
break;
default:
- state = SEEN_NOTHING;
+ state = State.SEEN_NOTHING;
break;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|