From: Lars Grefer Date: Sat, 8 Aug 2020 01:16:40 +0000 (+0200) Subject: Unnecessary unboxing X-Git-Tag: V1_9_7M1~30^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=93ce335dc0dad2f420d1b7b1d426ad7bfa3574ad;p=aspectj.git Unnecessary unboxing Reports "unboxing", e.g. explicit unwrapping of wrapped primitive values. Unboxing is unnecessary under Java 5 and newer, and can be safely removed. Signed-off-by: Lars Grefer --- diff --git a/asm/src/main/java/org/aspectj/asm/AsmManager.java b/asm/src/main/java/org/aspectj/asm/AsmManager.java index d1b7ed3f2..b8a8989cb 100644 --- a/asm/src/main/java/org/aspectj/asm/AsmManager.java +++ b/asm/src/main/java/org/aspectj/asm/AsmManager.java @@ -1191,7 +1191,7 @@ public class AsmManager implements IStructureModel { if (ctr == null) { nodeTypeCount.put(node, 1); } else { - ctr = ctr.intValue() + 1; + ctr = ctr + 1; nodeTypeCount.put(node, ctr); } } diff --git a/asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java b/asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java index 5e518c51f..53818534a 100644 --- a/asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java +++ b/asm/src/main/java/org/aspectj/asm/internal/JDTLikeHandleProvider.java @@ -172,7 +172,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { String existingHandle = object.getHandleIdentifier(); int suffixPosition = existingHandle.indexOf('!'); if (suffixPosition != -1) { - count = new Integer(existingHandle.substring(suffixPosition + 1)).intValue() + 1; + count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; } else { if (count == 1) { count = 2; @@ -228,7 +228,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { String existingHandle = object.getHandleIdentifier(); int suffixPosition = existingHandle.indexOf('!'); if (suffixPosition != -1) { - count = new Integer(existingHandle.substring(suffixPosition + 1)).intValue() + 1; + count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; } else { if (count == 1) { count = 2; @@ -280,7 +280,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { String existingHandle = object.getHandleIdentifier(); int suffixPosition = existingHandle.indexOf('!'); if (suffixPosition != -1) { - count = new Integer(existingHandle.substring(suffixPosition + 1)).intValue() + 1; + count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; } else { if (count == 1) { count = 2; @@ -315,7 +315,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { int suffixPosition = existingHandle.lastIndexOf('!'); int lastSquareBracket = existingHandle.lastIndexOf('['); // type delimiter if (suffixPosition != -1 && lastSquareBracket < suffixPosition) { // pr260384 - count = new Integer(existingHandle.substring(suffixPosition + 1)).intValue() + 1; + count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; } else { if (count == 1) { count = 2; @@ -335,7 +335,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { int suffixPosition = existingHandle.lastIndexOf('!'); int lastSquareBracket = existingHandle.lastIndexOf('['); // type delimiter if (suffixPosition != -1 && lastSquareBracket < suffixPosition) { // pr260384 - count = new Integer(existingHandle.substring(suffixPosition + 1)).intValue() + 1; + count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; } else { if (count == 1) { count = 2; @@ -384,7 +384,7 @@ public class JDTLikeHandleProvider implements IElementHandleProvider { String existingHandle = object.getHandleIdentifier(); int suffixPosition = existingHandle.indexOf('!'); if (suffixPosition != -1) { - count = new Integer(existingHandle.substring(suffixPosition + 1)).intValue() + 1; + count = new Integer(existingHandle.substring(suffixPosition + 1)) + 1; } else { if (count == 1) { count = 2; diff --git a/asm/src/main/java/org/aspectj/asm/internal/ProgramElement.java b/asm/src/main/java/org/aspectj/asm/internal/ProgramElement.java index 77fe7a66b..9842830cb 100644 --- a/asm/src/main/java/org/aspectj/asm/internal/ProgramElement.java +++ b/asm/src/main/java/org/aspectj/asm/internal/ProgramElement.java @@ -364,7 +364,7 @@ public class ProgramElement implements IProgramElement { if (b == null) { return false; } - return b.booleanValue(); + return b; } public String[] getRemovedAnnotationTypes() { diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java index 410891212..de8f9c650 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java @@ -444,7 +444,7 @@ public class ConstantPool implements Node { String k = new StringBuffer().append(searchClassname).append(searchFieldname).append(searchSignature).toString(); Integer pos = fieldCache.get(k); if (pos != null) - return pos.intValue(); + return pos; for (int i = 1; i < poolSize; i++) { Constant c = pool[i]; if (c != null && c.tag == Constants.CONSTANT_Fieldref) { @@ -771,7 +771,7 @@ public class ConstantPool implements Node { String key = new StringBuffer().append(searchClassname).append(searchMethodName).append(searchSignature).toString(); Integer cached = methodCache.get(key); if (cached != null) - return cached.intValue(); + return cached; searchClassname = searchClassname.replace('.', '/'); for (int i = 1; i < poolSize; i++) { Constant c = pool[i]; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGen.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGen.java index 50b9ac496..086f276ee 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGen.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGen.java @@ -189,16 +189,16 @@ public class FieldGen extends FieldGenOrMethodGen { case Constants.T_BYTE: case Constants.T_BOOLEAN: case Constants.T_SHORT: - return cp.addInteger(((Integer) value).intValue()); + return cp.addInteger((Integer) value); case Constants.T_FLOAT: - return cp.addFloat(((Float) value).floatValue()); + return cp.addFloat((Float) value); case Constants.T_DOUBLE: - return cp.addDouble(((Double) value).doubleValue()); + return cp.addDouble((Double) value); case Constants.T_LONG: - return cp.addLong(((Long) value).longValue()); + return cp.addLong((Long) value); case Constants.T_REFERENCE: return cp.addString(((String) value)); diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java index 4c38f125c..f4518ead3 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java @@ -820,7 +820,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe Long l = structuralChangesSinceLastFullBuild.get(file.getAbsolutePath()); long strucModTime = -1; if (l != null) { - strucModTime = l.longValue(); + strucModTime = l; } else { strucModTime = this.lastSuccessfulFullBuildTime; } @@ -837,7 +837,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe for (Map.Entry entry : entries) { Long l = entry.getValue(); if (l != null) { - long lvalue = l.longValue(); + long lvalue = l; if (lvalue > lastSuccessfulBuildTime) { if (listenerDefined()) { getListener().recordDecision( diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java index 82682bb29..9f1162c9f 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java @@ -312,7 +312,7 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? if (-1 != loc) s = s.substring(loc + 1); try { - exp[i] = Integer.valueOf(s).intValue(); + exp[i] = Integer.valueOf(s); sb.append(exp[i] + ((i < (exp.length - 1)) ? ", " : "")); } catch (NumberFormatException e) { info(handler, "bad " + label + ":" + expected[i]); diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java index 7aa97ad1e..6bbc076b4 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java @@ -1050,7 +1050,7 @@ public abstract class AjcTestCase extends TestCase { private static boolean getBoolean(String name, boolean def) { String defaultValue = String.valueOf(def); String value = System.getProperty(name, defaultValue); - return Boolean.valueOf(value).booleanValue(); + return Boolean.valueOf(value); } /* diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedTypeMunger.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedTypeMunger.java index 289547bbc..86e06e767 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedTypeMunger.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedTypeMunger.java @@ -217,8 +217,8 @@ public abstract class ResolvedTypeMunger { File f = (File) ois.readObject(); Integer ii = (Integer) ois.readObject(); Integer offset = (Integer) ois.readObject(); - ret = new SourceLocation(f, ii.intValue()); - ret.setOffset(offset.intValue()); + ret = new SourceLocation(f, ii); + ret.setOffset(offset); } } else { boolean validLocation = b == 2; diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/SimpleAnnotationValue.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/SimpleAnnotationValue.java index 27af4e8f5..32e55f6b4 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/SimpleAnnotationValue.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/SimpleAnnotationValue.java @@ -21,31 +21,31 @@ public class SimpleAnnotationValue extends AnnotationValue { super(kind); switch (kind) { case AnnotationValue.PRIMITIVE_BYTE: - theByte = ((Byte) value).byteValue(); + theByte = (Byte) value; break; case AnnotationValue.PRIMITIVE_CHAR: - theChar = ((Character) value).charValue(); + theChar = (Character) value; break; case AnnotationValue.PRIMITIVE_INT: - theInt = ((Integer) value).intValue(); + theInt = (Integer) value; break; case AnnotationValue.STRING: theString = (String) value; break; case AnnotationValue.PRIMITIVE_DOUBLE: - theDouble = ((Double) value).doubleValue(); + theDouble = (Double) value; break; case AnnotationValue.PRIMITIVE_FLOAT: - theFloat = ((Float) value).floatValue(); + theFloat = (Float) value; break; case AnnotationValue.PRIMITIVE_LONG: - theLong = ((Long) value).longValue(); + theLong = (Long) value; break; case AnnotationValue.PRIMITIVE_SHORT: - theShort = ((Short) value).shortValue(); + theShort = (Short) value; break; case AnnotationValue.PRIMITIVE_BOOLEAN: - theBoolean = ((Boolean) value).booleanValue(); + theBoolean = (Boolean) value; break; default: throw new BCException("Not implemented for this kind: " + whatKindIsThis(kind)); diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java index 32648268e..b2af422ff 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java @@ -1428,7 +1428,7 @@ public abstract class World implements Dump.INode { public int compareByPrecedence(ResolvedType firstAspect, ResolvedType secondAspect) { PrecedenceCacheKey key = new PrecedenceCacheKey(firstAspect, secondAspect); if (cachedResults.containsKey(key)) { - return (cachedResults.get(key)).intValue(); + return cachedResults.get(key); } else { int order = 0; DeclarePrecedence orderer = null; // Records the declare diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ModifiersPattern.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ModifiersPattern.java index 83ad90528..d4b747af3 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ModifiersPattern.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ModifiersPattern.java @@ -97,7 +97,7 @@ public class ModifiersPattern extends PatternNode { if (flag == null) { return -1; } - return flag.intValue(); + return flag; } public Object accept(PatternNodeVisitor visitor, Object data) { diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/TraceFactory.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/TraceFactory.java index 6d819de50..e9b42fb83 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/TraceFactory.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/TraceFactory.java @@ -32,7 +32,7 @@ public abstract class TraceFactory { protected static boolean getBoolean(String name, boolean def) { String defaultValue = String.valueOf(def); String value = System.getProperty(name,defaultValue); - return Boolean.valueOf(value).booleanValue(); + return Boolean.valueOf(value); } static { diff --git a/runtime/src/main/java/org/aspectj/lang/Aspects.java b/runtime/src/main/java/org/aspectj/lang/Aspects.java index 726b7ed63..ecc388bdb 100644 --- a/runtime/src/main/java/org/aspectj/lang/Aspects.java +++ b/runtime/src/main/java/org/aspectj/lang/Aspects.java @@ -94,7 +94,7 @@ public class Aspects { */ public static boolean hasAspect(Class aspectClass) throws NoAspectBoundException { try { - return ((Boolean)getSingletonOrThreadHasAspect(aspectClass).invoke(null, EMPTY_OBJECT_ARRAY)).booleanValue(); + return (Boolean) getSingletonOrThreadHasAspect(aspectClass).invoke(null, EMPTY_OBJECT_ARRAY); } catch (Exception e) { return false; } @@ -108,7 +108,7 @@ public class Aspects { */ public static boolean hasAspect(Class aspectClass, Object perObject) throws NoAspectBoundException { try { - return ((Boolean)getPerObjectHasAspect(aspectClass).invoke(null, new Object[]{perObject})).booleanValue(); + return (Boolean) getPerObjectHasAspect(aspectClass).invoke(null, new Object[]{perObject}); } catch (Exception e) { return false; } @@ -122,7 +122,7 @@ public class Aspects { */ public static boolean hasAspect(Class aspectClass, Class perTypeWithin) throws NoAspectBoundException { try { - return ((Boolean)getPerTypeWithinHasAspect(aspectClass).invoke(null, new Object[]{perTypeWithin})).booleanValue(); + return (Boolean) getPerTypeWithinHasAspect(aspectClass).invoke(null, new Object[]{perTypeWithin}); } catch (Exception e) { return false; } diff --git a/runtime/src/main/java/org/aspectj/lang/Aspects14.java b/runtime/src/main/java/org/aspectj/lang/Aspects14.java index b59374d76..4ddb6b123 100644 --- a/runtime/src/main/java/org/aspectj/lang/Aspects14.java +++ b/runtime/src/main/java/org/aspectj/lang/Aspects14.java @@ -95,7 +95,7 @@ public class Aspects14 { */ public static boolean hasAspect(Class aspectClass) throws NoAspectBoundException { try { - return ((Boolean)getSingletonOrThreadHasAspect(aspectClass).invoke(null, EMPTY_OBJECT_ARRAY)).booleanValue(); + return (Boolean) getSingletonOrThreadHasAspect(aspectClass).invoke(null, EMPTY_OBJECT_ARRAY); } catch (Exception e) { return false; } @@ -110,7 +110,7 @@ public class Aspects14 { */ public static boolean hasAspect(Class aspectClass, Object perObject) throws NoAspectBoundException { try { - return ((Boolean)getPerObjectHasAspect(aspectClass).invoke(null, new Object[]{perObject})).booleanValue(); + return (Boolean) getPerObjectHasAspect(aspectClass).invoke(null, new Object[]{perObject}); } catch (Exception e) { return false; } @@ -125,7 +125,7 @@ public class Aspects14 { */ public static boolean hasAspect(Class aspectClass, Class perTypeWithin) throws NoAspectBoundException { try { - return ((Boolean)getPerTypeWithinHasAspect(aspectClass).invoke(null, new Object[]{perTypeWithin})).booleanValue(); + return (Boolean) getPerTypeWithinHasAspect(aspectClass).invoke(null, new Object[]{perTypeWithin}); } catch (Exception e) { return false; } diff --git a/runtime/src/main/java/org/aspectj/runtime/internal/Conversions.java b/runtime/src/main/java/org/aspectj/runtime/internal/Conversions.java index 6fb5f916f..0d784266b 100644 --- a/runtime/src/main/java/org/aspectj/runtime/internal/Conversions.java +++ b/runtime/src/main/java/org/aspectj/runtime/internal/Conversions.java @@ -112,7 +112,7 @@ public final class Conversions { if (o == null) { return 0; } else if (o instanceof Character) { - return ((Character)o).charValue(); + return (Character) o; } else { throw new ClassCastException(o.getClass().getName() + " can not be converted to char"); @@ -122,7 +122,7 @@ public final class Conversions { if (o == null) { return false; } else if (o instanceof Boolean) { - return ((Boolean)o).booleanValue(); + return (Boolean) o; } else { throw new ClassCastException(o.getClass().getName() + " can not be converted to boolean"); diff --git a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajc11CompilerAdapter.java b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajc11CompilerAdapter.java index a64c5131e..d74fa5134 100644 --- a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajc11CompilerAdapter.java +++ b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajc11CompilerAdapter.java @@ -79,7 +79,7 @@ public class Ajc11CompilerAdapter implements CompilerAdapter { if (null == javac) { throw new IllegalStateException("null javac"); } - if (!((Boolean) inSelfCall.get()).booleanValue() + if (!(Boolean) inSelfCall.get() && afterCleaningDirs()) { // if we are not re-calling ourself and we cleaned dirs, // then re-call javac to get the list of all source files. diff --git a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/compilers/Ajc.java b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/compilers/Ajc.java index 0242b4d58..2516a2ac5 100644 --- a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/compilers/Ajc.java +++ b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/compilers/Ajc.java @@ -91,11 +91,11 @@ public class Ajc extends DefaultCompilerAdapter { Project.MSG_WARN)); System.setOut(logstr); System.setErr(logstr); - return ((Integer)main.getMethod - ("compile", new Class[]{String[].class}).invoke - (main.newInstance(), new Object[]{ - removeUnsupported(cline, logstr) - })).intValue() == AJC_COMPILER_SUCCESS; + return (Integer) main.getMethod + ("compile", new Class[]{String[].class}).invoke + (main.newInstance(), new Object[]{ + removeUnsupported(cline, logstr) + }) == AJC_COMPILER_SUCCESS; } catch (Exception e) { if (e instanceof BuildException) { throw (BuildException)e; diff --git a/testing-drivers/src/test/java/org/aspectj/testing/drivers/Harness.java b/testing-drivers/src/test/java/org/aspectj/testing/drivers/Harness.java index 6c0a84fe9..55295568a 100644 --- a/testing-drivers/src/test/java/org/aspectj/testing/drivers/Harness.java +++ b/testing-drivers/src/test/java/org/aspectj/testing/drivers/Harness.java @@ -306,7 +306,7 @@ public class Harness { } Object value = result.status.getResult(); if ((value instanceof Boolean) - && !((Boolean) value).booleanValue()) { + && !(Boolean) value) { System.exit(-1); } } diff --git a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java index 0c5b6ddeb..38f85b2c9 100644 --- a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java +++ b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java @@ -201,7 +201,7 @@ public abstract class XMLBasedAjcTestCase extends AjcTestCase { if (clearTestAfterRun.isEmpty()) { return false; } - boolean result = clearTestAfterRun.peek().booleanValue(); + boolean result = clearTestAfterRun.peek(); if (pop) { clearTestAfterRun.pop(); } diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java index 6c8b2ba5f..7a5bff3df 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java @@ -1842,7 +1842,7 @@ public class CompilerRun implements IAjcRun { compilerOption, result); } - return result.booleanValue(); + return result; } } } // CompilerRun.Spec.CRSOptions diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/DirChanges.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/DirChanges.java index 95977aeee..e3e60e028 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/DirChanges.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/DirChanges.java @@ -59,7 +59,7 @@ public class DirChanges { static { long delay = 10l; try { - delay = Long.getLong(DELAY_NAME).longValue(); + delay = Long.getLong(DELAY_NAME); if ((delay > 40000) || (delay < 0)) { delay = 10l; } diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java index 16d1d6d19..28db821cb 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java @@ -267,7 +267,7 @@ public class FlatSuiteReader implements SFileReader.Maker { description.setLength(0); description.append((prefix + " " + suffix).trim()); try { - result.setBugId(Integer.valueOf(pr).intValue()); + result.setBugId(Integer.valueOf(pr)); } catch (NumberFormatException e) { throw new Error("unable to convert " + pr + " for " + result + " at " + lineReader); diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/ParseTestCase.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/ParseTestCase.java index ee07fe4f6..7aaa1767c 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/ParseTestCase.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/ParseTestCase.java @@ -106,7 +106,7 @@ public class ParseTestCase extends TestCase { AjcTest.Spec test = new AjcTest.Spec(); test.setDescription(title); test.setTestDirOffset(dir); - test.setBugId(Integer.valueOf(pr).intValue()); + test.setBugId(Integer.valueOf(pr)); test.setSourceLocation(sourceLocation); //AjcTest test = new AjcTest(title, dir, pr, sourceLocation); @@ -175,7 +175,7 @@ public class ParseTestCase extends TestCase { file = new File("XXX"); //XXX } - int line = Integer.valueOf(getAttributeString(child, "line")).intValue(); + int line = Integer.valueOf(getAttributeString(child, "line")); ISourceLocation sourceLocation = new SourceLocation(file, line, line, 0); diff --git a/testing/src/test/java/org/aspectj/testing/util/IntRange.java b/testing/src/test/java/org/aspectj/testing/util/IntRange.java index 1f44f69bd..4181e7018 100644 --- a/testing/src/test/java/org/aspectj/testing/util/IntRange.java +++ b/testing/src/test/java/org/aspectj/testing/util/IntRange.java @@ -82,7 +82,7 @@ public class IntRange implements IntValidator, ObjectChecker, Serializable { /** @return true if integer instanceof Integer with acceptable intValue */ public final boolean isValid(Object integer) { return ((integer instanceof Integer) - && (acceptInt(((Integer) integer).intValue()))); + && (acceptInt((Integer) integer))); } /** @return true if min <= value < max */ diff --git a/testing/src/test/java/org/aspectj/testing/util/ObjectChecker.java b/testing/src/test/java/org/aspectj/testing/util/ObjectChecker.java index 25985ae5e..e1f771b9d 100644 --- a/testing/src/test/java/org/aspectj/testing/util/ObjectChecker.java +++ b/testing/src/test/java/org/aspectj/testing/util/ObjectChecker.java @@ -34,7 +34,7 @@ public interface ObjectChecker { public static final ObjectChecker ANY_ZERO = new ObjectChecker() { public boolean isValid(Object input) { if (input instanceof Integer) { - return (0 == ((Integer) input).intValue()); + return (0 == (Integer) input); } else { return true; } diff --git a/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java b/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java index 2241904bd..969c8ecd8 100644 --- a/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java +++ b/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java @@ -294,7 +294,7 @@ public class SoftMessage implements IMessage { if (null != sourceLocation) { throw new IllegalStateException("cannot set line after creating source location"); } - this.line = Integer.valueOf(line).intValue(); + this.line = Integer.valueOf(line); SourceLocation.validLine(this.line); } diff --git a/testing/src/test/java/org/aspectj/testing/xml/SoftSourceLocation.java b/testing/src/test/java/org/aspectj/testing/xml/SoftSourceLocation.java index 17f5ae673..3895f302e 100644 --- a/testing/src/test/java/org/aspectj/testing/xml/SoftSourceLocation.java +++ b/testing/src/test/java/org/aspectj/testing/xml/SoftSourceLocation.java @@ -109,7 +109,7 @@ public class SoftSourceLocation implements ISourceLocation { } private int convert(String in) { - return Integer.valueOf(in).intValue(); + return Integer.valueOf(in); } public String getLocationContext() { diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc150/GenericsTests.java b/tests/src/test/java/org/aspectj/systemtest/ajc150/GenericsTests.java index 847f67149..76c956965 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc150/GenericsTests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc150/GenericsTests.java @@ -930,7 +930,7 @@ public class GenericsTests extends XMLBasedAjcTestCase { java.lang.reflect.Method isBridge = java.lang.reflect.Method.class.getMethod("isBridge", noparms); Boolean result = (Boolean) isBridge.invoke(m, new Object[0]); - return result.booleanValue(); + return result; } catch (Throwable t) { return false; } diff --git a/util/src/main/java/org/aspectj/util/LangUtil.java b/util/src/main/java/org/aspectj/util/LangUtil.java index 49a65df52..ffdc0b66e 100644 --- a/util/src/main/java/org/aspectj/util/LangUtil.java +++ b/util/src/main/java/org/aspectj/util/LangUtil.java @@ -332,7 +332,7 @@ public class LangUtil { try { String value = System.getProperty(propertyName); if (null != value) { - return Boolean.valueOf(value).booleanValue(); + return Boolean.valueOf(value); } } catch (Throwable t) { // default below