diff options
author | Andy Clement <andrew.clement@gmail.com> | 2012-08-24 15:45:53 -0700 |
---|---|---|
committer | Andy Clement <andrew.clement@gmail.com> | 2012-08-24 15:45:53 -0700 |
commit | 77d14748c35ced62f5c14f34389cb2bc942c410f (patch) | |
tree | d5894f18cb6794811ecf653bf6e3a2918c0a2c16 /org.aspectj.ajdt.core | |
parent | 55ebaa15305cc686c6ed5915ff1115071b3c80bd (diff) | |
download | aspectj-77d14748c35ced62f5c14f34389cb2bc942c410f.tar.gz aspectj-77d14748c35ced62f5c14f34389cb2bc942c410f.zip |
386888
Diffstat (limited to 'org.aspectj.ajdt.core')
2 files changed, 42 insertions, 37 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java index 64f10059e..22e8fdf0d 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java @@ -426,8 +426,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC } private void doPendingWeaves() { - for (Iterator i = pendingTypesToWeave.iterator(); i.hasNext();) { - SourceTypeBinding t = (SourceTypeBinding) i.next(); + for (SourceTypeBinding t: pendingTypesToWeave) { ContextToken tok = CompilationAndWeavingContext.enteringPhase( CompilationAndWeavingContext.WEAVING_INTERTYPE_DECLARATIONS, t.sourceName); weaveInterTypeDeclarations(t); @@ -862,10 +861,10 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC * sourceType and onType are the 'same type' - the former is the 'Eclipse' version and the latter is the 'Weaver' version. */ private void processTypeMungersFromExistingWeaverState(SourceTypeBinding sourceType, ResolvedType onType) { - Collection previouslyAppliedMungers = onType.getWeaverState().getTypeMungers(onType); + List<ConcreteTypeMunger> previouslyAppliedMungers = onType.getWeaverState().getTypeMungers(onType); - for (Iterator i = previouslyAppliedMungers.iterator(); i.hasNext();) { - ConcreteTypeMunger m = (ConcreteTypeMunger) i.next(); + for (Iterator<ConcreteTypeMunger> i = previouslyAppliedMungers.iterator(); i.hasNext();) { + ConcreteTypeMunger m = i.next(); EclipseTypeMunger munger = factory.makeEclipseTypeMunger(m); if (munger.munge(sourceType, onType)) { if (onType.isInterface() && munger.getMunger().needsAccessToTopmostImplementor()) { @@ -885,8 +884,8 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC ResolvedType resolvedSourceType = factory.fromEclipse(sourceType); List<ResolvedType> newParents = declareParents.findMatchingNewParents(resolvedSourceType, false); if (!newParents.isEmpty()) { - for (Iterator i = newParents.iterator(); i.hasNext();) { - ResolvedType parent = (ResolvedType) i.next(); + for (Iterator<ResolvedType> i = newParents.iterator(); i.hasNext();) { + ResolvedType parent = i.next(); if (dangerousInterfaces.containsKey(parent)) { ResolvedType onType = factory.fromEclipse(sourceType); factory.showMessage(IMessage.ERROR, onType + ": " + dangerousInterfaces.get(parent), @@ -919,7 +918,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC if ((bits & TagBits.AnnotationTargetMASK) == 0) { return ""; } - Set s = new HashSet(); + Set<String> s = new HashSet<String>(); if ((bits & TagBits.AnnotationForAnnotationType) != 0) { s.add("ANNOTATION_TYPE"); } @@ -946,8 +945,8 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC } StringBuffer sb = new StringBuffer(); sb.append("{"); - for (Iterator iter = s.iterator(); iter.hasNext();) { - String element = (String) iter.next(); + for (Iterator<String> iter = s.iterator(); iter.hasNext();) { + String element = iter.next(); sb.append(element); if (iter.hasNext()) { sb.append(","); @@ -1288,33 +1287,33 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC return (abits & (TagBits.AnnotationForAnnotationType | TagBits.AnnotationForType)) == 0; } - private void reportDeclareParentsMessage(WeaveMessage.WeaveMessageKind wmk, SourceTypeBinding sourceType, ResolvedType parent) { - if (!factory.getWorld().getMessageHandler().isIgnoring(IMessage.WEAVEINFO)) { - String filename = new String(sourceType.getFileName()); - - int takefrom = filename.lastIndexOf('/'); - if (takefrom == -1) { - takefrom = filename.lastIndexOf('\\'); - } - filename = filename.substring(takefrom + 1); - - factory.getWorld() - .getMessageHandler() - .handleMessage( - WeaveMessage.constructWeavingMessage(wmk, - new String[] { CharOperation.toString(sourceType.compoundName), filename, - parent.getClassName(), - getShortname(parent.getSourceLocation().getSourceFile().getPath()) })); - } - } - - private String getShortname(String path) { - int takefrom = path.lastIndexOf('/'); - if (takefrom == -1) { - takefrom = path.lastIndexOf('\\'); - } - return path.substring(takefrom + 1); - } +// private void reportDeclareParentsMessage(WeaveMessage.WeaveMessageKind wmk, SourceTypeBinding sourceType, ResolvedType parent) { +// if (!factory.getWorld().getMessageHandler().isIgnoring(IMessage.WEAVEINFO)) { +// String filename = new String(sourceType.getFileName()); +// +// int takefrom = filename.lastIndexOf('/'); +// if (takefrom == -1) { +// takefrom = filename.lastIndexOf('\\'); +// } +// filename = filename.substring(takefrom + 1); +// +// factory.getWorld() +// .getMessageHandler() +// .handleMessage( +// WeaveMessage.constructWeavingMessage(wmk, +// new String[] { CharOperation.toString(sourceType.compoundName), filename, +// parent.getClassName(), +// getShortname(parent.getSourceLocation().getSourceFile().getPath()) })); +// } +// } + +// private String getShortname(String path) { +// int takefrom = path.lastIndexOf('/'); +// if (takefrom == -1) { +// takefrom = path.lastIndexOf('\\'); +// } +// return path.substring(takefrom + 1); +// } private void addParent(SourceTypeBinding sourceType, ResolvedType parent) { ReferenceBinding parentBinding = (ReferenceBinding) factory.makeTypeBinding(parent); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java index 154746fa4..14f667a2b 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java @@ -482,6 +482,12 @@ public class EclipseFactory { } } } + for (ConcreteTypeMunger ctm: ret) { + ResolvedMember rm = ctm.getSignature(); + if (rm!=null) { + rm.resolve(this.getWorld()); + } + } finishedTypeMungers = ret; } |