[Fb-contrib-commit] SF.net SVN: fb-contrib: [988] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/d
Brought to you by:
dbrosius
From: <dbr...@us...> - 2008-01-20 13:29:49
|
Revision: 988 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=988&view=rev Author: dbrosius Date: 2008-01-20 05:29:48 -0800 (Sun, 20 Jan 2008) Log Message: ----------- type safety Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseAddAll.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseAddAll.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseAddAll.java 2008-01-18 17:09:52 UTC (rev 987) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/UseAddAll.java 2008-01-20 13:29:48 UTC (rev 988) @@ -56,9 +56,9 @@ private BugReporter bugReporter; private OpcodeStack stack; /** register/field to alias register/field */ - private Map<Comparable, Comparable> userValues; + private Map<Comparable<?>, Comparable<?>> userValues; /** alias register to loop info */ - private Map<Comparable, LoopInfo> loops; + private Map<Comparable<?>, LoopInfo> loops; private boolean isInstanceMethod; /** @@ -101,8 +101,8 @@ public void visitCode(Code obj) { try { stack.resetForMethodEntry(this); - userValues = new HashMap<Comparable, Comparable>(); - loops = new HashMap<Comparable, LoopInfo>(); + userValues = new HashMap<Comparable<?>, Comparable<?>>(); + loops = new HashMap<Comparable<?>, LoopInfo>(); isInstanceMethod = !getMethod().isStatic(); super.visitCode(obj); } finally { @@ -118,8 +118,8 @@ */ @Override public void sawOpcode(int seen) { - Comparable regOrField = null; - Comparable uValue; + Comparable<?> regOrField = null; + Comparable<?> uValue; boolean sawAlias = false; boolean sawLoad = false; @@ -164,7 +164,7 @@ int reg = isLocalCollection(colItem); if (reg >= 0) { regOrField = Integer14.valueOf(reg); - uValue = (Comparable)valueItem.getUserValue(); + uValue = (Comparable<?>)valueItem.getUserValue(); if (uValue != null) { LoopInfo loop = loops.get(uValue); if ((loop != null) && loop.isInLoop(getPC(), false)) { @@ -178,7 +178,7 @@ String field = isFieldCollection(colItem); if (field != null) { regOrField = field; - uValue = (Comparable)valueItem.getUserValue(); + uValue = (Comparable<?>)valueItem.getUserValue(); if (uValue != null) { LoopInfo loop = loops.get(uValue); if ((loop != null) && loop.isInLoop(getPC(), false)) { @@ -195,7 +195,7 @@ } else if (((seen == ISTORE) || ((seen >= ISTORE_0) && (seen <= ISTORE_3))) || ((seen == ASTORE) || ((seen >= ASTORE_0) && (seen <= ASTORE_3)))) { if (stack.getStackDepth() > 0) { - uValue = (Comparable)stack.getStackItem(0).getUserValue(); + uValue = (Comparable<?>)stack.getStackItem(0).getUserValue(); userValues.put(Integer14.valueOf(RegisterUtils.getStoreReg(this, seen)), uValue); } } else if (((seen == ILOAD) || ((seen >= ILOAD_0) && (seen <= ILOAD_3))) @@ -214,7 +214,7 @@ gotoPos += brOffset; if (gotoPos < getPC()) { OpcodeStack.Item itm = stack.getStackItem(0); - uValue = (Comparable)itm.getUserValue(); + uValue = (Comparable<?>)itm.getUserValue(); if (uValue != null) { loops.put(uValue, new LoopInfo(getPC(), getBranchTarget())); } @@ -235,7 +235,7 @@ if (stack.getStackDepth() > 1) { OpcodeStack.Item item = stack.getStackItem(1); if (item.getRegisterNumber() == 0) { - uValue = (Comparable)stack.getStackItem(0).getUserValue(); + uValue = (Comparable<?>)stack.getStackItem(0).getUserValue(); userValues.put(getNameConstantOperand(), uValue); } } @@ -254,7 +254,7 @@ } else if (seen == CHECKCAST) { if (stack.getStackDepth() > 0) { OpcodeStack.Item itm = stack.getStackItem(0); - uValue = (Comparable)itm.getUserValue(); + uValue = (Comparable<?>)itm.getUserValue(); if (uValue != null) { regOrField = uValue; sawAlias = true; @@ -298,7 +298,7 @@ * @throws ClassNotFoundException if the items class cannot be found */ private int isLocalCollection(OpcodeStack.Item item) throws ClassNotFoundException { - Comparable aliasReg = (Comparable)item.getUserValue(); + Comparable<?> aliasReg = (Comparable<?>)item.getUserValue(); if (aliasReg instanceof Integer) return ((Integer)aliasReg).intValue(); @@ -322,7 +322,7 @@ * @throws ClassNotFoundException if the items class cannot be found */ private String isFieldCollection(OpcodeStack.Item item) throws ClassNotFoundException { - Comparable aliasReg = (Comparable)item.getUserValue(); + Comparable<?> aliasReg = (Comparable<?>)item.getUserValue(); if (aliasReg instanceof String) return (String)aliasReg; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |