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 6eab96f150..b53ef29170 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 @@ -1886,8 +1886,8 @@ private static class TimeCollector { long typeCount; long perJoinpointCount; long perTypes; - Map joinpointsPerPointcut = new HashMap<>(); - Map timePerPointcut = new HashMap<>(); + final Map joinpointsPerPointcut; + final Map timePerPointcut; Map fastMatchTimesPerPointcut = new HashMap<>(); Map fastMatchTypesPerPointcut = new HashMap<>(); diff --git a/runtime/src/main/java/org/aspectj/internal/lang/reflect/PointcutImpl.java b/runtime/src/main/java/org/aspectj/internal/lang/reflect/PointcutImpl.java index a2e1a674ef..7fc0963254 100644 --- a/runtime/src/main/java/org/aspectj/internal/lang/reflect/PointcutImpl.java +++ b/runtime/src/main/java/org/aspectj/internal/lang/reflect/PointcutImpl.java @@ -29,7 +29,7 @@ public class PointcutImpl implements Pointcut { private final PointcutExpression pc; private final Method baseMethod; private final AjType declaringType; - private String[] parameterNames = new String[0]; + private final String[] parameterNames; protected PointcutImpl(String name, String pc, Method method, AjType declaringType, String pNames) { this.name = name; diff --git a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java index 650fdc4e58..05911218a4 100644 --- a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java +++ b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java @@ -1226,9 +1226,8 @@ protected void setupOptions() { } protected File zipDirectory(File dir) { - File tempDir = new File("."); try { - tempDir = File.createTempFile("AjcTest", ".tmp"); + File tempDir = File.createTempFile("AjcTest", ".tmp"); tempDir.mkdirs(); tempDir.deleteOnExit(); // XXX remove zip explicitly.. } catch (IOException e) { diff --git a/util/src/main/java/org/aspectj/util/FileUtil.java b/util/src/main/java/org/aspectj/util/FileUtil.java index c572e59505..dbb4cc9993 100644 --- a/util/src/main/java/org/aspectj/util/FileUtil.java +++ b/util/src/main/java/org/aspectj/util/FileUtil.java @@ -78,8 +78,6 @@ public String toString() { // } // }; - final static int[] INT_RA = new int[0]; - /** accept all files */ public static final FileFilter ALL = new FileFilter() { public boolean accept(File f) { diff --git a/util/src/main/java/org/aspectj/util/GenericSignature.java b/util/src/main/java/org/aspectj/util/GenericSignature.java index 3ac8787712..227fb48ed5 100644 --- a/util/src/main/java/org/aspectj/util/GenericSignature.java +++ b/util/src/main/java/org/aspectj/util/GenericSignature.java @@ -39,9 +39,9 @@ public String toString() { public static class MethodTypeSignature { public FormalTypeParameter[] formalTypeParameters = FormalTypeParameter.NONE; - public TypeSignature[] parameters = new TypeSignature[0]; + public final TypeSignature[] parameters; public TypeSignature returnType; - public FieldTypeSignature[] throwsSignatures = new FieldTypeSignature[0]; + public final FieldTypeSignature[] throwsSignatures; public MethodTypeSignature(FormalTypeParameter[] aFormalParameterList, TypeSignature[] aParameterList, TypeSignature aReturnType, FieldTypeSignature[] aThrowsSignatureList) {