]> source.dussan.org Git - aspectj.git/commitdiff
Update 'org.aspectj.ajdt.core' code to use generics 131/head
authorAndrey Turbanov <turbanoff@gmail.com>
Sun, 27 Feb 2022 21:07:01 +0000 (00:07 +0300)
committerAndrey Turbanov <turbanoff@gmail.com>
Sun, 27 Feb 2022 21:07:01 +0000 (00:07 +0300)
21 files changed:
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompilerAdapter.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverAdapter.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java
org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AspectDeclaration.java

index a1560b07fa69164fb200613297205fb987eb0da9..fe1097c9c12aa8ae08ed4956ca22ec4d91aa0217 100644 (file)
@@ -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;
index 2f4aba23ae37606bcd90f2c2f977581ffff5928a..b56518dc9e6b022b7d2fb32831565425085fc32b 100644 (file)
@@ -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));
                }
 
index 2a0c99647443c6919c9034f2ccd9857c1f939afa..5792d994f7f3d578d037e0652f1eb09e3093a1fc 100644 (file)
@@ -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));
                }
        }
index f93882f490fbe5f5c804394cdefea5532cd99221..8d72775242c5676fbdc96ba671f76754d91dda9f 100644 (file)
@@ -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);
index af28231d86472a4fa5609b35b00220ccb24ef9c6..951e33caac51fdbf5b30fdab966760c174227fa0 100644 (file)
@@ -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<>();
 
index 279c389c182b9d514ba79f4008657aaf7dada7ad..4b1a628f9c20cc57cf9d742ea2f3263100da526c 100644 (file)
@@ -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);
        }
index 994eda80afc78bec071d7a9a961bc579f62a9048..94f2333334490bbe39be989a8ded538d47dd27b6 100644 (file)
@@ -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()));
index 4de7c57e01709794565d35458e3bbc2811071c3e..cb8b82dc3665656cd5e87d5a8108945e206f05c3 100644 (file)
@@ -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);
index 8607626a50c5cd994c3fd82446eae9c13514c502..e119a18b577297a822a7b2867b3c890c582e6c37 100644 (file)
@@ -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;
        }
index 25df5deea5499b628e07c96f9b9dcf87be056034..709fc1597bd790a662c42e80178d2567a7ee8512 100644 (file)
@@ -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()) {
index 75e0a20e399737db252a60a19d1ae2833580ac85..3062cd22720cd5da0ce92b5816c2c9f7056da9c0 100644 (file)
@@ -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++) {
index a6cc3c19fdd5c1dfcd9a57648e3b18285b0bfba4..f96fb3579187de5da6e1146e7fc6ef2da779a903 100644 (file)
@@ -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 {
index 74ffa44d4538b95ba1039119dae9a5508e8ba752..e8d99b4f9f101908fc099e8c1f266c2e7bf81ffa 100644 (file)
@@ -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;
 
index 163681fde4a2a5a3f05acab10f6968b78d72c8a2..fd36f61fb35b5b33c16bd7f213f7707a1c0a6a19 100644 (file)
@@ -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;
index a6504a5fe8e11dfc4671b6d88f73f2f459c6b800..b1ae347bac2db3d3e1f080441040d2b4f16a4197 100644 (file)
@@ -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) {
index 301839e1f6aaa0e4d69c607ee5a7f9ce13275c28..d8d1350d7a82ce4e884fa818197cab0c0845bb21 100644 (file)
@@ -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);
@@ -1492,7 +1492,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);
@@ -1538,7 +1538,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());
index 0c5f447b73dc911f834d99a89ab3d879a3e163ad..c36afd3ece4076992c780eff225756aa2b369d27 100644 (file)
@@ -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;
                }
index da30c8e1e0e9a7bec9fa15350db5ae548dfb0b16..6435903c8db8e3f9efa29b930eff386bc41945e3 100644 (file)
@@ -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)
index ed0b9aa69dd178fac85b1f13287fdacd04e7ca01..2de9f358a0d38a39e60b48ebc2a2a34561bd59a4 100644 (file)
@@ -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);
index bf9bdd008eb53d821c1f318f29747ad382c59a34..1a4f3ffef742294e855b9cab282c70ba2769b77d 100644 (file)
@@ -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)) {
index a35c24b333f94adabbe8238b97738540e797232b..f71f1121fcf000f414059df3f33d2cabf6c7fc76 100644 (file)
@@ -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;