diff options
author | Andy Clement <aclement@vmware.com> | 2012-03-19 13:42:20 -0700 |
---|---|---|
committer | Andy Clement <aclement@vmware.com> | 2012-03-19 13:42:20 -0700 |
commit | afae1fc59a4d857b1e19f282b7a38fe061afe738 (patch) | |
tree | 8708048b4d94d484fe07f7c7677eb372ffdcbaf4 /org.aspectj.matcher | |
parent | 1c0f36ea2026aff22afd9c9d22782db8233c8b95 (diff) | |
download | aspectj-afae1fc59a4d857b1e19f282b7a38fe061afe738.tar.gz aspectj-afae1fc59a4d857b1e19f282b7a38fe061afe738.zip |
invokedynamic tidyup - handle calling getClassname on itinvokedynamic
Diffstat (limited to 'org.aspectj.matcher')
-rw-r--r-- | org.aspectj.matcher/src/org/aspectj/weaver/AjcMemberMaker.java | 9 | ||||
-rw-r--r-- | org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java | 32 |
2 files changed, 10 insertions, 31 deletions
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/AjcMemberMaker.java b/org.aspectj.matcher/src/org/aspectj/weaver/AjcMemberMaker.java index fa3ff3379..8874dcd03 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/AjcMemberMaker.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/AjcMemberMaker.java @@ -486,12 +486,9 @@ public class AjcMemberMaker { * This field goes on top-most implementers of the interface the field is declared onto */ public static ResolvedMember interFieldInterfaceField(ResolvedMember field, UnresolvedType onClass, UnresolvedType aspectType) { -// return new ResolvedMemberImpl(Member.FIELD, onClass, makePublicNonFinal(field.getModifiers()), field.getReturnType(), -// NameMangler.interFieldInterfaceField(aspectType, field.getDeclaringType(), field.getName()), UnresolvedType.NONE, -// UnresolvedType.NONE); - - // TODO what about non public fields, can you have those? - return interFieldClassField(field,aspectType,true); + return new ResolvedMemberImpl(Member.FIELD, onClass, makePublicNonFinal(field.getModifiers()), field.getReturnType(), + NameMangler.interFieldInterfaceField(aspectType, field.getDeclaringType(), field.getName()), UnresolvedType.NONE, + UnresolvedType.NONE); } /** diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java index 0bba33032..7b904778f 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java @@ -674,8 +674,8 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl return false; } - if (m1.getKind() == Member.FIELD && m1.getDeclaringType().equals(m2.getDeclaringType())) { - return true ; + if (m1.getKind() == Member.FIELD) { + return m1.getDeclaringType().equals(m2.getDeclaringType()); } else if (m1.getKind() == Member.POINTCUT) { return true; } @@ -1735,13 +1735,12 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl } } - boolean needsAdding = true; - boolean needsToBeAddedEarlier = false; // now compare to existingMungers for (Iterator<ConcreteTypeMunger> i = interTypeMungers.iterator(); i.hasNext();) { ConcreteTypeMunger existingMunger = i.next(); if (conflictingSignature(existingMunger.getSignature(), munger.getSignature())) { - // System.err.println("match " + munger + " with " + existingMunger); + // System.err.println("match " + munger + " with " + + // existingMunger); if (isVisible(munger.getSignature().getModifiers(), munger.getAspectType(), existingMunger.getAspectType())) { // System.err.println(" is visible"); int c = compareMemberPrecedence(sig, existingMunger.getSignature()); @@ -1752,22 +1751,11 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl if (c < 0) { // the existing munger dominates the new munger checkLegalOverride(munger.getSignature(), existingMunger.getSignature(), 0x11, null); - needsAdding = false; -// return; - if (munger.getSignature().getKind()==Member.FIELD && - munger.getSignature().getDeclaringType().resolve(world).isInterface()) { - needsAdding=true; - } - break; + return; } else if (c > 0) { // the new munger dominates the existing one checkLegalOverride(existingMunger.getSignature(), munger.getSignature(), 0x11, null); - if (munger.getSignature().getKind()==Member.FIELD && - munger.getSignature().getDeclaringType().resolve(world).isInterface()) { - needsToBeAddedEarlier = true; - } else { - i.remove(); - } + i.remove(); break; } else { interTypeConflictError(munger, existingMunger); @@ -1781,13 +1769,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl // we are adding the parameterized form of the ITD to the list of // mungers. Within it, the munger knows the original declared // signature for the ITD so it can be retrieved. - if (needsAdding) { - if (!needsToBeAddedEarlier) { - interTypeMungers.add(munger); - } else { - interTypeMungers.add(0,munger); - } - } + interTypeMungers.add(munger); } /** |