From 11e5f025c130be598d14f78ca227164d70a80a1f Mon Sep 17 00:00:00 2001 From: jgreene Date: Thu, 12 Jun 2008 16:24:36 +0000 Subject: [PATCH] remove jdk5 deps git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@444 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- .../javassist/bytecode/analysis/Analyzer.java | 2 +- .../bytecode/analysis/Subroutine.java | 8 ++-- .../bytecode/analysis/SubroutineScanner.java | 8 ++-- .../bytecode/analysis/ScannerTest.java | 2 +- .../convert/ArrayAccessReplaceTest.java | 42 +++++++++---------- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/main/javassist/bytecode/analysis/Analyzer.java b/src/main/javassist/bytecode/analysis/Analyzer.java index 7ef0b00b..ea565997 100644 --- a/src/main/javassist/bytecode/analysis/Analyzer.java +++ b/src/main/javassist/bytecode/analysis/Analyzer.java @@ -221,7 +221,7 @@ public class Analyzer implements Opcode { try { type = index == 0 ? Type.THROWABLE : Type.get(classes.get(constPool.getClassInfo(index))); } catch (NotFoundException e) { - throw new IllegalStateException(e); + throw new IllegalStateException(e.getMessage()); } exceptions[i] = new ExceptionInfo(table.startPc(i), table.endPc(i), table.handlerPc(i), type); diff --git a/src/main/javassist/bytecode/analysis/Subroutine.java b/src/main/javassist/bytecode/analysis/Subroutine.java index 924d37a6..1347813e 100644 --- a/src/main/javassist/bytecode/analysis/Subroutine.java +++ b/src/main/javassist/bytecode/analysis/Subroutine.java @@ -33,11 +33,11 @@ public class Subroutine { public Subroutine(int start, int caller) { this.start = start; - callers.add(Integer.valueOf(caller)); + callers.add(new Integer(caller)); } public void addCaller(int caller) { - callers.add(Integer.valueOf(caller)); + callers.add(new Integer(caller)); } public int start() { @@ -45,11 +45,11 @@ public class Subroutine { } public void access(int index) { - access.add(Integer.valueOf(index)); + access.add(new Integer(index)); } public boolean isAccessed(int index) { - return access.contains(Integer.valueOf(index)); + return access.contains(new Integer(index)); } public Collection accessed() { diff --git a/src/main/javassist/bytecode/analysis/SubroutineScanner.java b/src/main/javassist/bytecode/analysis/SubroutineScanner.java index 3feae539..f42202ea 100644 --- a/src/main/javassist/bytecode/analysis/SubroutineScanner.java +++ b/src/main/javassist/bytecode/analysis/SubroutineScanner.java @@ -61,10 +61,10 @@ public class SubroutineScanner implements Opcode { private void scan(int pos, CodeIterator iter, Subroutine sub) throws BadBytecode { // Skip already processed blocks - if (done.contains(Integer.valueOf(pos))) + if (done.contains(new Integer(pos))) return; - done.add(Integer.valueOf(pos)); + done.add(new Integer(pos)); int old = iter.lookAhead(); iter.move(pos); @@ -102,10 +102,10 @@ public class SubroutineScanner implements Opcode { if (Util.isJumpInstruction(opcode)) { int target = Util.getJumpTarget(pos, iter); if (opcode == JSR || opcode == JSR_W) { - Subroutine s = (Subroutine) subTable.get(Integer.valueOf(target)); + Subroutine s = (Subroutine) subTable.get(new Integer(target)); if (s == null) { s = new Subroutine(target, pos); - subTable.put(Integer.valueOf(target), s); + subTable.put(new Integer(target), s); scan(target, iter, s); } else { s.addCaller(pos); diff --git a/src/test/test/javassist/bytecode/analysis/ScannerTest.java b/src/test/test/javassist/bytecode/analysis/ScannerTest.java index 56114baf..10f2936a 100644 --- a/src/test/test/javassist/bytecode/analysis/ScannerTest.java +++ b/src/test/test/javassist/bytecode/analysis/ScannerTest.java @@ -72,7 +72,7 @@ public class ScannerTest extends TestCase { assertNotNull(sub); assertEquals(sub.start(), start); for (int i = 0; i < callers.length; i++) - assertTrue(sub.callers().contains(Integer.valueOf(callers[i]))); + assertTrue(sub.callers().contains(new Integer(callers[i]))); } private static void generate(ClassPool pool) throws CannotCompileException, IOException, NotFoundException { diff --git a/src/test/test/javassist/convert/ArrayAccessReplaceTest.java b/src/test/test/javassist/convert/ArrayAccessReplaceTest.java index 50795240..09387cec 100644 --- a/src/test/test/javassist/convert/ArrayAccessReplaceTest.java +++ b/src/test/test/javassist/convert/ArrayAccessReplaceTest.java @@ -32,7 +32,7 @@ public class ArrayAccessReplaceTest extends TestCase { converter.replaceArrayAccess(clazz, new CodeConverter.DefaultArrayAccessReplacementMethodNames()); clazz.instrument(converter); ComplexInterface instance = (ComplexInterface) clazz.toClass(new URLClassLoader(new URL[0], getClass().getClassLoader()), Class.class.getProtectionDomain()).newInstance(); - assertEquals(Integer.valueOf(5), instance.complexRead(4)); + assertEquals(new Integer(5), instance.complexRead(4)); } public void testBoolean() throws Exception { @@ -119,11 +119,11 @@ public class ArrayAccessReplaceTest extends TestCase { public void testObject() throws Exception { for (int i = 0; i < 100; i++) { - simple.setObject(i, Integer.valueOf(i)); + simple.setObject(i, new Integer(i)); } for (int i = 0; i < 100; i++) { - assertEquals(Integer.valueOf(i), simple.getObject(i)); + assertEquals(new Integer(i), simple.getObject(i)); } } @@ -158,67 +158,67 @@ public class ArrayAccessReplaceTest extends TestCase { public static Map shortMap = new HashMap(); public static Object arrayReadObject(Object array, int index) { - return objectMap.get(Integer.valueOf(index)); + return objectMap.get(new Integer(index)); } public static void arrayWriteObject(Object array, int index, Object element) { - objectMap.put(Integer.valueOf(index), element); + objectMap.put(new Integer(index), element); } public static byte arrayReadByteOrBoolean(Object array, int index) { - return ((Byte)byteMap.get(Integer.valueOf(index))).byteValue(); + return ((Byte)byteMap.get(new Integer(index))).byteValue(); } public static void arrayWriteByteOrBoolean(Object array, int index, byte element) { - byteMap.put(Integer.valueOf(index), Byte.valueOf(element)); + byteMap.put(new Integer(index), new Byte(element)); } public static char arrayReadChar(Object array, int index) { - return ((Character)charMap.get(Integer.valueOf(index))).charValue(); + return ((Character)charMap.get(new Integer(index))).charValue(); } public static void arrayWriteChar(Object array, int index, char element) { - charMap.put(Integer.valueOf(index), Character.valueOf(element)); + charMap.put(new Integer(index), new Character(element)); } public static double arrayReadDouble(Object array, int index) { - return ((Double)doubleMap.get(Integer.valueOf(index))).doubleValue(); + return ((Double)doubleMap.get(new Integer(index))).doubleValue(); } public static void arrayWriteDouble(Object array, int index, double element) { - doubleMap.put(Integer.valueOf(index), Double.valueOf(element)); + doubleMap.put(new Integer(index), new Double(element)); } public static float arrayReadFloat(Object array, int index) { - return ((Float)floatMap.get(Integer.valueOf(index))).floatValue(); + return ((Float)floatMap.get(new Integer(index))).floatValue(); } public static void arrayWriteFloat(Object array, int index, float element) { - floatMap.put(Integer.valueOf(index), Float.valueOf(element)); + floatMap.put(new Integer(index), new Float(element)); } public static int arrayReadInt(Object array, int index) { - return ((Integer)intMap.get(Integer.valueOf(index))).intValue(); + return ((Integer)intMap.get(new Integer(index))).intValue(); } public static void arrayWriteInt(Object array, int index, int element) { - intMap.put(Integer.valueOf(index), Integer.valueOf(element)); + intMap.put(new Integer(index), new Integer(element)); } public static long arrayReadLong(Object array, int index) { - return ((Long)longMap.get(Integer.valueOf(index))).longValue(); + return ((Long)longMap.get(new Integer(index))).longValue(); } public static void arrayWriteLong(Object array, int index, long element) { - longMap.put(Integer.valueOf(index), Long.valueOf(element)); + longMap.put(new Integer(index), new Long(element)); } public static short arrayReadShort(Object array, int index) { - return ((Short)shortMap.get(Integer.valueOf(index))).shortValue(); + return ((Short)shortMap.get(new Integer(index))).shortValue(); } public static void arrayWriteShort(Object array, int index, short element) { - shortMap.put(Integer.valueOf(index), Short.valueOf(element)); + shortMap.put(new Integer(index), new Short(element)); } } @@ -393,7 +393,7 @@ public class ArrayAccessReplaceTest extends TestCase { private static Integer justRead; public static Object arrayReadObject(Object array, int offset) { - return Integer.valueOf(justRead.intValue() + offset); + return new Integer(justRead.intValue() + offset); } public static void arrayWriteObject(Object array, int offset, Object element) { @@ -401,7 +401,7 @@ public class ArrayAccessReplaceTest extends TestCase { } public Object getInteger(int i) { - return (Object) Integer.valueOf(i); + return (Object) new Integer(i); } public Number complexRead(int x) { -- 2.39.5