[Fb-contrib-commit] SF.net SVN: fb-contrib:[1405] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2009-12-20 00:52:26
|
Revision: 1405
http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1405&view=rev
Author: dbrosius
Date: 2009-12-20 00:52:13 +0000 (Sun, 20 Dec 2009)
Log Message:
-----------
no longer need Integer14 with compiling with java 1.5
Modified Paths:
--------------
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingFunctionSemantics.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ExceptionSoftening.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InappropriateToStringUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MisleadingOverloadModel.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonSymmetricEquals.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ParallelLists.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PoorlyDefinedParameter.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SQLInLoop.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousCloneAlgorithm.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousClusteredSessionSupport.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryNewNullCheck.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryStoreBeforeReturn.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedCollectionContents.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnrelatedReturnValues.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseAddAll.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseCharacterParameterizedMethod.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseEnumCollections.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseSplit.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseToArray.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/WrongNullGuard.java
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/SignatureUtils.java
Removed Paths:
-------------
trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/utils/Integer14.java
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingFunctionSemantics.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingFunctionSemantics.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConfusingFunctionSemantics.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -29,7 +29,6 @@
import org.apache.bcel.classfile.Method;
import org.apache.bcel.generic.Type;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import edu.umd.cs.findbugs.BugInstance;
@@ -115,7 +114,7 @@
JavaClass parmClass = Repository.lookupClass(parmSignature.substring(1, parmSignature.length() - 1));
if ((parmRegs != null) && parmClass.instanceOf(returnClass)) {
- possibleParmRegs.put(Integer14.valueOf(parmRegs[p]), new ParmUsage());
+ possibleParmRegs.put(Integer.valueOf(parmRegs[p]), new ParmUsage());
}
}
}
@@ -149,7 +148,7 @@
if (stack.getStackDepth() > 0) {
OpcodeStack.Item item = stack.getStackItem(0);
int reg = item.getRegisterNumber();
- ParmUsage pu = possibleParmRegs.get(Integer14.valueOf(reg));
+ ParmUsage pu = possibleParmRegs.get(Integer.valueOf(reg));
if (pu != null)
pu.setReturnPC(getPC());
}
@@ -157,13 +156,13 @@
if (stack.getStackDepth() > 1) {
OpcodeStack.Item item = stack.getStackItem(1);
int reg = item.getRegisterNumber();
- ParmUsage pu = possibleParmRegs.get(Integer14.valueOf(reg));
+ ParmUsage pu = possibleParmRegs.get(Integer.valueOf(reg));
if (pu != null)
pu.setAlteredPC(getPC());
}
} else if ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3))) {
int reg = RegisterUtils.getAStoreReg(this, seen);
- possibleParmRegs.remove(Integer14.valueOf(reg));
+ possibleParmRegs.remove(Integer.valueOf(reg));
} else if ((seen == INVOKEVIRTUAL) || (seen == INVOKEINTERFACE)) {
String calledSig = getSigConstantOperand();
String calledRet = Type.getReturnType(calledSig).getSignature();
@@ -172,7 +171,7 @@
if (stack.getStackDepth() > calledObjOffset) {
OpcodeStack.Item item = stack.getStackItem(calledObjOffset);
int reg = item.getRegisterNumber();
- ParmUsage pu = possibleParmRegs.get(Integer14.valueOf(reg));
+ ParmUsage pu = possibleParmRegs.get(Integer.valueOf(reg));
if (pu != null)
pu.setAlteredPC(getPC());
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ConstantListIndex.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -26,8 +26,6 @@
import org.apache.bcel.classfile.ConstantInteger;
import org.apache.bcel.classfile.Method;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
-
import edu.umd.cs.findbugs.BugInstance;
import edu.umd.cs.findbugs.BugReporter;
import edu.umd.cs.findbugs.BytecodeScanningDetector;
@@ -133,7 +131,7 @@
//case CALOAD: usually harmless so ignore
case SALOAD:
if (state == SEEN_CONSTANT_0)
- iConst0Looped.add(Integer14.valueOf(getPC()));
+ iConst0Looped.add(Integer.valueOf(getPC()));
else {
if (stack.getStackDepth() > 1) {
OpcodeStack.Item item = stack.getStackItem(1);
@@ -153,7 +151,7 @@
String methodName = getNameConstantOperand();
if ("get".equals(methodName)) {
if (state == SEEN_CONSTANT_0)
- iConst0Looped.add(Integer14.valueOf(getPC()));
+ iConst0Looped.add(Integer.valueOf(getPC()));
else {
bugReporter.reportBug(new BugInstance(this, "CLI_CONSTANT_LIST_INDEX", NORMAL_PRIORITY)
.addClass(this)
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -25,8 +25,6 @@
import org.apache.bcel.classfile.Code;
import org.apache.bcel.classfile.Method;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
-
import edu.umd.cs.findbugs.BugInstance;
import edu.umd.cs.findbugs.BugReporter;
import edu.umd.cs.findbugs.Detector;
@@ -114,7 +112,7 @@
&& (edgeType != EdgeTypes.UNKNOWN_EDGE)) {
if ((edgeType == EdgeTypes.UNHANDLED_EXCEPTION_EDGE)
|| (edgeType == EdgeTypes.HANDLED_EXCEPTION_EDGE)) {
- Integer nodeTarget = Integer14.valueOf(e.getTarget().getLabel());
+ Integer nodeTarget = Integer.valueOf(e.getTarget().getLabel());
if (!exceptionNodeTargets.contains(nodeTarget)) {
exceptionNodeTargets.add(nodeTarget);
branches++;
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/DeletingWhileIterating.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -34,7 +34,6 @@
import org.apache.bcel.classfile.LocalVariableTable;
import com.mebigfatguy.fbcontrib.utils.CodeByteUtils;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import edu.umd.cs.findbugs.BugInstance;
@@ -81,14 +80,14 @@
}
private static final Map<String, Integer> modifyingMethods = new HashMap<String, Integer>();
static {
- modifyingMethods.put("add(Ljava/lang/Object;)Z", Integer14.valueOf(1));
- modifyingMethods.put("addAll(Ljava/util/Collection;)Z", Integer14.valueOf(1));
- modifyingMethods.put("addAll(ILjava/util/Collection;)Z", Integer14.valueOf(2));
- modifyingMethods.put("clear()V", Integer14.valueOf(0));
- modifyingMethods.put("remove(I)Ljava/lang/Object;", Integer14.valueOf(1));
- modifyingMethods.put("removeAll(Ljava/util/Collection;)Z", Integer14.valueOf(1));
- modifyingMethods.put("retainAll(Ljava/util/Collection;)Z", Integer14.valueOf(1));
- modifyingMethods.put("set(ILjava/lang/Object;)Ljava/lang/Object;", Integer14.valueOf(2));
+ modifyingMethods.put("add(Ljava/lang/Object;)Z", Integer.valueOf(1));
+ modifyingMethods.put("addAll(Ljava/util/Collection;)Z", Integer.valueOf(1));
+ modifyingMethods.put("addAll(ILjava/util/Collection;)Z", Integer.valueOf(2));
+ modifyingMethods.put("clear()V", Integer.valueOf(0));
+ modifyingMethods.put("remove(I)Ljava/lang/Object;", Integer.valueOf(1));
+ modifyingMethods.put("removeAll(Ljava/util/Collection;)Z", Integer.valueOf(1));
+ modifyingMethods.put("retainAll(Ljava/util/Collection;)Z", Integer.valueOf(1));
+ modifyingMethods.put("set(ILjava/lang/Object;)Ljava/lang/Object;", Integer.valueOf(2));
}
@@ -182,7 +181,7 @@
OpcodeStack.Item itm = stack.getStackItem(1);
int id = findCollectionGroup(itm, true);
if (id >= 0) {
- Integer it = groupToIterator.get(Integer14.valueOf(id));
+ Integer it = groupToIterator.get(Integer.valueOf(id));
Loop loop = loops.get(it);
if (loop != null) {
int pc = getPC();
@@ -217,7 +216,7 @@
OpcodeStack.Item itm = stack.getStackItem(numArgs.intValue());
int id = findCollectionGroup(itm, true);
if (id >= 0) {
- Integer it = groupToIterator.get(Integer14.valueOf(id));
+ Integer it = groupToIterator.get(Integer.valueOf(id));
if (it != null) {
Loop loop = loops.get(it);
if (loop != null) {
@@ -263,7 +262,7 @@
try {
JavaClass cls = itm.getJavaClass();
if ((cls != null) && cls.implementationOf(iteratorClass)) {
- Integer regIt = Integer14.valueOf(reg);
+ Integer regIt = Integer.valueOf(reg);
Iterator<Integer> curIt = groupToIterator.values().iterator();
while (curIt.hasNext()) {
if (curIt.next().equals(regIt))
@@ -274,7 +273,7 @@
Set<Comparable<?>> group = collectionGroups.get(id.intValue());
if (group != null) {
- group.add(Integer14.valueOf(reg));
+ group.add(Integer.valueOf(reg));
}
} catch (ClassNotFoundException cnfe) {
bugReporter.reportMissingClass(cnfe);
@@ -307,10 +306,10 @@
stack.sawOpcode(this, seen);
if ((groupId >= 0) && (stack.getStackDepth() > 0)) {
OpcodeStack.Item itm = stack.getStackItem(0);
- itm.setUserValue(Integer14.valueOf(groupId));
+ itm.setUserValue(Integer.valueOf(groupId));
}
- processEndOfScopes(Integer14.valueOf(getPC()));
+ processEndOfScopes(Integer.valueOf(getPC()));
}
}
@@ -329,7 +328,7 @@
int reg = itm.getRegisterNumber();
if (reg >= 0)
- groupElement = Integer14.valueOf(reg);
+ groupElement = Integer.valueOf(reg);
else {
XField field = itm.getXField();
if (field != null) {
@@ -391,13 +390,13 @@
@SuppressWarnings("deprecation")
LocalVariable lv = lvt.getLocalVariable(i);
if (lv != null) {
- Integer endPC = Integer14.valueOf(lv.getStartPC() + lv.getLength());
+ Integer endPC = Integer.valueOf(lv.getStartPC() + lv.getLength());
Set<Integer> vars = endOfScopes.get(endPC);
if (vars == null) {
vars = new HashSet<Integer>();
endOfScopes.put(endPC, vars);
}
- vars.add(Integer14.valueOf(lv.getIndex()));
+ vars.add(Integer.valueOf(lv.getIndex()));
}
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ExceptionSoftening.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ExceptionSoftening.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ExceptionSoftening.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -41,7 +41,6 @@
import org.apache.bcel.classfile.LocalVariableTable;
import org.apache.bcel.classfile.Method;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import com.mebigfatguy.fbcontrib.utils.SignatureUtils;
@@ -134,7 +133,7 @@
try {
stack.mergeJumps(this);
int pc = getPC();
- CodeException ex = catchHandlerPCs.get(Integer14.valueOf(pc));
+ CodeException ex = catchHandlerPCs.get(Integer.valueOf(pc));
if (ex != null) {
int endPC;
if ((seen == GOTO) || (seen == GOTO_W))
@@ -243,7 +242,7 @@
LinkedHashMap<Integer, CodeException> handlers = new LinkedHashMap<Integer, CodeException>();
for (CodeException ex : filteredEx) {
- handlers.put(Integer14.valueOf(ex.getEndPC()), ex);
+ handlers.put(Integer.valueOf(ex.getEndPC()), ex);
}
return handlers;
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/FinalParameters.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -33,7 +33,6 @@
import org.apache.bcel.classfile.Method;
import org.apache.bcel.generic.Type;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import edu.umd.cs.findbugs.BugInstance;
@@ -189,7 +188,7 @@
BugInstance bi = null;
for (int i = 0; i < parmCount; i++) {
- if (changedParms.remove(Integer14.valueOf(i)))
+ if (changedParms.remove(Integer.valueOf(i)))
continue;
int reg;
@@ -221,7 +220,7 @@
if ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3))) {
int parm = getAStoreParameter(seen);
if (parm >= 0)
- changedParms.add(Integer14.valueOf(parm));
+ changedParms.add(Integer.valueOf(parm));
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InappropriateToStringUse.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InappropriateToStringUse.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/InappropriateToStringUse.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -27,7 +27,6 @@
import org.apache.bcel.classfile.JavaClass;
import org.apache.bcel.generic.Type;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import com.mebigfatguy.fbcontrib.utils.SignatureUtils;
@@ -165,7 +164,7 @@
|| ((seen >= ASTORE_0) && (seen <= ASTORE_3))) {
if (stack.getStackDepth() > 0) {
OpcodeStack.Item item = stack.getStackItem(0);
- Integer reg = Integer14.valueOf(RegisterUtils.getAStoreReg(this, seen));
+ Integer reg = Integer.valueOf(RegisterUtils.getAStoreReg(this, seen));
if (item.getUserValue() != null) {
XMethod xm = item.getReturnValueOf();
if (xm != null) {
@@ -179,7 +178,7 @@
}
} else if ((seen == ALOAD)
|| ((seen >= ALOAD_0) && (seen <= ALOAD_3))) {
- Integer reg = Integer14.valueOf(RegisterUtils.getAStoreReg(this, seen));
+ Integer reg = Integer.valueOf(RegisterUtils.getAStoreReg(this, seen));
methodPackage = toStringRegisters.get(reg);
}
} catch (ClassNotFoundException cnfe) {
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/JDBCVendorReliance.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -25,7 +25,6 @@
import org.apache.bcel.classfile.Method;
import org.apache.bcel.generic.Type;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import edu.umd.cs.findbugs.BugInstance;
@@ -81,8 +80,8 @@
for (int t = 0; t < argTypes.length; t++) {
String sig = argTypes[t].getSignature();
if (isJDBCClass(sig)) {
- jdbcLocals.put(Integer14.valueOf(parmRegs[t]),
- Integer14.valueOf(RegisterUtils.getLocalVariableEndRange(obj.getLocalVariableTable(), parmRegs[t], 0)));
+ jdbcLocals.put(Integer.valueOf(parmRegs[t]),
+ Integer.valueOf(RegisterUtils.getLocalVariableEndRange(obj.getLocalVariableTable(), parmRegs[t], 0)));
}
}
}
@@ -134,13 +133,13 @@
OpcodeStack.Item itm = stack.getStackItem(0);
if (itm.getUserValue() != null) {
int reg = RegisterUtils.getAStoreReg(this, seen);
- jdbcLocals.put(Integer14.valueOf(reg), Integer14.valueOf(RegisterUtils.getLocalVariableEndRange(getMethod().getLocalVariableTable(), reg, getNextPC())));
+ jdbcLocals.put(Integer.valueOf(reg), Integer.valueOf(RegisterUtils.getLocalVariableEndRange(getMethod().getLocalVariableTable(), reg, getNextPC())));
}
}
} else if ((seen == ALOAD) || ((seen >= ALOAD_0) && (seen <= ALOAD_3))) {
int reg = RegisterUtils.getALoadReg(this, seen);
- if (jdbcLocals.containsKey(Integer14.valueOf(reg)))
+ if (jdbcLocals.containsKey(Integer.valueOf(reg)))
tosIsJDBC = true;
}
} finally {
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LocalSynchronizedCollection.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -29,7 +29,6 @@
import org.apache.bcel.classfile.Method;
import org.apache.bcel.generic.Type;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import edu.umd.cs.findbugs.BugInstance;
@@ -48,9 +47,9 @@
{
private static Map<String, Integer> syncCtors = new HashMap<String, Integer>();
static {
- syncCtors.put("java/util/Vector", Integer14.valueOf(Constants.MAJOR_1_1));
- syncCtors.put("java/util/Hashtable", Integer14.valueOf(Constants.MAJOR_1_1));
- syncCtors.put("java/lang/StringBuffer", Integer14.valueOf(Constants.MAJOR_1_5));
+ syncCtors.put("java/util/Vector", Integer.valueOf(Constants.MAJOR_1_1));
+ syncCtors.put("java/util/Hashtable", Integer.valueOf(Constants.MAJOR_1_1));
+ syncCtors.put("java/lang/StringBuffer", Integer.valueOf(Constants.MAJOR_1_5));
}
private static Set<String> syncMethods = new HashSet<String>();
static {
@@ -102,7 +101,7 @@
syncRegs.clear();
int[] parmRegs = RegisterUtils.getParameterRegisters(obj);
for (int pr : parmRegs) {
- syncRegs.put(Integer14.valueOf(pr),
+ syncRegs.put(Integer.valueOf(pr),
new CollectionRegInfo(RegisterUtils.getLocalVariableEndRange(obj.getLocalVariableTable(), pr, 0)));
}
}
@@ -144,13 +143,13 @@
if ("<init>".equals(getNameConstantOperand())) {
Integer minVersion = syncCtors.get(getClassConstantOperand());
if ((minVersion != null) && (classVersion >= minVersion.intValue())) {
- tosIsSyncColReg = Integer14.valueOf(-1);
+ tosIsSyncColReg = Integer.valueOf(-1);
}
}
} else if (seen == INVOKESTATIC) {
if ("java/util/Collections".equals(getClassConstantOperand())) {
if (syncMethods.contains(getNameConstantOperand())) {
- tosIsSyncColReg = Integer14.valueOf(-1);
+ tosIsSyncColReg = Integer.valueOf(-1);
}
}
} else if ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3))) {
@@ -158,25 +157,25 @@
OpcodeStack.Item item = stack.getStackItem(0);
int reg = RegisterUtils.getAStoreReg(this, seen);
if (item.getUserValue() != null) {
- if (!syncRegs.containsKey(Integer14.valueOf(reg))) {
+ if (!syncRegs.containsKey(Integer.valueOf(reg))) {
CollectionRegInfo cri = new CollectionRegInfo(SourceLineAnnotation.fromVisitedInstruction(this), RegisterUtils.getLocalVariableEndRange(getMethod().getLocalVariableTable(), reg, getNextPC()));
- syncRegs.put(Integer14.valueOf(reg), cri);
+ syncRegs.put(Integer.valueOf(reg), cri);
}
} else {
- CollectionRegInfo cri = syncRegs.get(Integer14.valueOf(reg));
+ CollectionRegInfo cri = syncRegs.get(Integer.valueOf(reg));
if (cri == null) {
cri = new CollectionRegInfo(RegisterUtils.getLocalVariableEndRange(getMethod().getLocalVariableTable(), reg, getNextPC()));
- syncRegs.put(Integer14.valueOf(reg), cri);
+ syncRegs.put(Integer.valueOf(reg), cri);
}
cri.setIgnore();
}
}
} else if ((seen == ALOAD) || ((seen >= ALOAD_0) && (seen <= ALOAD_3))) {
int reg = RegisterUtils.getALoadReg(this, seen);
- CollectionRegInfo cri = syncRegs.get(Integer14.valueOf(reg));
+ CollectionRegInfo cri = syncRegs.get(Integer.valueOf(reg));
if ((cri != null) && !cri.getIgnore())
- tosIsSyncColReg = Integer14.valueOf(reg);
+ tosIsSyncColReg = Integer.valueOf(reg);
} else if ((seen == PUTFIELD) || (seen == ARETURN)) {
if (stack.getStackDepth() > 0) {
OpcodeStack.Item item = stack.getStackItem(0);
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -37,7 +37,6 @@
import org.apache.bcel.classfile.Method;
import org.apache.bcel.generic.Type;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import edu.umd.cs.findbugs.BugInstance;
@@ -225,7 +224,7 @@
int reg = itm.getRegisterNumber();
if (reg >= 0)
{
- exReg.put(Integer14.valueOf(reg), Boolean.TRUE);
+ exReg.put(Integer.valueOf(reg), Boolean.TRUE);
}
markAsValid = true; // Fixes javac generated code
}
@@ -266,13 +265,13 @@
if (stack.getStackDepth() > 0) {
OpcodeStack.Item itm = stack.getStackItem(0);
int reg = RegisterUtils.getAStoreReg(this, seen);
- exReg.put(Integer14.valueOf(reg), (Boolean)itm.getUserValue());
+ exReg.put(Integer.valueOf(reg), (Boolean)itm.getUserValue());
if ((reg == catchInfo.getRegister() && catchInfo.getFinish() == Integer.MAX_VALUE)) {
it.remove();
}
}
} else if ((seen == ALOAD) || ((seen >= ALOAD_0) && (seen <= ALOAD_3))) {
- Boolean valid = exReg.get(Integer14.valueOf(RegisterUtils.getALoadReg(this, seen)));
+ Boolean valid = exReg.get(Integer.valueOf(RegisterUtils.getALoadReg(this, seen)));
if (valid != null)
{
markAsValid = valid.booleanValue();
@@ -380,7 +379,7 @@
if ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3))) {
int reg = RegisterUtils.getAStoreReg(this, seen);
ci.setReg(reg);
- exReg.put(Integer14.valueOf(reg), Boolean.TRUE);
+ exReg.put(Integer.valueOf(reg), Boolean.TRUE);
LocalVariableTable lvt = getMethod().getLocalVariableTable();
if (lvt != null) {
LocalVariable lv = lvt.getLocalVariable(reg, pc+2);
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MisleadingOverloadModel.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MisleadingOverloadModel.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/MisleadingOverloadModel.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -24,8 +24,6 @@
import org.apache.bcel.classfile.JavaClass;
import org.apache.bcel.classfile.Method;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
-
import edu.umd.cs.findbugs.BugInstance;
import edu.umd.cs.findbugs.BugReporter;
import edu.umd.cs.findbugs.Detector;
@@ -39,9 +37,9 @@
*/
public class MisleadingOverloadModel extends PreorderVisitor implements Detector
{
- private static final Integer INSTANCE = Integer14.valueOf(0);
- private static final Integer STATIC = Integer14.valueOf(1);
- private static final Integer BOTH = Integer14.valueOf(2);
+ private static final Integer INSTANCE = Integer.valueOf(0);
+ private static final Integer STATIC = Integer.valueOf(1);
+ private static final Integer BOTH = Integer.valueOf(2);
private final BugReporter bugReporter;
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NeedlessMemberCollectionSynchronization.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -29,8 +29,6 @@
import org.apache.bcel.classfile.JavaClass;
import org.apache.bcel.generic.Type;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
-
import edu.umd.cs.findbugs.BugInstance;
import edu.umd.cs.findbugs.BugReporter;
import edu.umd.cs.findbugs.BytecodeScanningDetector;
@@ -281,7 +279,7 @@
} else {
int reg = item.getRegisterNumber();
if (reg >= 0) {
- Integer register = Integer14.valueOf(reg);
+ Integer register = Integer.valueOf(reg);
String fName = aliases.get(register);
if (fName != null) {
collectionFields.remove(fName);
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonOwnedSynchronization.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -27,7 +27,6 @@
import org.apache.bcel.classfile.Method;
import org.apache.bcel.generic.Type;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import edu.umd.cs.findbugs.BugInstance;
@@ -45,9 +44,9 @@
*/
public class NonOwnedSynchronization extends BytecodeScanningDetector
{
- private static final Integer OWNED = Integer14.valueOf(Integer.MAX_VALUE);
- private static final Integer LOW = Integer14.valueOf(LOW_PRIORITY);
- private static final Integer NORMAL = Integer14.valueOf(NORMAL_PRIORITY);
+ private static final Integer OWNED = Integer.valueOf(Integer.MAX_VALUE);
+ private static final Integer LOW = Integer.valueOf(LOW_PRIORITY);
+ private static final Integer NORMAL = Integer.valueOf(NORMAL_PRIORITY);
private BugReporter bugReporter;
private OpcodeStack stack;
private Map<Integer, Integer> regPriorities;
@@ -98,9 +97,9 @@
regPriorities.clear();
int[] parmRegs = RegisterUtils.getParameterRegisters(method);
for (int reg : parmRegs)
- regPriorities.put(Integer14.valueOf(reg), NORMAL);
+ regPriorities.put(Integer.valueOf(reg), NORMAL);
if (!method.isStatic())
- regPriorities.put(Integer14.valueOf(0), LOW);
+ regPriorities.put(Integer.valueOf(0), LOW);
super.visitCode(obj);
}
}
@@ -130,7 +129,7 @@
if (getMethod().isStatic() && (reg == 0))
tosIsPriority = LOW;
else {
- tosIsPriority = regPriorities.get(Integer14.valueOf(reg));
+ tosIsPriority = regPriorities.get(Integer.valueOf(reg));
if (tosIsPriority == null)
tosIsPriority = NORMAL;
}
@@ -145,7 +144,7 @@
if (stack.getStackDepth() > 0) {
OpcodeStack.Item item = stack.getStackItem(0);
Integer priority = (Integer)item.getUserValue();
- regPriorities.put(Integer14.valueOf(RegisterUtils.getAStoreReg(this, seen)), priority);
+ regPriorities.put(Integer.valueOf(RegisterUtils.getAStoreReg(this, seen)), priority);
}
}
break;
@@ -164,7 +163,7 @@
} else {
int reg = itm.getRegisterNumber();
if (reg > 0)
- tosIsPriority = regPriorities.get(Integer14.valueOf(reg));
+ tosIsPriority = regPriorities.get(Integer.valueOf(reg));
else
tosIsPriority = OWNED;
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonSymmetricEquals.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonSymmetricEquals.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/NonSymmetricEquals.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -23,10 +23,10 @@
import java.util.Map;
import org.apache.bcel.Constants;
+import org.apache.bcel.Repository;
import org.apache.bcel.classfile.Code;
import org.apache.bcel.classfile.JavaClass;
import org.apache.bcel.classfile.Method;
-import org.apache.bcel.Repository;
import edu.umd.cs.findbugs.BugInstance;
import edu.umd.cs.findbugs.BugReporter;
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OrphanedDOMNode.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -26,7 +26,6 @@
import org.apache.bcel.classfile.Code;
import org.apache.bcel.generic.Type;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import edu.umd.cs.findbugs.BugInstance;
@@ -137,22 +136,22 @@
if ("org/w3c/dom/Document".equals(className)) {
if (domCreationMethods.contains(methodInfo)) {
sawCreate = true;
- itemPC = Integer14.valueOf(getPC());
+ itemPC = Integer.valueOf(getPC());
}
}
} else if ((seen == ASTORE) || ((seen >= ASTORE_0) && seen <= ASTORE_3)) {
Integer pc = findDOMNodeCreationPoint(0);
int reg = RegisterUtils.getAStoreReg(this, seen);
if (pc != null)
- nodeStores.put(Integer14.valueOf(reg), pc);
+ nodeStores.put(Integer.valueOf(reg), pc);
else
- nodeStores.remove(Integer14.valueOf(reg));
+ nodeStores.remove(Integer.valueOf(reg));
} else if (seen == PUTFIELD) {
//Stores to member variables are assumed ok
findDOMNodeCreationPoint(0);
} else if ((seen == ALOAD) || ((seen >= ALOAD_0) && (seen <= ALOAD_3))) {
int reg = RegisterUtils.getALoadReg(this, seen);
- itemPC = nodeStores.get(Integer14.valueOf(reg));
+ itemPC = nodeStores.get(Integer.valueOf(reg));
if (itemPC != null)
sawCreate = true;
} else if (seen == ARETURN) {
@@ -160,7 +159,7 @@
OpcodeStack.Item itm = stack.getStackItem(0);
int reg = itm.getRegisterNumber();
nodeCreations.remove(itm);
- nodeStores.remove(Integer14.valueOf(reg));
+ nodeStores.remove(Integer.valueOf(reg));
}
}
@@ -177,7 +176,7 @@
if (nodeCreations.containsKey(itm)) {
int reg = itm.getRegisterNumber();
nodeCreations.remove(itm);
- nodeStores.remove(Integer14.valueOf(reg));
+ nodeStores.remove(Integer.valueOf(reg));
}
}
if ((seen != INVOKESTATIC) && (stack.getStackDepth() > argCount)) {
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/OverlyConcreteParameter.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -37,7 +37,6 @@
import org.apache.bcel.classfile.Method;
import org.apache.bcel.generic.Type;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import edu.umd.cs.findbugs.BugInstance;
@@ -203,7 +202,7 @@
if (!methodIsStatic)
parm--;
if ((parm >= 0) && (parm < parmCount))
- parameterDefiners.remove(Integer14.valueOf(reg));
+ parameterDefiners.remove(Integer.valueOf(reg));
} else {
parameterDefiners.clear();
}
@@ -216,7 +215,7 @@
if (!methodIsStatic)
parm--;
if ((parm >= 0) && (parm < parmCount))
- parameterDefiners.remove(Integer14.valueOf(reg));
+ parameterDefiners.remove(Integer.valueOf(reg));
} else {
parameterDefiners.clear();
}
@@ -229,7 +228,7 @@
if (!methodIsStatic)
parm--;
if ((parm >= 0) && (parm < parmCount))
- usedParameters.add(Integer14.valueOf(reg));
+ usedParameters.add(Integer.valueOf(reg));
} else if (seen == AASTORE) {
//Don't check parameters that are stored in
if (stack.getStackDepth() >= 3) {
@@ -239,7 +238,7 @@
if (!methodIsStatic)
parm--;
if ((parm >= 0) && (parm < parmCount))
- parameterDefiners.remove(Integer14.valueOf(reg));
+ parameterDefiners.remove(Integer.valueOf(reg));
} else {
parameterDefiners.clear();
}
@@ -319,7 +318,7 @@
Map<JavaClass, List<MethodInfo>> definers = getClassDefiners(cls);
if (definers.size() > 0) {
- parameterDefiners.put( Integer14.valueOf(i + (methodIsStatic ? 0 : 1)), definers );
+ parameterDefiners.put( Integer.valueOf(i + (methodIsStatic ? 0 : 1)), definers );
hasPossiblyOverlyConcreteParm = true;
}
}
@@ -371,7 +370,7 @@
private void removeUselessDefiners(final int reg) {
- Map<JavaClass, List<MethodInfo>> definers = parameterDefiners.get(Integer14.valueOf(reg));
+ Map<JavaClass, List<MethodInfo>> definers = parameterDefiners.get(Integer.valueOf(reg));
if ((definers != null) && (definers.size() > 0)) {
String methodSig = getSigConstantOperand();
String methodName = getNameConstantOperand();
@@ -401,7 +400,7 @@
it.remove();
}
if (definers.isEmpty()) {
- parameterDefiners.remove(Integer14.valueOf(reg));
+ parameterDefiners.remove(Integer.valueOf(reg));
}
}
}
@@ -452,11 +451,11 @@
if (parmSig.startsWith("L")) {
parmSig = parmSig.substring( 1, parmSig.length() - 1).replace('/', '.');
if ("java.lang.Object".equals(parmSig)) {
- parameterDefiners.remove(Integer14.valueOf(reg));
+ parameterDefiners.remove(Integer.valueOf(reg));
return;
}
- Map<JavaClass, List<MethodInfo>> definers = parameterDefiners.get(Integer14.valueOf(reg));
+ Map<JavaClass, List<MethodInfo>> definers = parameterDefiners.get(Integer.valueOf(reg));
if ((definers != null) && (definers.size() > 0)) {
Iterator<JavaClass> it = definers.keySet().iterator();
while (it.hasNext()) {
@@ -466,7 +465,7 @@
}
if (definers.isEmpty())
- parameterDefiners.remove(Integer14.valueOf(reg));
+ parameterDefiners.remove(Integer.valueOf(reg));
}
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ParallelLists.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ParallelLists.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/ParallelLists.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -27,8 +27,6 @@
import org.apache.bcel.classfile.Field;
import org.apache.bcel.classfile.JavaClass;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
-
import edu.umd.cs.findbugs.BugInstance;
import edu.umd.cs.findbugs.BugReporter;
import edu.umd.cs.findbugs.BytecodeScanningDetector;
@@ -111,7 +109,7 @@
indexToFieldMap.clear();
} else if ((seen == ISTORE) || (seen == IINC) || ((seen >= ISTORE_0) && (seen <= ISTORE_3))) {
int reg = getIntOpRegister(seen);
- indexToFieldMap.remove(Integer14.valueOf(reg));
+ indexToFieldMap.remove(Integer.valueOf(reg));
} else if ((seen >= IALOAD) && (seen <= SALOAD)) {
checkParms();
}
@@ -136,7 +134,7 @@
if ((indexReg >= 0) && (field != null)) {
if (listFields.contains(field.getName())) {
- String f = indexToFieldMap.get(Integer14.valueOf(indexReg));
+ String f = indexToFieldMap.get(Integer.valueOf(indexReg));
if ((f != null) && (!f.equals(field.getName()))) {
bugReporter.reportBug( new BugInstance( this, "PL_PARALLEL_LISTS", NORMAL_PRIORITY)
.addClass(this)
@@ -146,7 +144,7 @@
indexToFieldMap.clear();
}
else
- indexToFieldMap.put(Integer14.valueOf(indexReg), field.getName());
+ indexToFieldMap.put(Integer.valueOf(indexReg), field.getName());
}
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PoorlyDefinedParameter.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PoorlyDefinedParameter.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PoorlyDefinedParameter.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -28,7 +28,6 @@
import org.apache.bcel.classfile.LocalVariableTable;
import org.apache.bcel.classfile.Method;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import com.mebigfatguy.fbcontrib.utils.SignatureUtils;
@@ -115,7 +114,7 @@
case SAW_NOTHING:
if ((seen == ALOAD) || ((seen >= ALOAD_0) && (seen <= ALOAD_3))) {
loadedReg = RegisterUtils.getALoadReg(this, seen);
- parmSig = parmSigs.get(Integer14.valueOf(loadedReg));
+ parmSig = parmSigs.get(Integer.valueOf(loadedReg));
if (parmSig != null) {
parmSig = parmSig.substring(1, parmSig.length() - 1);
state = SAW_LOAD;
@@ -132,7 +131,7 @@
}
} else if (seen == INSTANCEOF) {
// probably an if guard... assume the code is reasonable
- parmSigs.remove(Integer14.valueOf(loadedReg));
+ parmSigs.remove(Integer.valueOf(loadedReg));
}
state = SAW_NOTHING;
break;
@@ -156,7 +155,7 @@
.addMethod(this)
.addSourceLine(this)
.addString(parmName);
- Integer lr = Integer14.valueOf(loadedReg);
+ Integer lr = Integer.valueOf(loadedReg);
BugInfo bi = bugs.get(lr);
if (bi == null) {
bugs.put(lr, new BugInfo(castClass, bug));
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/PossiblyRedundantMethodCalls.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -30,7 +30,6 @@
import org.apache.bcel.generic.Type;
import com.mebigfatguy.fbcontrib.collect.Statistics;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import edu.umd.cs.findbugs.BugInstance;
@@ -156,7 +155,7 @@
branchTargets.clear();
CodeException[] codeExceptions = obj.getExceptionTable();
for (CodeException codeEx : codeExceptions) {
- branchTargets.add(Integer14.valueOf(codeEx.getHandlerPC()));
+ branchTargets.add(Integer.valueOf(codeEx.getHandlerPC()));
}
super.visitCode(obj);
}
@@ -171,21 +170,21 @@
public void sawOpcode(int seen) {
try {
stack.mergeJumps(this);
- if (branchTargets.remove(Integer14.valueOf(getPC()))) {
+ if (branchTargets.remove(Integer.valueOf(getPC()))) {
localMethodCalls.clear();
fieldMethodCalls.clear();
}
if (((seen >= IFEQ) && (seen <= GOTO)) || ((seen >= IFNULL) && (seen <= GOTO_W))) {
- branchTargets.add(Integer14.valueOf(getBranchTarget()));
+ branchTargets.add(Integer.valueOf(getBranchTarget()));
} else if ((seen == TABLESWITCH) || (seen == LOOKUPSWITCH)) {
int[] offsets = getSwitchOffsets();
int pc = getPC();
for (int offset : offsets) {
- branchTargets.add(Integer14.valueOf(offset + pc));
+ branchTargets.add(Integer.valueOf(offset + pc));
}
} else if ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3))) {
- localMethodCalls.remove(Integer14.valueOf(RegisterUtils.getAStoreReg(this, seen)));
+ localMethodCalls.remove(Integer.valueOf(RegisterUtils.getAStoreReg(this, seen)));
} else if (seen == PUTFIELD) {
fieldMethodCalls.remove(getNameConstantOperand());
} else if ((seen == INVOKEVIRTUAL) || (seen == INVOKEINTERFACE)) {
@@ -207,7 +206,7 @@
MethodCall mc;
if (reg >= 0) {
- mc = localMethodCalls.get(Integer14.valueOf(reg));
+ mc = localMethodCalls.get(Integer.valueOf(reg));
} else if (field != null) {
mc = fieldMethodCalls.get(field.getName());
} else
@@ -235,13 +234,13 @@
}
}
if (reg >= 0) {
- localMethodCalls.remove(Integer14.valueOf(reg));
+ localMethodCalls.remove(Integer.valueOf(reg));
} else {
fieldMethodCalls.remove(field.getName());
}
} else {
if (reg >= 0) {
- localMethodCalls.put(Integer14.valueOf(reg), new MethodCall(methodName, signature, parmConstants));
+ localMethodCalls.put(Integer.valueOf(reg), new MethodCall(methodName, signature, parmConstants));
} else if (field != null) {
fieldMethodCalls.put(field.getName(), new MethodCall(methodName, signature, parmConstants));
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SQLInLoop.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SQLInLoop.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SQLInLoop.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -25,8 +25,6 @@
import org.apache.bcel.classfile.Code;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
-
import edu.umd.cs.findbugs.BugInstance;
import edu.umd.cs.findbugs.BugReporter;
import edu.umd.cs.findbugs.BytecodeScanningDetector;
@@ -115,7 +113,7 @@
String methodName = getNameConstantOperand();
if (queryClasses.contains(clsName) && queryMethods.contains(methodName))
- queryLocations.add(Integer14.valueOf(getPC()));
+ queryLocations.add(Integer.valueOf(getPC()));
} else if ((seen == GOTO) || (seen == GOTO_W)) {
int branchTarget = getBranchTarget();
int pc = getPC();
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/Section508Compliance.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -29,7 +29,6 @@
import org.apache.bcel.classfile.JavaClass;
import org.apache.bcel.generic.Type;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import edu.umd.cs.findbugs.BugInstance;
@@ -177,7 +176,7 @@
if ("Ljavax/swing/JLabel;".equals(item.getSignature())
&& (item.getUserValue() != null)) {
int reg = RegisterUtils.getAStoreReg(this, seen);
- localLabels.put(Integer14.valueOf(reg), SourceLineAnnotation.fromVisitedInstruction(this));
+ localLabels.put(Integer.valueOf(reg), SourceLineAnnotation.fromVisitedInstruction(this));
}
}
} else if (seen == PUTFIELD) {
@@ -224,7 +223,7 @@
} else {
int reg = item.getRegisterNumber();
if (reg >= 0) {
- localLabels.remove(Integer14.valueOf(reg));
+ localLabels.remove(Integer.valueOf(reg));
}
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SillynessPotPourri.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -38,7 +38,6 @@
import org.apache.bcel.classfile.LocalVariableTable;
import com.mebigfatguy.fbcontrib.utils.CodeByteUtils;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import edu.umd.cs.findbugs.BugInstance;
@@ -145,14 +144,14 @@
stack.mergeJumps(this);
if (((seen >= IFEQ) && (seen <= GOTO)) || (seen == IFNULL) || (seen == IFNONNULL) || (seen == GOTO_W)) {
- Integer branchTarget = Integer14.valueOf(getBranchTarget());
+ Integer branchTarget = Integer.valueOf(getBranchTarget());
Set<Integer> branchInsSet = branchTargets.get(branchTarget);
if (branchInsSet == null)
{
branchInsSet = new HashSet<Integer>();
branchTargets.put(branchTarget, branchInsSet);
}
- branchInsSet.add(Integer14.valueOf(getPC()));
+ branchInsSet.add(Integer.valueOf(getPC()));
}
if ((seen == IFEQ) || (seen == IFLE) || (seen == IFNE)) {
@@ -274,12 +273,12 @@
&& ((0x00FF & bytes[lastPCs[0]]) == IFEQ)) {
if (getMethod().getSignature().endsWith("Z")) {
boolean bug = true;
- Set<Integer> branchInsSet = branchTargets.get(Integer14.valueOf(lastPCs[1]));
+ Set<Integer> branchInsSet = branchTargets.get(Integer.valueOf(lastPCs[1]));
if (branchInsSet != null)
{
bug = false;
}
- branchInsSet = branchTargets.get(Integer14.valueOf(lastPCs[3]));
+ branchInsSet = branchTargets.get(Integer.valueOf(lastPCs[3]));
if ((branchInsSet != null) && branchInsSet.size() > 1)
{
bug = false;
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousCloneAlgorithm.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousCloneAlgorithm.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousCloneAlgorithm.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -27,8 +27,6 @@
import org.apache.bcel.classfile.Method;
import org.apache.bcel.generic.Type;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
-
import edu.umd.cs.findbugs.BugInstance;
import edu.umd.cs.findbugs.BugReporter;
import edu.umd.cs.findbugs.BytecodeScanningDetector;
@@ -47,12 +45,12 @@
try {
cloneableClass = Repository.lookupClass("java/lang/Cloneable");
changingMethods = new HashMap<String, Integer>();
- changingMethods.put("add", Integer14.valueOf(NORMAL_PRIORITY));
- changingMethods.put("addAll", Integer14.valueOf(NORMAL_PRIORITY));
- changingMethods.put("put", Integer14.valueOf(NORMAL_PRIORITY));
- changingMethods.put("putAll", Integer14.valueOf(NORMAL_PRIORITY));
- changingMethods.put("insert", Integer14.valueOf(LOW_PRIORITY));
- changingMethods.put("set", Integer14.valueOf(LOW_PRIORITY));
+ changingMethods.put("add", Integer.valueOf(NORMAL_PRIORITY));
+ changingMethods.put("addAll", Integer.valueOf(NORMAL_PRIORITY));
+ changingMethods.put("put", Integer.valueOf(NORMAL_PRIORITY));
+ changingMethods.put("putAll", Integer.valueOf(NORMAL_PRIORITY));
+ changingMethods.put("insert", Integer.valueOf(LOW_PRIORITY));
+ changingMethods.put("set", Integer.valueOf(LOW_PRIORITY));
} catch (ClassNotFoundException cnfe) {
cloneableClass = null;
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousClusteredSessionSupport.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousClusteredSessionSupport.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousClusteredSessionSupport.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -26,7 +26,6 @@
import org.apache.bcel.classfile.Code;
import org.apache.bcel.generic.Type;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import edu.umd.cs.findbugs.BugInstance;
@@ -112,14 +111,14 @@
}
} else if (((seen >= ALOAD_0) && (seen <= ALOAD_3)) || (seen == ALOAD)) {
int reg = RegisterUtils.getALoadReg(this, seen);
- attributeName = savedAttributes.get(Integer14.valueOf(reg));
+ attributeName = savedAttributes.get(Integer.valueOf(reg));
sawGetAttribute = attributeName != null;
} else if (((seen >= ASTORE_0) && (seen <= ASTORE_3)) || (seen == ASTORE)) {
if (stack.getStackDepth() > 0) {
OpcodeStack.Item item = stack.getStackItem(0);
attributeName = (String)item.getUserValue();
int reg = RegisterUtils.getAStoreReg(this, seen);
- savedAttributes.put(Integer14.valueOf(reg), attributeName);
+ savedAttributes.put(Integer.valueOf(reg), attributeName);
}
}
@@ -133,7 +132,7 @@
OpcodeStack.Item item = stack.getStackItem(numArgs);
attributeName = (String)item.getUserValue();
if (attributeName != null) {
- changedAttributes.put(attributeName, Integer14.valueOf(getPC()));
+ changedAttributes.put(attributeName, Integer.valueOf(getPC()));
}
}
}
@@ -142,7 +141,7 @@
OpcodeStack.Item item = stack.getStackItem(2);
attributeName = (String)item.getUserValue();
if (attributeName != null) {
- changedAttributes.put(attributeName, Integer14.valueOf(getPC()));
+ changedAttributes.put(attributeName, Integer.valueOf(getPC()));
}
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousJDKVersionUse.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -40,8 +40,6 @@
import org.apache.bcel.classfile.JavaClass;
import org.apache.bcel.classfile.Method;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
-
import edu.umd.cs.findbugs.BugInstance;
import edu.umd.cs.findbugs.BugReporter;
import edu.umd.cs.findbugs.BytecodeScanningDetector;
@@ -51,21 +49,21 @@
{
private static final Map<Integer, String> verRegEx = new HashMap<Integer, String>();
static {
- verRegEx.put(Integer14.valueOf(Constants.MAJOR_1_1), "(jdk|j2?re)1.1");
- verRegEx.put(Integer14.valueOf(Constants.MAJOR_1_2), "(jdk|j2?re)1.2");
- verRegEx.put(Integer14.valueOf(Constants.MAJOR_1_3), "(jdk|j2?re)1.3");
- verRegEx.put(Integer14.valueOf(Constants.MAJOR_1_4), "(jdk|j2?re)1.4");
- verRegEx.put(Integer14.valueOf(Constants.MAJOR_1_5), "(jdk|j2?re)1.5");
- verRegEx.put(Integer14.valueOf(50), "(jdk|j2?re)1.6");
+ verRegEx.put(Integer.valueOf(Constants.MAJOR_1_1), "(jdk|j2?re)1.1");
+ verRegEx.put(Integer.valueOf(Constants.MAJOR_1_2), "(jdk|j2?re)1.2");
+ verRegEx.put(Integer.valueOf(Constants.MAJOR_1_3), "(jdk|j2?re)1.3");
+ verRegEx.put(Integer.valueOf(Constants.MAJOR_1_4), "(jdk|j2?re)1.4");
+ verRegEx.put(Integer.valueOf(Constants.MAJOR_1_5), "(jdk|j2?re)1.5");
+ verRegEx.put(Integer.valueOf(50), "(jdk|j2?re)1.6");
}
private static final Map<Integer, String> versionStrings = new HashMap<Integer, String>();
static {
- versionStrings.put(Integer14.valueOf(Constants.MAJOR_1_1), "JDK 1.1");
- versionStrings.put(Integer14.valueOf(Constants.MAJOR_1_2), "JDK 1.2");
- versionStrings.put(Integer14.valueOf(Constants.MAJOR_1_3), "JDK 1.3");
- versionStrings.put(Integer14.valueOf(Constants.MAJOR_1_4), "JDK 1.4");
- versionStrings.put(Integer14.valueOf(Constants.MAJOR_1_5), "JDK 1.5");
- versionStrings.put(Integer14.valueOf(50), "JDK 1.6");
+ versionStrings.put(Integer.valueOf(Constants.MAJOR_1_1), "JDK 1.1");
+ versionStrings.put(Integer.valueOf(Constants.MAJOR_1_2), "JDK 1.2");
+ versionStrings.put(Integer.valueOf(Constants.MAJOR_1_3), "JDK 1.3");
+ versionStrings.put(Integer.valueOf(Constants.MAJOR_1_4), "JDK 1.4");
+ versionStrings.put(Integer.valueOf(Constants.MAJOR_1_5), "JDK 1.5");
+ versionStrings.put(Integer.valueOf(50), "JDK 1.6");
}
private static final Pattern jarPattern = Pattern.compile("jar:file:/*([^!]*)");
private static final String SJVU_JDKHOME = "fb-contrib.sjvu.jdkhome";
@@ -90,7 +88,7 @@
public void visitClassContext(ClassContext classContext) {
try {
cls = classContext.getJavaClass();
- clsMajorVersion = Integer14.valueOf(cls.getMajor());
+ clsMajorVersion = Integer.valueOf(cls.getMajor());
File rtJar = getRTJarFile();
if (rtJar == null)
rtJar = getRTJarFromProperty();
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SuspiciousUninitializedArray.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -23,7 +23,6 @@
import org.apache.bcel.classfile.Code;
import org.apache.bcel.generic.Type;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfatguy.fbcontrib.utils.RegisterUtils;
import com.mebigfatguy.fbcontrib.utils.SignatureUtils;
@@ -167,7 +166,7 @@
if (stack.getStackDepth() >= 2) {
OpcodeStack.Item item = stack.getStackItem(1);
if (UNINIT_ARRAY.equals(item.getUserValue())) {
- userValue = Integer14.valueOf(item.getRegisterNumber());
+ userValue = Integer.valueOf(item.getRegisterNumber());
}
}
}
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/SyncCollectionIterators.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -27,8 +27,6 @@
import org.apache.bcel.classfile.ConstantFieldref;
import org.apache.bcel.classfile.ConstantNameAndType;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
-
import edu.umd.cs.findbugs.BugInstance;
import edu.umd.cs.findbugs.BugReporter;
import edu.umd.cs.findbugs.BytecodeScanningDetector;
@@ -119,14 +117,14 @@
}
} else if (seen == ALOAD) {
int reg = getRegisterOperand();
- if (localCollections.contains(Integer14.valueOf(reg))) {
- collectionInfo = Integer14.valueOf(reg);
+ if (localCollections.contains(Integer.valueOf(reg))) {
+ collectionInfo = Integer.valueOf(reg);
state = SEEN_LOAD;
}
} else if ((seen >= ALOAD_0) && (seen <= ALOAD_3)) {
int reg = seen - ALOAD_0;
- if (localCollections.contains(Integer14.valueOf(reg))) {
- collectionInfo = Integer14.valueOf(reg);
+ if (localCollections.contains(Integer.valueOf(reg))) {
+ collectionInfo = Integer.valueOf(reg);
state = SEEN_LOAD;
}
} else if (seen == GETFIELD) {
@@ -144,10 +142,10 @@
case SEEN_SYNC:
if (seen == ASTORE) {
int reg = getRegisterOperand();
- localCollections.add(Integer14.valueOf(reg));
+ localCollections.add(Integer.valueOf(reg));
} else if ((seen >= ASTORE_0) && (seen <= ASTORE_3)) {
int reg = seen - ASTORE_0;
- localCollections.add(Integer14.valueOf(reg));
+ localCollections.add(Integer.valueOf(reg));
}
else if (seen == PUTFIELD) {
ConstantFieldref ref = (ConstantFieldref)getConstantRefOperand();
@@ -200,7 +198,7 @@
OpcodeStack.Item item = stack.getStackItem(0);
int reg = item.getRegisterNumber();
if (reg >= 0)
- monitorObjects.add(Integer14.valueOf(reg));
+ monitorObjects.add(Integer.valueOf(reg));
else {
XField field = item.getXField();
if (field != null)
Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryNewNullCheck.java
===================================================================
--- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryNewNullCheck.java 2009-12-20 00:42:19 UTC (rev 1404)
+++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UnnecessaryNewNullCheck.java 2009-12-20 00:52:13 UTC (rev 1405)
@@ -27,7 +27,6 @@
import org.apache.bcel.classfile.CodeException;
import com.mebigfatguy.fbcontrib.utils.AttributesUtils;
-import com.mebigfatguy.fbcontrib.utils.Integer14;
import com.mebigfat...
[truncated message content] |