Browse Source

Merge pull request #131 from turbanoff/use_generics_ajdt.core

Update 'org.aspectj.ajdt.core' code to use generics
tags/V1_9_19
Andy Clement 2 years ago
parent
commit
caa2c39be1
No account linked to committer's email address
21 changed files with 66 additions and 59 deletions
  1. 5
    5
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java
  2. 7
    6
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompilerAdapter.java
  3. 2
    2
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java
  4. 3
    2
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverAdapter.java
  5. 1
    1
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java
  6. 2
    1
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java
  7. 4
    3
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java
  8. 3
    2
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
  9. 2
    1
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java
  10. 2
    2
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java
  11. 6
    5
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java
  12. 3
    3
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java
  13. 3
    3
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
  14. 2
    2
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java
  15. 2
    2
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
  16. 4
    4
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
  17. 8
    8
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java
  18. 3
    3
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java
  19. 1
    1
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java
  20. 1
    1
      org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java
  21. 2
    2
      org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AspectDeclaration.java

+ 5
- 5
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/ajc/BuildArgParser.java View 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;

+ 7
- 6
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjCompilerAdapter.java View 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));
}


+ 2
- 2
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/AjPipeliningCompilerAdapter.java View 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));
}
}

+ 3
- 2
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverAdapter.java View 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);

+ 1
- 1
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/WeaverMessageHandler.java View 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<>();


+ 2
- 1
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjConstructorDeclaration.java View 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);
}

+ 4
- 3
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AjMethodDeclaration.java View 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()));

+ 3
- 2
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java View 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);

+ 2
- 1
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/AstUtil.java View 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;
}

+ 2
- 2
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/DeclareDeclaration.java View 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()) {

+ 6
- 5
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/InterTypeDeclaration.java View 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++) {

+ 3
- 3
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java View 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 {

+ 3
- 3
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java View 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;


+ 2
- 2
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/PrivilegedHandler.java View 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;

+ 2
- 2
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java View 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) {

+ 4
- 4
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java View 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);
@@ -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());

+ 8
- 8
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java View 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;
}

+ 3
- 3
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AspectJBuilder.java View 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)

+ 1
- 1
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/EmacsStructureModelManager.java View 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);

+ 1
- 1
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/IncrementalStateManager.java View 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)) {

+ 2
- 2
org.aspectj.ajdt.core/src/main/java/org/aspectj/org/eclipse/jdt/core/dom/AspectDeclaration.java View 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;

Loading…
Cancel
Save