]> source.dussan.org Git - aspectj.git/commitdiff
Unnecessary boxing
authorLars Grefer <eclipse@larsgrefer.de>
Sat, 8 Aug 2020 01:14:13 +0000 (03:14 +0200)
committerLars Grefer <eclipse@larsgrefer.de>
Sat, 8 Aug 2020 01:14:13 +0000 (03:14 +0200)
Reports explicit boxing, i.e. wrapping of primitive values in objects. Explicit manual boxing is unnecessary under Java 5 and newer, and can be safely removed.

Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
25 files changed:
asm/src/main/java/org/aspectj/asm/AsmManager.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java
bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Instruction.java
bridge/src/main/java/org/aspectj/bridge/context/CompilationAndWeavingContext.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java
org.aspectj.ajdt.core/src/test/java/AroundAMain.java
org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java
org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjAST5Test.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedTypeMunger.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ModifiersPattern.java
org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WildTypePattern.java
org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/ArgsTestCase.java
runtime/src/main/java/org/aspectj/runtime/internal/Conversions.java
testing/src/test/java/org/aspectj/internal/tools/ant/taskdefs/Ajctest.java
testing/src/test/java/org/aspectj/testing/harness/bridge/JavaRun.java
testing/src/test/java/org/aspectj/testing/util/LinkCheck.java
tests/src/test/java/org/aspectj/systemtest/ajc154/Ajc154Tests.java
weaver/src/main/java/org/aspectj/weaver/bcel/AnnotationAccessVar.java
weaver/src/main/java/org/aspectj/weaver/bcel/BcelClassWeaver.java
weaver/src/main/java/org/aspectj/weaver/bcel/BcelShadow.java
weaver/src/main/java/org/aspectj/weaver/bcel/LazyMethodGen.java
weaver/src/main/java/org/aspectj/weaver/tools/cache/SimpleCache.java

index 6972dda3a727399903c7e7bc3eca7d60e0e366c1..d1b7ed3f2596f6f7fae06657c9c48e784b76253a 100644 (file)
@@ -162,7 +162,7 @@ public class AsmManager implements IStructureModel {
                                entries.add(peNode);
                                ISourceLocation sourceLoc = peNode.getSourceLocation();
                                if (null != sourceLoc) {
-                                       Integer hash = new Integer(sourceLoc.getLine());
+                                       Integer hash = sourceLoc.getLine();
                                        List<IProgramElement> existingEntry = annotations.get(hash);
                                        if (existingEntry != null) {
                                                entries.addAll(existingEntry);
@@ -1189,9 +1189,9 @@ public class AsmManager implements IStructureModel {
                        String node = ipe.getKind().toString();
                        Integer ctr = nodeTypeCount.get(node);
                        if (ctr == null) {
-                               nodeTypeCount.put(node, new Integer(1));
+                               nodeTypeCount.put(node, 1);
                        } else {
-                               ctr = new Integer(ctr.intValue() + 1);
+                               ctr = ctr.intValue() + 1;
                                nodeTypeCount.put(node, ctr);
                        }
                }
index 0430e28ba3530ecd0978eb44895d4a7e45a1c8eb..4108912122ab0202f0164d29ab0b057997647284 100644 (file)
@@ -465,7 +465,7 @@ public class ConstantPool implements Node {
                                String typeSignature = ((ConstantUtf8) pool[cnat.getSignatureIndex()]).getValue();
                                if (!typeSignature.equals(searchSignature))
                                        continue;
-                               fieldCache.put(k, new Integer(i));
+                               fieldCache.put(k, i);
                                return i;
                        }
                }
@@ -793,7 +793,7 @@ public class ConstantPool implements Node {
                                String typeSignature = ((ConstantUtf8) pool[cnat.getSignatureIndex()]).getValue();
                                if (!typeSignature.equals(searchSignature))
                                        continue;
-                               methodCache.put(key, new Integer(i));
+                               methodCache.put(key, i);
                                return i;
                        }
                }
index 113be06ee501f762a60375daa4f8626d176c1d71..3fa40ac0fe3e93aaba2cb41f1692a67559544fce 100644 (file)
@@ -342,7 +342,7 @@ public class Instruction implements Cloneable, Serializable, Constants {
                case ICONST_3:
                case ICONST_4:
                case ICONST_5:
-                       return new Integer(opcode - ICONST_0);
+                       return opcode - ICONST_0;
                default:
                        throw new IllegalStateException("Not implemented yet for " + getName());
                }
index 28a414acd6e739798bc52ba112165d4c018b3b46..6117b96a907f0e187297ba33d2caa6899da0c064 100644 (file)
@@ -123,7 +123,7 @@ public class CompilationAndWeavingContext {
        }
 
        public static void registerFormatter(int phaseId, ContextFormatter aFormatter) {
-               formatterMap.put(new Integer(phaseId), aFormatter);
+               formatterMap.put(phaseId, aFormatter);
        }
 
        /**
@@ -195,7 +195,7 @@ public class CompilationAndWeavingContext {
        }
 
        private static ContextFormatter getFormatter(ContextStackEntry entry) {
-               Integer key = new Integer(entry.phaseId);
+               Integer key = entry.phaseId;
                if (formatterMap.containsKey(key)) {
                        return formatterMap.get(key);
                } else {
index 3d2fb727f0cffcb94fdfdb6ad69ff39047800d07..93a5019f33999eb6ac6e245d8ea6fa39b3025b44 100644 (file)
@@ -155,7 +155,7 @@ public class EclipseAnnotationConvertor {
                        Constant c = defaultValue.constant;
                        if (c instanceof IntConstant) {
                                IntConstant iConstant = (IntConstant) c;
-                               return new SimpleAnnotationValue(ElementValue.PRIMITIVE_INT, new Integer(iConstant.intValue()));
+                               return new SimpleAnnotationValue(ElementValue.PRIMITIVE_INT, iConstant.intValue());
                        } else if (c instanceof BooleanConstant) {
                                BooleanConstant iConstant = (BooleanConstant) c;
                                return new SimpleAnnotationValue(ElementValue.PRIMITIVE_BOOLEAN, iConstant.booleanValue());
index 7e08c02a7b813bea578f751267aff8ea3a646487..4c38f125cf44db487ed86fbab3aa2bda25157dcb 100644 (file)
@@ -1536,7 +1536,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
 //                                             System.err.println("Detected a structural change in " + thisTime.getFilename());
                                                printStructuralChanges(thisTime.getFilename(),reader, existingStructure);
                                        }
-                                       structuralChangesSinceLastFullBuild.put(thisTime.getFilename(), new Long(currentBuildTime));
+                                       structuralChangesSinceLastFullBuild.put(thisTime.getFilename(), currentBuildTime);
                                        recordTypeChanged(new String(reader.getName()).replace('/', '.'));
                                }
                        }
index d9a2929d0015972fb93a35d98909d46576f7f540..9dce77d1ea4e88701959a0864e46e4592f32e569 100644 (file)
@@ -25,7 +25,7 @@ public class AroundAMain {//extends TestCase {
                        @Override
                        public Object run(Object[] args) throws Throwable {
                                //                              System.out.println("run with: " + Arrays.asList(args));
-                               return new Integer(10);
+                               return 10;
                        }
                };
 
@@ -33,7 +33,7 @@ public class AroundAMain {//extends TestCase {
                                "ajc$perSingletonInstance");
 
                Reflection.invoke(Class.forName("AroundA"), instance, "ajc$around$AroundA$1$73ebb943", // was $AroundA$46
-                               new Integer(10), true, closure);
+                               10, true, closure);
 
                Reflection.invoke(Class.forName("AroundA"), instance, "ajc$around$AroundA$2$a758212d",  // Was $AroundA$c5
                                "hello there", closure);
index 6b96c9469b3416e0d38a0028b32785bd0e800474..82682bb29862354dddcfb71acadba2697a262fa1 100644 (file)
@@ -174,7 +174,7 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests?
                IMessageHolder compilerMessages,
         StringBuffer commandLine,
                IMessageHandler handler) {
-        log("verifyCompile -  iteration ", new Integer(iteration), handler);
+        log("verifyCompile -  iteration ", iteration, handler);
                log("verifyCompile -        def ", def, handler);
         log("verifyCompile -    command ", commandLine.toString(), handler);
                log("verifyCompile -   messages ", compilerMessages, handler);
index c41e07fe153fd1d1ade2919a6e15e6ab56f82536..560d7d244c01b6db931131097c4738ff8b32e4d6 100644 (file)
@@ -62,7 +62,7 @@ public class AjAST5Test extends AjASTTestCase {
                        } else if (o instanceof SimplePropertyDescriptor) {
                                SimplePropertyDescriptor element = (SimplePropertyDescriptor) o;
                                if (element.getId().equals("privileged")) {
-                                       Boolean b = new Boolean(true);
+                                       Boolean b = Boolean.TRUE;
                                        d.setStructuralProperty(element, b);
                                        assertEquals("AspectDeclaration's isPrivileged property should" +
                                                        " now be a boolean", b, d.getStructuralProperty(element));
@@ -89,7 +89,7 @@ public class AjAST5Test extends AjASTTestCase {
                        if (o instanceof SimplePropertyDescriptor) {
                                SimplePropertyDescriptor element = (SimplePropertyDescriptor) o;
                                if (element.getId().equals("aspect")) {
-                                       Boolean b = new Boolean(true);
+                                       Boolean b = Boolean.TRUE;
                                        d.setStructuralProperty(element, b);
                                        assertEquals("AjTypeDeclaration's aspect property should" +
                                                        " now be a SignaturePattern", b, d.getStructuralProperty(element));
@@ -140,7 +140,7 @@ public class AjAST5Test extends AjASTTestCase {
                        } else if (o instanceof SimplePropertyDescriptor) {
                                SimplePropertyDescriptor element = (SimplePropertyDescriptor) o;
                                if (element.getId().equals("isExtends")) {
-                                       Boolean b = new Boolean(true);
+                                       Boolean b = Boolean.TRUE;
                                        d.setStructuralProperty(element, b);
                                        assertEquals("DeclareParentsDeclaration's isExtends property should" +
                                                        " now be a boolean", b, d.getStructuralProperty(element));
index 2ba3cbc36f8a0b577b54c5dda66eb6339e4f3487..289547bbc6f193e1f2685fc1cc2475495ac5b0b8 100644 (file)
@@ -259,11 +259,11 @@ public abstract class ResolvedTypeMunger {
                } else {
                        s.writeByte(0);
                        ObjectOutputStream oos = new ObjectOutputStream(s);
-                       oos.writeObject(new Boolean(location != null));
+                       oos.writeObject(location != null);
                        if (location != null) {
                                oos.writeObject(location.getSourceFile());
-                               oos.writeObject(new Integer(location.getLine()));
-                               oos.writeObject(new Integer(location.getOffset()));
+                               oos.writeObject(location.getLine());
+                               oos.writeObject(location.getOffset());
                        }
                        oos.flush();
                        oos.close();
index fc2b1d4d1dd69c02652a78abadd368252690965a..1892e8940b1e9c4bed58828016d83dace6b7d8cf 100644 (file)
@@ -596,7 +596,7 @@ public abstract class Shadow {
                                                                // Ask the world if it knows about precedence between these
                                                                Integer order = getIWorld().getPrecedenceIfAny(adviceA.concreteAspect, adviceB.concreteAspect);
 
-                                                               if (order != null && order.equals(new Integer(0))) {
+                                                               if (order != null && order.equals(0)) {
                                                                        String key = adviceA.getDeclaringAspect() + ":" + adviceB.getDeclaringAspect();
                                                                        String possibleExistingKey = adviceB.getDeclaringAspect() + ":" + adviceA.getDeclaringAspect();
                                                                        if (!clashingAspects.contains(possibleExistingKey)) {
index 3b69a5d73f373017fefa06d52d0da8bb47020205..32648268e4743e54d46c5586a355f5b2b81d9756 100644 (file)
@@ -1453,7 +1453,7 @@ public abstract class World implements Dump.INode {
                                                }
                                        }
                                }
-                               cachedResults.put(key, new Integer(order));
+                               cachedResults.put(key, order);
                                return order;
                        }
                }
index 6c1d0557e47139368f513017335146e44b872509..83ad90528da6b242120f72c8c4c0021a19da8cb9 100644 (file)
@@ -33,10 +33,11 @@ public class ModifiersPattern extends PatternNode {
                int flag = 1;
                while (flag <= Modifier.STRICT) {
                        String flagName = Modifier.toString(flag);
-                       modifierFlags.put(flagName, new Integer(flag));
+                       modifierFlags.put(flagName, flag);
                        flag = flag << 1;
                }
-               modifierFlags.put("synthetic", new Integer(0x1000 /* Modifier.SYNTHETIC */));
+               /* Modifier.SYNTHETIC */
+               modifierFlags.put("synthetic", 0x1000);
        }
 
        public ModifiersPattern(int requiredModifiers, int forbiddenModifiers) {
index 39d4a387be74c5395aeda0e0fafa9c9959a91f0f..c766d30bacc191f97885dc4093ff87c266e6115a 100644 (file)
@@ -1023,7 +1023,7 @@ public class WildTypePattern extends TypePattern {
                if ((tvs.length < minRequiredTypeParameters) || (!foundEllipsis && minRequiredTypeParameters != tvs.length)) {
                        // issue message "does not match because wrong no of type params"
                        String msg = WeaverMessages.format(WeaverMessages.INCORRECT_NUMBER_OF_TYPE_ARGUMENTS, genericType.getName(),
-                                       new Integer(tvs.length));
+                                       tvs.length);
                        if (requireExactType) {
                                scope.message(MessageUtil.error(msg, getSourceLocation()));
                        } else {
@@ -1092,7 +1092,7 @@ public class WildTypePattern extends TypePattern {
                                                        parameterName = ((TypeVariableReference) ut).getTypeVariable().getDisplayName();
                                                }
                                                String msg = WeaverMessages.format(WeaverMessages.VIOLATES_TYPE_VARIABLE_BOUNDS, parameterName,
-                                                               new Integer(i + 1), tvs[i].getDisplayName(), genericType.getName());
+                                                               i + 1, tvs[i].getDisplayName(), genericType.getName());
                                                if (requireExactType) {
                                                        scope.message(MessageUtil.error(msg, sLoc));
                                                } else {
index 705674cb3897abc867dbb6074ebd8f913e6bca8b..b60cad83533568fd2fa8e6cb3066107573675759 100644 (file)
@@ -116,15 +116,15 @@ public class ArgsTestCase extends TestCase {
                        Method oneIntegerM = A.class.getMethod("anInteger", new Class[] { Integer.class });
 
                        if (LangUtil.is15VMOrGreater()) {
-                               checkMatches(oneInt.matchesMethodExecution(oneIntM), new A(), new A(), new Object[] { new Integer(5) });
-                               checkMatches(oneInt.matchesMethodExecution(oneIntegerM), new A(), new A(), new Object[] { new Integer(5) });
-                               checkMatches(oneInteger.matchesMethodExecution(oneIntM), new A(), new A(), new Object[] { new Integer(5) });
-                               checkMatches(oneInteger.matchesMethodExecution(oneIntegerM), new A(), new A(), new Object[] { new Integer(5) });
+                               checkMatches(oneInt.matchesMethodExecution(oneIntM), new A(), new A(), new Object[] {5});
+                               checkMatches(oneInt.matchesMethodExecution(oneIntegerM), new A(), new A(), new Object[] {5});
+                               checkMatches(oneInteger.matchesMethodExecution(oneIntM), new A(), new A(), new Object[] {5});
+                               checkMatches(oneInteger.matchesMethodExecution(oneIntegerM), new A(), new A(), new Object[] {5});
                        } else {
-                               checkMatches(oneInt.matchesMethodExecution(oneIntM), new A(), new A(), new Object[] { new Integer(5) });
-                               checkNoMatch(oneInt.matchesMethodExecution(oneIntegerM), new A(), new A(), new Object[] { new Integer(5) });
-                               checkNoMatch(oneInteger.matchesMethodExecution(oneIntM), new A(), new A(), new Object[] { new Integer(5) });
-                               checkMatches(oneInteger.matchesMethodExecution(oneIntegerM), new A(), new A(), new Object[] { new Integer(5) });
+                               checkMatches(oneInt.matchesMethodExecution(oneIntM), new A(), new A(), new Object[] {5});
+                               checkNoMatch(oneInt.matchesMethodExecution(oneIntegerM), new A(), new A(), new Object[] {5});
+                               checkNoMatch(oneInteger.matchesMethodExecution(oneIntM), new A(), new A(), new Object[] {5});
+                               checkMatches(oneInteger.matchesMethodExecution(oneIntegerM), new A(), new A(), new Object[] {5});
                        }
 
                } catch (Exception ex) {
index 13e8d9eddf24117b08d6605c3e20c2cd1fb1ac20..6fb5f916fe7dee32dabc1c032028a72f4863fc91 100644 (file)
@@ -20,25 +20,25 @@ public final class Conversions {
 
        // we might want to keep a cache of small integers around
        public static Object intObject(int i) {
-               return new Integer(i);
+               return i;
        }
        public static Object shortObject(short i) {
-               return new Short(i);
+               return i;
        }
        public static Object byteObject(byte i) {
-               return new Byte(i);
+               return i;
        }
        public static Object charObject(char i) {
-               return new Character(i);
+               return i;
        }
        public static Object longObject(long i) {
-               return new Long(i);
+               return i;
        }
        public static Object floatObject(float i) {
-               return new Float(i);
+               return i;
        }
        public static Object doubleObject(double i) {
-               return new Double(i);
+               return i;
        }
        public static Object booleanObject(boolean i) {
                return i;
index 67e73ed6ca6c35b0518ce105819487def2cf6b0b..bbe264846dbee278d0cdb9c6f5ea401ab8675ac2 100644 (file)
@@ -812,7 +812,7 @@ public class Ajctest extends Task implements PropertyChangeListener {
             List<Argument> bothargs = new Vector<>(args);
             bothargs.addAll(testset.args);
             List<List<Arg>> argcombo = argcombo(bothargs);
-            argcombos.add(new Integer(argcombo.size()));
+            argcombos.add(argcombo.size());
             testsetToArgcombo.put(testset, argcombo);
         }
         while (!testsetToArgcombo.isEmpty()) {
@@ -1786,7 +1786,7 @@ public class Ajctest extends Task implements PropertyChangeListener {
             public void add(Failure f, String taskname, String type,
                             int num, long time) {
                 model.addRow(new Object[]{taskname, type,
-                                          new Integer(num), date(time)});
+                                               num, date(time)});
                 failures.add(f);
             }
         }
index db74288165fe3c9104169bec5c60b06fd271a751..92aaec667b837bc1f1034129d869eb11bd50d8f8 100644 (file)
@@ -208,7 +208,7 @@ public class JavaRun implements IAjcRun {
                        }
                        if (thrown instanceof RunSecurityManager.ExitCalledException) {
                                int i = ((RunSecurityManager.ExitCalledException) thrown).exitCode;
-                               status.finish(new Integer(i));
+                               status.finish(i);
                        } else if (thrown instanceof RunSecurityManager.AwtUsedException) {
                                MessageUtil.fail(status, "test code should not use the AWT event queue");
                                throw (RunSecurityManager.AwtUsedException) thrown;
@@ -224,7 +224,7 @@ public class JavaRun implements IAjcRun {
                        }
                } catch (RunSecurityManager.ExitCalledException e) {
                        // XXX need to update run validator (a) to accept null result or (b) to require zero result, and set 0 if completed normally
-                       status.finish(new Integer(e.exitCode));
+                       status.finish(e.exitCode);
                } catch (ClassNotFoundException e) {
                        String[] classes = FileUtil.listFiles(sandbox.classesDir);
                        MessageUtil.info(status, "sandbox.classes: " + Arrays.asList(classes));
index fd1edaf6fa38e875f5d25bbe6584f8f67e83685b..d7f6de21a0fa34fbb02b4ae651fefab25524b345 100644 (file)
@@ -382,7 +382,7 @@ public class LinkCheck {
         }
 
         private void checkingLinks(int i) {
-            info("checkingLinks", new Integer(i));
+            info("checkingLinks", i);
         }
 
         private void checkingLink(Link link) {
index 6fde74765028d03d37b022fad0fafb4ee73d9e26..ddf37d42aad160c7e6ea32f48471c92b52a55dd8 100644 (file)
@@ -237,7 +237,7 @@ public class Ajc154Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
                // Damage the line number table, entry 2 (Line7:5) so it points to an invalid (not on an instruction boundary) position of 6
                Field ff = LineNumber.class.getDeclaredField("startPC");
                ff.setAccessible(true);
-               ff.set(oneWeWant.getLineNumberTable().getLineNumberTable()[2], new Integer(6));
+               ff.set(oneWeWant.getLineNumberTable().getLineNumberTable()[2], 6);
                // oneWeWant.getLineNumberTable().getLineNumberTable()[2].setStartPC(6);
 
                // Should be 'rounded down' when transforming it into a MethodGen, new position will be '5'
index 88a67d666ff08556a2c3c00fb46a9cf6a234aff6..a6ed94b798d0bc1431531267bb5c73458886daf7 100644 (file)
@@ -210,14 +210,14 @@ public class AnnotationAccessVar extends BcelVar {
        }
 
        private void buildArray(InstructionList il, InstructionFactory fact, Type arrayElementType, Type[] arrayEntries, int dim) {
-               il.append(fact.createConstant(Integer.valueOf(arrayEntries == null ? 0 : arrayEntries.length)));
+               il.append(fact.createConstant(arrayEntries == null ? 0 : arrayEntries.length));
                il.append(fact.createNewArray(arrayElementType, (short) dim));
                if (arrayEntries == null) {
                        return;
                }
                for (int i = 0; i < arrayEntries.length; i++) {
                        il.append(InstructionFactory.createDup(1));
-                       il.append(fact.createConstant(Integer.valueOf(i)));
+                       il.append(fact.createConstant(i));
                        switch (arrayEntries[i].getType()) {
                        case Constants.T_ARRAY:
                                il.append(fact.createConstant(new ObjectType(arrayEntries[i].getSignature()))); // FIXME should be getName() and not
index 36cd2686eac3fadff88518835d84d9bf343e9fe5..2e0b8e5f3b6b64fb60f5e745cd5cebd713338ca6 100644 (file)
@@ -1560,7 +1560,7 @@ class BcelClassWeaver implements IClassWeaver {
        private boolean doesAlreadyHaveAnnotation(ResolvedMember rm, DeclareAnnotation deca, List<Integer> reportedProblems, boolean reportError) {
                if (rm.hasAnnotation(deca.getAnnotationType())) {
                        if (reportError && world.getLint().elementAlreadyAnnotated.isEnabled()) {
-                               Integer uniqueID = new Integer(rm.hashCode() * deca.hashCode());
+                               Integer uniqueID = rm.hashCode() * deca.hashCode();
                                if (!reportedProblems.contains(uniqueID)) {
                                        reportedProblems.add(uniqueID);
                                        world.getLint().elementAlreadyAnnotated.signal(new String[] { rm.toString(),
@@ -1577,10 +1577,10 @@ class BcelClassWeaver implements IClassWeaver {
                        List<Integer> reportedProblems) {
                if (rm != null && rm.hasAnnotation(deca.getAnnotationType())) {
                        if (world.getLint().elementAlreadyAnnotated.isEnabled()) {
-                               Integer uniqueID = new Integer(rm.hashCode() * deca.hashCode());
+                               Integer uniqueID = rm.hashCode() * deca.hashCode();
                                if (!reportedProblems.contains(uniqueID)) {
                                        reportedProblems.add(uniqueID);
-                                       reportedProblems.add(new Integer(itdfieldsig.hashCode() * deca.hashCode()));
+                                       reportedProblems.add(itdfieldsig.hashCode() * deca.hashCode());
                                        world.getLint().elementAlreadyAnnotated.signal(new String[] { itdfieldsig.toString(),
                                                        deca.getAnnotationType().toString() }, rm.getSourceLocation(),
                                                        new ISourceLocation[] { deca.getSourceLocation() });
index e92667b2e8416473274feef43d5843d7014858f3..362c8be9d45b4def546214c62997d41222a513f0 100644 (file)
@@ -2942,7 +2942,7 @@ public class BcelShadow extends Shadow {
                        aroundClosureInstance.appendStore(closureInstantiation, fact);
 
                        // stick the bitflags on the stack and call the variant of linkClosureAndJoinPoint that takes an int
-                       closureInstantiation.append(fact.createConstant(Integer.valueOf(bitflags)));
+                       closureInstantiation.append(fact.createConstant(bitflags));
                        if (needAroundClosureStacking) {
                                closureInstantiation.append(Utility.createInvoke(getFactory(), getWorld(),
                                                new MemberImpl(Member.METHOD, UnresolvedType.forName("org.aspectj.runtime.internal.AroundClosure"),
index 049257d48c06a59dce1aca96acfecc6f1c128145..97f805273b0b52d7fd3d8fc0418c302dcb653f17 100644 (file)
@@ -1345,11 +1345,11 @@ public final class LazyMethodGen implements Traceable {
                        if (slots == null) {
                                slots = new HashSet<Integer>();
                                duplicatedLocalMap.put(start, slots);
-                       } else if (slots.contains(new Integer(tag.getSlot()))) {
+                       } else if (slots.contains(tag.getSlot())) {
                                // we already have a var starting at this tag with this slot
                                continue;
                        }
-                       slots.add(Integer.valueOf(tag.getSlot()));
+                       slots.add(tag.getSlot());
                        Type t = tag.getRealType();
                        if (t == null) {
                                t = BcelWorld.makeBcelType(UnresolvedType.forSignature(tag.getType()));
index 45d718a14aaa53fe12f1fb943705e3d499c4aa8c..69cb1a576b90fff44a8ca58c81311dea25f1e0c4 100644 (file)
@@ -324,7 +324,7 @@ public class SimpleCache {
                        }
                        defineClassMethod.setAccessible(true);
                        clazz = defineClassMethod.invoke(loader, new Object[] { name,
-                                       bytes, new Integer(0), new Integer(bytes.length) });
+                                       bytes, 0, bytes.length});
                } catch (InvocationTargetException e) {
                        if (e.getTargetException() instanceof LinkageError) {
                                e.printStackTrace();
@@ -354,8 +354,8 @@ public class SimpleCache {
                        }
                        defineClassWithProtectionDomainMethod.setAccessible(true);
                        clazz = defineClassWithProtectionDomainMethod.invoke(loader,
-                                       new Object[] { name, bytes, Integer.valueOf(0),
-                                                       new Integer(bytes.length), protectionDomain });
+                                       new Object[] { name, bytes, 0,
+                                                       bytes.length, protectionDomain });
                } catch (InvocationTargetException e) {
                        if (e.getTargetException() instanceof LinkageError) {
                                e.printStackTrace();