diff options
author | aclement <aclement> | 2010-07-14 21:03:31 +0000 |
---|---|---|
committer | aclement <aclement> | 2010-07-14 21:03:31 +0000 |
commit | 8a156a38d994a9de5bb65e29b78ef00cd8b66be9 (patch) | |
tree | 7b7eef99130672332cdebccd10543035479e6ed4 /weaver | |
parent | 499ab8f9709d5c0e9f99b0247d0989e441dee4bc (diff) | |
download | aspectj-8a156a38d994a9de5bb65e29b78ef00cd8b66be9.tar.gz aspectj-8a156a38d994a9de5bb65e29b78ef00cd8b66be9.zip |
generics
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelWorld.java | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java b/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java index d9d0ab071..766c3bfa0 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelWorld.java @@ -192,10 +192,11 @@ public class BcelWorld extends World implements Repository { } else { boolean runtimeTest = advice.hasDynamicTests(); String joinPointDescription = shadow.toString(); - msg = WeaveMessage.constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_ADVISES, new String[] { joinPointDescription, - advisedType, beautifyLocation(shadow.getSourceLocation()), description, advisingType, - beautifyLocation(munger.getSourceLocation()), (runtimeTest ? " [with runtime test]" : "") }, advisedType, - advisingType); + msg = WeaveMessage + .constructWeavingMessage(WeaveMessage.WEAVEMESSAGE_ADVISES, + new String[] { joinPointDescription, advisedType, beautifyLocation(shadow.getSourceLocation()), + description, advisingType, beautifyLocation(munger.getSourceLocation()), + (runtimeTest ? " [with runtime test]" : "") }, advisedType, advisingType); // Boolean.toString(runtimeTest)}); } getMessageHandler().handleMessage(msg); @@ -451,8 +452,8 @@ public class BcelWorld extends World implements Repository { if (jc.isGeneric() && isInJava5Mode()) { nameTypeX = ReferenceType.fromTypeX(UnresolvedType.forRawTypeName(jc.getClassName()), this); ret = buildBcelDelegate(nameTypeX, jc, artificial, true); - ReferenceType genericRefType = new ReferenceType(UnresolvedType.forGenericTypeSignature(signature, ret - .getDeclaredGenericSignature()), this); + ReferenceType genericRefType = new ReferenceType(UnresolvedType.forGenericTypeSignature(signature, + ret.getDeclaredGenericSignature()), this); nameTypeX.setDelegate(ret); genericRefType.setDelegate(ret); nameTypeX.setGenericType(genericRefType); @@ -488,8 +489,8 @@ public class BcelWorld extends World implements Repository { if (jc.isGeneric() && isInJava5Mode()) { nameTypeX = ReferenceType.fromTypeX(UnresolvedType.forRawTypeName(jc.getClassName()), this); ret = buildBcelDelegate(nameTypeX, jc, artificial, true); - ReferenceType genericRefType = new ReferenceType(UnresolvedType.forGenericTypeSignature(signature, ret - .getDeclaredGenericSignature()), this); + ReferenceType genericRefType = new ReferenceType(UnresolvedType.forGenericTypeSignature(signature, + ret.getDeclaredGenericSignature()), this); nameTypeX.setDelegate(ret); genericRefType.setDelegate(ret); nameTypeX.setGenericType(genericRefType); @@ -528,8 +529,8 @@ public class BcelWorld extends World implements Repository { public static Member makeFieldJoinPointSignature(LazyClassGen cg, FieldInstruction fi) { ConstantPool cpg = cg.getConstantPool(); return MemberImpl.field(fi.getClassName(cpg), - (fi.opcode == Constants.GETSTATIC || fi.opcode == Constants.PUTSTATIC) ? Modifier.STATIC : 0, fi.getName(cpg), fi - .getSignature(cpg)); + (fi.opcode == Constants.GETSTATIC || fi.opcode == Constants.PUTSTATIC) ? Modifier.STATIC : 0, fi.getName(cpg), + fi.getSignature(cpg)); } public Member makeJoinPointSignatureFromMethod(LazyMethodGen mg, MemberKind kind) { @@ -539,8 +540,8 @@ public class BcelWorld extends World implements Repository { if (mg.getEnclosingClass().isInterface()) { mods |= Modifier.INTERFACE; } - return new ResolvedMemberImpl(kind, UnresolvedType.forName(mg.getClassName()), mods, fromBcel(mg.getReturnType()), mg - .getName(), fromBcel(mg.getArgumentTypes())); + return new ResolvedMemberImpl(kind, UnresolvedType.forName(mg.getClassName()), mods, fromBcel(mg.getReturnType()), + mg.getName(), fromBcel(mg.getArgumentTypes())); } else { return ret; } @@ -730,13 +731,12 @@ public class BcelWorld extends World implements Repository { */ private boolean applyDeclareParents(DeclareParents p, ResolvedType onType) { boolean didSomething = false; - List newParents = p.findMatchingNewParents(onType, true); + List<ResolvedType> newParents = p.findMatchingNewParents(onType, true); if (!newParents.isEmpty()) { didSomething = true; BcelObjectType classType = BcelWorld.getBcelObjectType(onType); // System.err.println("need to do declare parents for: " + onType); - for (Iterator j = newParents.iterator(); j.hasNext();) { - ResolvedType newParent = (ResolvedType) j.next(); + for (ResolvedType newParent : newParents) { // We set it here so that the imminent matching for ITDs can // succeed - we @@ -827,8 +827,7 @@ public class BcelWorld extends World implements Repository { } // Still first pass - apply all dec @type mungers - for (Iterator i = getCrosscuttingMembersSet().getDeclareAnnotationOnTypes().iterator(); i.hasNext();) { - DeclareAnnotation decA = (DeclareAnnotation) i.next(); + for (DeclareAnnotation decA : getCrosscuttingMembersSet().getDeclareAnnotationOnTypes()) { boolean typeChanged = applyDeclareAtType(decA, onType, true); if (typeChanged) { anAnnotationChangeOccurred = true; |