aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2022-04-11 14:17:43 -0700
committerGitHub <noreply@github.com>2022-04-11 14:17:43 -0700
commitcaa2c39be10775a8772a27eea8b9a673dd0bab8d (patch)
tree8b2cc534181f35bf47af99d96371cf6d4c160cc2
parent238af52f840946000bf102e7fde72a426de4a402 (diff)
parentb91a93f32673840b894e1c46604df400b2f4e7da (diff)
downloadaspectj-caa2c39be10775a8772a27eea8b9a673dd0bab8d.tar.gz
aspectj-caa2c39be10775a8772a27eea8b9a673dd0bab8d.zip
Merge pull request #131 from turbanoff/use_generics_ajdt.core
Update 'org.aspectj.ajdt.core' code to use generics
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java10
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompilerAdapter.java13
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java4
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverAdapter.java5
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java2
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java3
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java7
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java5
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java3
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java4
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java11
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java6
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java6
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java4
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java4
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java8
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java16
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java6
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java2
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java2
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AspectDeclaration.java4
21 files changed, 66 insertions, 59 deletions
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java
index a1560b07f..fe1097c9c 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java
@@ -342,7 +342,7 @@ public class BuildArgParser extends Main {
options.put(CompilerOptions.OPTION_SourceFileAttribute, CompilerOptions.GENERATE);
}
- private Collection collectSourceRootFiles(File dir) {
+ private Collection<File> collectSourceRootFiles(File dir) {
return Arrays.asList(FileUtil.listFiles(dir, FileUtil.aspectjSourceFileFilter));
}
@@ -383,7 +383,7 @@ public class BuildArgParser extends Main {
* in order to prevent wierd bootstrap issues (refer to bug#39959).
*/
public List getClasspath(AjcConfigParser parser) {
- List ret = new ArrayList();
+ List<String> ret = new ArrayList<>();
// if (parser.bootclasspath == null) {
// addClasspath(System.getProperty("sun.boot.class.path", ""), ret);
@@ -399,7 +399,7 @@ public class BuildArgParser extends Main {
if (parser.classpath == null) {
addClasspath(System.getProperty("java.class.path", ""), ret);
- List fixedList = new ArrayList();
+ List<String> fixedList = new ArrayList<>();
for (Object o : ret) {
String entry = (String) o;
if (!entry.endsWith("aspectjtools.jar")) {
@@ -419,7 +419,7 @@ public class BuildArgParser extends Main {
return checkedClasspaths;
}
- private void addExtDirs(String extdirs, List classpathCollector) {
+ private void addExtDirs(String extdirs, List<String> classpathCollector) {
StringTokenizer tokenizer = new StringTokenizer(extdirs, File.pathSeparator);
while (tokenizer.hasMoreTokens()) {
// classpathCollector.add(tokenizer.nextToken());
@@ -451,7 +451,7 @@ public class BuildArgParser extends Main {
private String modulepath = null;
private String modulesourcepath = null;
private String extdirs = null;
- private List unparsedArgs = new ArrayList();
+ private List<String> unparsedArgs = new ArrayList<>();
private AjBuildConfig buildConfig;
private IMessageHandler handler;
private String moduleInfoArgument;
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompilerAdapter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompilerAdapter.java
index 2f4aba23a..b56518dc9 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompilerAdapter.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompilerAdapter.java
@@ -33,6 +33,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
import org.aspectj.weaver.bcel.BcelWeaver;
import org.aspectj.weaver.bcel.BcelWorld;
+import org.aspectj.weaver.bcel.UnwovenClassFile;
/**
* @author colyer
@@ -65,7 +66,7 @@ public class AjCompilerAdapter extends AbstractCompilerAdapter {
private AjState incrementalCompilationState;
- List /* InterimResult */resultsPendingWeave = new ArrayList();
+ List<InterimCompilationResult> resultsPendingWeave = new ArrayList<>();
/**
* Create an adapter, and tell it everything it needs to now to drive the AspectJ parts of a compile cycle.
@@ -120,7 +121,7 @@ public class AjCompilerAdapter extends AbstractCompilerAdapter {
// the compilation lifecycle methods below are called in order as compilation progresses...
public void beforeCompiling(ICompilationUnit[] sourceUnits) {
- resultsPendingWeave = new ArrayList();
+ resultsPendingWeave = new ArrayList<>();
reportedErrors = false;
}
@@ -269,12 +270,12 @@ public class AjCompilerAdapter extends AbstractCompilerAdapter {
}
}
- private List getBinarySourcesFrom(Map binarySourceEntries) {
+ private List<InterimCompilationResult> getBinarySourcesFrom(Map<String, List<UnwovenClassFile>> binarySourceEntries) {
// Map is fileName |-> List<UnwovenClassFile>
- List ret = new ArrayList();
+ List<InterimCompilationResult> ret = new ArrayList<>();
for (Object o : binarySourceEntries.keySet()) {
String sourceFileName = (String) o;
- List unwovenClassFiles = (List) binarySourceEntries.get(sourceFileName);
+ List<UnwovenClassFile> unwovenClassFiles = binarySourceEntries.get(sourceFileName);
// XXX - see bugs 57432,58679 - final parameter on next call should be "compiler.options.maxProblemsPerUnit"
CompilationResult result = new CompilationResult(sourceFileName.toCharArray(), 0, 0, Integer.MAX_VALUE);
result.noSourceAvailable();
@@ -311,7 +312,7 @@ public class AjCompilerAdapter extends AbstractCompilerAdapter {
}
resultsPendingWeave.addAll(getBinarySourcesFrom(binarySourceSetForFullWeave));
} else {
- Map binarySourcesToAdd = binarySourceProvider.getBinarySourcesForThisWeave();
+ Map<String, List<UnwovenClassFile>> binarySourcesToAdd = binarySourceProvider.getBinarySourcesForThisWeave();
resultsPendingWeave.addAll(getBinarySourcesFrom(binarySourcesToAdd));
}
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java
index 2a0c99647..5792d994f 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java
@@ -227,7 +227,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter {
// TESTING
if (pipelineTesting) {
if (pipelineOutput == null) {
- pipelineOutput = new Hashtable();
+ pipelineOutput = new Hashtable<>();
}
pipelineOutput.put("filesContainingAspects", Integer.toString(toWaitFor));
StringBuilder order = new StringBuilder();
@@ -531,7 +531,7 @@ public class AjPipeliningCompilerAdapter extends AbstractCompilerAdapter {
}
resultsPendingWeave.addAll(getBinarySourcesFrom(binarySourceSetForFullWeave));
} else {
- Map binarySourcesToAdd = binarySourceProvider.getBinarySourcesForThisWeave();
+ Map<String, List<UnwovenClassFile>> binarySourcesToAdd = binarySourceProvider.getBinarySourcesForThisWeave();
resultsPendingWeave.addAll(getBinarySourcesFrom(binarySourcesToAdd));
}
}
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverAdapter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverAdapter.java
index f93882f49..8d7277524 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverAdapter.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverAdapter.java
@@ -17,6 +17,7 @@ import org.aspectj.asm.internal.CharOperation;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.IProgressListener;
import org.aspectj.bridge.MessageUtil;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ClassFile;
import org.aspectj.org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
import org.aspectj.weaver.IClassFileProvider;
import org.aspectj.weaver.IUnwovenClassFile;
@@ -30,7 +31,7 @@ import org.eclipse.core.runtime.OperationCanceledException;
public class WeaverAdapter implements IClassFileProvider, IWeaveRequestor, Iterator {
private final AbstractCompilerAdapter compilerAdapter;
- private Iterator resultIterator;
+ private Iterator<InterimCompilationResult> resultIterator;
private int classFileIndex = 0;
private InterimCompilationResult nowProcessing;
private InterimCompilationResult lastReturnedResult;
@@ -225,7 +226,7 @@ public class WeaverAdapter implements IClassFileProvider, IWeaveRequestor, Itera
compilerAdapter.acceptResult(result.result());
}
- private boolean removeFromMap(Map aMap, char[] key) {
+ private boolean removeFromMap(Map<char[], ClassFile> aMap, char[] key) {
// jdt uses char[] as a key in the hashtable, which is not very useful as equality is based on being
// the same array, not having the same content.
// String skey = new String(key);
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java
index af28231d8..951e33caa 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java
@@ -207,7 +207,7 @@ public class WeaverMessageHandler implements IMessageHandler {
return context;
}
- private IProblem[] buildSeeAlsoProblems(IProblem originalProblem, List sourceLocations, CompilationResult problemSource,
+ private IProblem[] buildSeeAlsoProblems(IProblem originalProblem, List<ISourceLocation> sourceLocations, CompilationResult problemSource,
boolean usedBinarySourceFileName) {
List<IProblem> ret = new ArrayList<>();
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java
index 279c389c1..4b1a628f9 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java
@@ -13,6 +13,7 @@ package org.aspectj.ajdt.internal.compiler.ast;
import java.util.ArrayList;
import java.util.List;
+import org.aspectj.org.eclipse.jdt.internal.compiler.IAttribute;
import org.aspectj.weaver.AjAttribute;
import org.aspectj.org.eclipse.jdt.internal.compiler.ClassFile;
import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
@@ -38,7 +39,7 @@ public class AjConstructorDeclaration extends ConstructorDeclaration {
*/
protected int generateInfoAttributes(ClassFile classFile) {
// add extra attributes into list then call 2-arg version of generateInfoAttributes...
- List extras = new ArrayList();
+ List<IAttribute> extras = new ArrayList<>();
addDeclarationStartLineAttribute(extras,classFile);
return classFile.generateMethodInfoAttributes(binding,extras);
}
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java
index 994eda80a..94f233333 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java
@@ -15,6 +15,7 @@ import java.util.List;
import org.aspectj.org.eclipse.jdt.internal.compiler.ClassFile;
import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
+import org.aspectj.org.eclipse.jdt.internal.compiler.IAttribute;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.weaver.AjAttribute;
@@ -27,7 +28,7 @@ import org.aspectj.weaver.AjAttribute;
*/
public class AjMethodDeclaration extends MethodDeclaration {
- private List attributes = null;
+ private List<IAttribute> attributes = null;
/**
* @param compilationResult
@@ -39,7 +40,7 @@ public class AjMethodDeclaration extends MethodDeclaration {
// general purpose hook to add an AjAttribute to this method
// used by @AspectJ visitor to add pointcut attribute to @Advice
protected void addAttribute(EclipseAttributeAdapter eaa) {
- if (attributes==null) attributes = new ArrayList();
+ if (attributes==null) attributes = new ArrayList<>();
attributes.add(eaa);
}
@@ -48,7 +49,7 @@ public class AjMethodDeclaration extends MethodDeclaration {
*/
protected int generateInfoAttributes(ClassFile classFile,boolean addAjSynthetic) {
// add extra attributes into list then call 2-arg version of generateInfoAttributes...
- List extras = (attributes==null?new ArrayList():attributes);
+ List<IAttribute> extras = (attributes==null?new ArrayList<>():attributes);
addDeclarationStartLineAttribute(extras,classFile);
if (addAjSynthetic) {
extras.add(new EclipseAttributeAdapter(new AjAttribute.AjSynthetic()));
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
index 4de7c57e0..cb8b82dc3 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
@@ -30,6 +30,7 @@ import org.aspectj.ajdt.internal.compiler.lookup.PrivilegedHandler;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ClassFile;
import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
+import org.aspectj.org.eclipse.jdt.internal.compiler.IAttribute;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Clinit;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration;
@@ -431,14 +432,14 @@ public class AspectDeclaration extends TypeDeclaration {
* methods are able to masquerade as any join point (a field set, field get or method call). The effective signature attribute
* is 'unwrapped' in BcelClassWeaver.matchInvokeInstruction()
*/
- private void generateMethod(ClassFile classFile, MethodBinding methodBinding, List additionalAttributes, BodyGenerator gen) {
+ private void generateMethod(ClassFile classFile, MethodBinding methodBinding, List<EclipseAttributeAdapter> additionalAttributes, BodyGenerator gen) {
// EclipseFactory world = EclipseFactory.fromScopeLookupEnvironment(this.scope);
classFile.generateMethodInfoHeader(methodBinding);
int methodAttributeOffset = classFile.contentsOffset;
int attributeNumber;
if (additionalAttributes != null) { // mini optimization
- List attrs = new ArrayList();
+ List<IAttribute> attrs = new ArrayList<>();
attrs.addAll(AstUtil.getAjSyntheticAttribute());
attrs.addAll(additionalAttributes);
attributeNumber = classFile.generateMethodInfoAttributes(methodBinding, attrs);
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java
index 8607626a5..e119a18b5 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java
@@ -17,6 +17,7 @@ import java.util.ArrayList;
import java.util.List;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.IAttribute;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Argument;
@@ -217,7 +218,7 @@ public class AstUtil {
}
public static List getAjSyntheticAttribute() {
- List ret = new ArrayList(1);
+ List<IAttribute> ret = new ArrayList<>(1);
ret.add(new EclipseAttributeAdapter(new AjAttribute.AjSynthetic()));
return ret;
}
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java
index 25df5deea..709fc1597 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java
@@ -74,9 +74,9 @@ public class DeclareDeclaration extends AjMethodDeclaration {
} else if (declareDecl instanceof DeclareParents) {
DeclareParents dp = (DeclareParents) declareDecl;
String childPattern = dp.getChild().toString();
- Collection parentPatterns = dp.getParents().getExactTypes();
+ Collection<UnresolvedType> parentPatterns = dp.getParents().getExactTypes();
StringBuilder parents = new StringBuilder();
- for (Iterator iter = parentPatterns.iterator(); iter.hasNext();) {
+ for (Iterator<UnresolvedType> iter = parentPatterns.iterator(); iter.hasNext();) {
UnresolvedType urt = ((UnresolvedType) iter.next());
parents.append(urt.getName());
if (iter.hasNext()) {
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java
index 75e0a20e3..3062cd227 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java
@@ -26,6 +26,7 @@ import org.aspectj.bridge.context.ContextToken;
import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ClassFile;
import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
+import org.aspectj.org.eclipse.jdt.internal.compiler.IAttribute;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ParameterizedQualifiedTypeReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference;
@@ -304,7 +305,7 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration {
Shadow.Kind kind,
boolean weaveBody)
{
- List l = new ArrayList(1);
+ List<IAttribute> l = new ArrayList<>(1);
l.add(new EclipseAttributeAdapter(
new AjAttribute.EffectiveSignatureAttribute(sig, kind, weaveBody)));
return l;
@@ -318,12 +319,12 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration {
@Override
protected int generateInfoAttributes(ClassFile classFile) {
- List l;
+ List<IAttribute> l;
Shadow.Kind kind = getShadowKindForBody();
if (kind != null) {
l = makeEffectiveSignatureAttribute(munger.getSignature(), kind, true);
} else {
- l = new ArrayList(0);
+ l = new ArrayList<>(0);
}
addDeclarationStartLineAttribute(l,classFile);
@@ -358,13 +359,13 @@ public abstract class InterTypeDeclaration extends AjMethodDeclaration {
if (onType instanceof ParameterizedSingleTypeReference) {
ParameterizedSingleTypeReference paramRef = (ParameterizedSingleTypeReference) onType;
TypeReference[] rb = paramRef.typeArguments;
- typeVariableAliases = new ArrayList();
+ typeVariableAliases = new ArrayList<>();
for (TypeReference typeReference : rb) {
typeVariableAliases.add(CharOperation.toString(typeReference.getTypeName()));
}
} else if (onType instanceof ParameterizedQualifiedTypeReference) {
ParameterizedQualifiedTypeReference paramRef = (ParameterizedQualifiedTypeReference) onType;
- typeVariableAliases = new ArrayList();
+ typeVariableAliases = new ArrayList<>();
for (int j = 0; j < paramRef.typeArguments.length; j++) {
TypeReference[] rb = paramRef.typeArguments[j];
for (int i = 0; rb!=null && i < rb.length; i++) {
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
index a6cc3c19f..f96fb3579 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
@@ -81,7 +81,7 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor {
// afterThrowingAdviceSig, aroundAdviceSig };
private final CompilationUnitDeclaration unit;
- private final Stack typeStack = new Stack();
+ private final Stack<TypeDeclaration> typeStack = new Stack<>();
private AspectJAnnotations ajAnnotations;
public ValidateAtAspectJAnnotationsVisitor(CompilationUnitDeclaration unit) {
@@ -365,8 +365,8 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor {
* @param arguments
* @return argument names (possibly empty)
*/
- private List toArgumentNames(Argument[] arguments) {
- List names = new ArrayList();
+ private List<String> toArgumentNames(Argument[] arguments) {
+ List<String> names = new ArrayList<>();
if (arguments == null) {
return names;
} else {
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
index 74ffa44d4..e8d99b4f9 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
@@ -115,7 +115,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
* interfaces targetted by ITDs that have to be implemented by accessing the topMostImplementor of the interface, yet the aspect
* where the ITD originated is not in the world
*/
- private final Map dangerousInterfaces = new HashMap();
+ private final Map<ResolvedType, String> dangerousInterfaces = new HashMap<>();
public AjLookupEnvironment(ITypeRequestor typeRequestor, CompilerOptions options, ProblemReporter problemReporter,
INameEnvironment nameEnvironment) {
@@ -700,7 +700,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
// dangerous interface -
// report a problem if it is.
for (Object o : dangerousInterfaces.entrySet()) {
- Map.Entry entry = (Map.Entry) o;
+ Map.Entry<ResolvedType, String> entry = (Map.Entry) o;
ResolvedType interfaceType = (ResolvedType) entry.getKey();
if (onType.isTopmostImplementor(interfaceType)) {
factory.showMessage(IMessage.ERROR, onType + ": " + entry.getValue(), onType.getSourceLocation(), null);
@@ -1413,7 +1413,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
}
}
- private final List pendingTypesToFinish = new ArrayList();
+ private final List<BinaryTypeBinding> pendingTypesToFinish = new ArrayList<>();
boolean inBinaryTypeCreationAndWeaving = false;
boolean processingTheQueue = false;
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java
index 163681fde..fd36f61fb 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java
@@ -38,7 +38,7 @@ import org.aspectj.weaver.World;
public class PrivilegedHandler implements IPrivilegedHandler {
private AspectDeclaration inAspect;
- private Map accessors = new HashMap();
+ private Map<ResolvedMember, Object> accessors = new HashMap<>();
public PrivilegedHandler(AspectDeclaration inAspect) {
this.inAspect = inAspect;
@@ -139,7 +139,7 @@ public class PrivilegedHandler implements IPrivilegedHandler {
}
public ResolvedMember[] getMembers() {
- Collection m = accessors.keySet();
+ Collection<ResolvedMember> m = accessors.keySet();
int len = m.size();
ResolvedMember[] ret = new ResolvedMember[len];
int index = 0;
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
index a6504a5fe..b1ae347ba 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
@@ -546,7 +546,7 @@ public class AjProblemReporter extends ProblemReporter {
} else {
weaverType = factory.fromEclipse(type.superclass());
}
- Set checked = new HashSet();
+ Set<ResolvedType> checked = new HashSet<>();
for (ConcreteTypeMunger m : weaverType.getInterTypeMungersIncludingSupers()) {
ResolvedType theAspect = m.getAspectType();
if (!checked.contains(theAspect)) {
@@ -561,7 +561,7 @@ public class AjProblemReporter extends ProblemReporter {
} else if (theAspect instanceof ReferenceType) {
// ResolvedMember rm = factory.makeResolvedMember(fieldDecl.binding);
String fname = new String(fieldDecl.name);
- Collection/* ResolvedMember */privvies = ((ReferenceType) theAspect).getPrivilegedAccesses();
+ Collection<ResolvedMember> privvies = ((ReferenceType) theAspect).getPrivilegedAccesses();
// On an incremental compile the information is in the bcel delegate
if (privvies != null) {
for (Object privvy : privvies) {
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
index 75f8c36cd..84569d4df 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
@@ -787,7 +787,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
model.setConfigFile(buildConfig.getConfigFile().getAbsolutePath());
kind = IProgramElement.Kind.FILE_LST;
}
- model.setRoot(new ProgramElement(structureModel, rootLabel, kind, new ArrayList()));
+ model.setRoot(new ProgramElement(structureModel, rootLabel, kind, new ArrayList<>()));
model.setFileMap(new HashMap<>());
// setStructureModel(model);
@@ -825,7 +825,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
/** init only on initial batch compile? no file-specific options */
private void initBcelWorld(IMessageHandler handler) throws IOException {
- List cp = buildConfig.getFullClasspath(); // pr145693
+ List<String> cp = buildConfig.getFullClasspath(); // pr145693
// buildConfig.getBootclasspath();
// cp.addAll(buildConfig.getClasspath());
BcelWorld bcelWorld = new BcelWorld(cp, handler, null);
@@ -1499,7 +1499,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
private void populateCompilerOptionsFromLintSettings(org.aspectj.org.eclipse.jdt.internal.compiler.Compiler forCompiler) {
BcelWorld world = this.state.getBcelWorld();
IMessage.Kind swallowedExceptionKind = world.getLint().swallowedExceptionInCatchBlock.getKind();
- Map optionsMap = new HashMap();
+ Map<String, String> optionsMap = new HashMap<>();
optionsMap.put(CompilerOptions.OPTION_ReportSwallowedExceptionInCatchBlock, swallowedExceptionKind == null ? "ignore"
: swallowedExceptionKind.toString());
forCompiler.options.set(optionsMap);
@@ -1545,7 +1545,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
sb.append("incrementally building ");
}
AjBuildConfig config = (AjBuildConfig) data;
- List classpath = config.getClasspath();
+ List<String> classpath = config.getClasspath();
sb.append("with classpath: ");
for (Object o : classpath) {
sb.append(o.toString());
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java
index 0c5f447b7..c36afd3ec 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java
@@ -125,7 +125,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
filename = new String(currCompilationResult.fileName);
lineseps = currCompilationResult.lineSeparatorPositions;
LangUtil.throwIaxIfNull(currCompilationResult, "result");
- stack = new Stack();
+ stack = new Stack<>();
packageDecl = null;
this.buildConfig = buildConfig;
internalBuild(cuDeclaration, structureModel);
@@ -171,7 +171,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
// -- remove duplicates before adding (XXX use them instead?)
if (addToNode != null && addToNode.getChildren() != null) {
- for (ListIterator itt = addToNode.getChildren().listIterator(); itt.hasNext();) {
+ for (ListIterator<IProgramElement> itt = addToNode.getChildren().listIterator(); itt.hasNext();) {
IProgramElement child = (IProgramElement) itt.next();
ISourceLocation childLoc = child.getSourceLocation();
if (null == childLoc) {
@@ -214,7 +214,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
}
}
if (sourceFolderNode == null) {
- sourceFolderNode = new ProgramElement(structureModel, sourceFolder, IProgramElement.Kind.SOURCE_FOLDER, new ArrayList());
+ sourceFolderNode = new ProgramElement(structureModel, sourceFolder, IProgramElement.Kind.SOURCE_FOLDER, new ArrayList<>());
root.addChild(sourceFolderNode);
}
return sourceFolderNode;
@@ -272,7 +272,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
}
if (pkgNode == null) {
// note packages themselves have no source location
- pkgNode = new ProgramElement(activeStructureModel, pkgName, IProgramElement.Kind.PACKAGE, new ArrayList());
+ pkgNode = new ProgramElement(activeStructureModel, pkgName, IProgramElement.Kind.PACKAGE, new ArrayList<>());
rootForSource.addChild(pkgNode);
}
addToNode = pkgNode;
@@ -531,7 +531,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
formatter.genLabelAndKind(methodDeclaration, peNode); // will set the
// name
genBytecodeInfo(methodDeclaration, peNode);
- List namedPointcuts = genNamedPointcuts(methodDeclaration);
+ List<ReferencePointcut> namedPointcuts = genNamedPointcuts(methodDeclaration);
// if (shouldAddUsesPointcut)
// addUsesPointcutRelationsForNode(peNode, namedPointcuts, methodDeclaration);
@@ -651,8 +651,8 @@ public class AsmHierarchyBuilder extends ASTVisitor {
* @param methodDeclaration
* @return all of the named pointcuts referenced by the PCD of this declaration
*/
- private List genNamedPointcuts(MethodDeclaration methodDeclaration) {
- List pointcuts = new ArrayList();
+ private List<ReferencePointcut> genNamedPointcuts(MethodDeclaration methodDeclaration) {
+ List<ReferencePointcut> pointcuts = new ArrayList<>();
if (methodDeclaration instanceof AdviceDeclaration) {
if (((AdviceDeclaration) methodDeclaration).pointcutDesignator != null) {
addAllNamed(((AdviceDeclaration) methodDeclaration).pointcutDesignator.getPointcut(), pointcuts);
@@ -670,7 +670,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
* @param pointcuts
* accumulator for named pointcuts
*/
- private void addAllNamed(Pointcut pointcut, List pointcuts) {
+ private void addAllNamed(Pointcut pointcut, List<ReferencePointcut> pointcuts) {
if (pointcut == null) {
return;
}
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java
index da30c8e1e..6435903c8 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java
@@ -98,7 +98,7 @@ public class AspectJBuilder extends JavaBuilder implements ICompilerAdapterFacto
* @see org.eclipse.jdt.internal.compiler.ICompilerAdapterFactory#getAdapter(org.eclipse.jdt.internal.compiler.Compiler)
*/
public ICompilerAdapter getAdapter(Compiler forCompiler) {
- Map javaOptions = forCompiler.options.getMap();
+ Map<String, String> javaOptions = forCompiler.options.getMap();
// TODO get aspectj options from project and add into map before...
AjCompilerOptions ajOptions = new AjCompilerOptions(javaOptions);
forCompiler.options = ajOptions;
@@ -171,7 +171,7 @@ public class AspectJBuilder extends JavaBuilder implements ICompilerAdapterFacto
private void setLintProperties(BcelWorld world, AjCompilerOptions options) {
Properties p = new Properties();
Lint lintSettings = world.getLint();
- Map map = options.getMap();
+ Map<String, String> map = options.getMap();
p.put(lintSettings.invalidAbsoluteTypeName.getName(), map.get(AjCompilerOptions.OPTION_ReportInvalidAbsoluteTypeName));
p.put(lintSettings.invalidWildcardTypeName.getName(), map.get(AjCompilerOptions.OPTION_ReportInvalidWildcardTypeName));
p.put(lintSettings.unresolvableMember.getName(), map.get(AjCompilerOptions.OPTION_ReportUnresolvableMember));
@@ -186,7 +186,7 @@ public class AspectJBuilder extends JavaBuilder implements ICompilerAdapterFacto
private static class UnwovenResultCollector implements IIntermediateResultsRequestor {
- private Collection results = new ArrayList();
+ private Collection<InterimCompilationResult> results = new ArrayList<>();
/*
* (non-Javadoc)
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java
index ed0b9aa69..2de9f358a 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java
@@ -41,7 +41,7 @@ public class EmacsStructureModelManager {
try {
// Set fileSet = StructureModelManager.INSTANCE.getStructureModel().getFileMap().entrySet();
- Set fileSet = model.getHierarchy().getFileMapEntrySet();
+ Set<Map.Entry<String, IProgramElement>> fileSet = model.getHierarchy().getFileMapEntrySet();
for (Object o : fileSet) {
IProgramElement peNode = (IProgramElement) ((Map.Entry) o).getValue();
dumpStructureToFile(peNode);
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java
index bf9bdd008..1a4f3ffef 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java
@@ -116,7 +116,7 @@ public class IncrementalStateManager {
}
CompilationResultDestinationManager outputManager = ajbc.getCompilationResultDestinationManager();
if (outputManager != null) {
- List outputDirs = outputManager.getAllOutputLocations();
+ List<File> outputDirs = outputManager.getAllOutputLocations();
for (Object o : outputDirs) {
File dir = (File) o;
if (dir.equals(location)) {
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AspectDeclaration.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AspectDeclaration.java
index a35c24b33..f71f1121f 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AspectDeclaration.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AspectDeclaration.java
@@ -209,10 +209,10 @@ public class AspectDeclaration extends AjTypeDeclaration {
public List getAdvice() {
// ajh02: method added
List bd = bodyDeclarations();
- List advice = new ArrayList();
+ List<AdviceDeclaration> advice = new ArrayList<>();
for (Object decl : bd) {
if (decl instanceof AdviceDeclaration) {
- advice.add(decl);
+ advice.add((AdviceDeclaration)decl);
}
}
return advice;