summaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-09-02 14:38:11 +0000
committeracolyer <acolyer>2005-09-02 14:38:11 +0000
commitb17ff4ed2d55ec24f1f1a6f3fe70ffd91ac18e62 (patch)
tree1a81ea166acb33fd033592a43e0ed503509116eb /weaver
parente29ca524955b2112bbf63e740ca71516c13fbb4c (diff)
downloadaspectj-b17ff4ed2d55ec24f1f1a6f3fe70ffd91ac18e62.tar.gz
aspectj-b17ff4ed2d55ec24f1f1a6f3fe70ffd91ac18e62.zip
second part of test and fix for pr102212 - synchronized itdm on interfaces generate synchronized members for implementing classes, but not for the interface itself.
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java11
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java4
2 files changed, 15 insertions, 0 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
index 114b6560c..e677685ed 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
@@ -716,6 +716,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
ResolvedMember interMethodDispatcher = munger.getInterMethodDispatcher(aspectType);
LazyClassGen gen = weaver.getLazyClassGen();
+ boolean mungingInterface = gen.isInterface();
ResolvedType onType = weaver.getWorld().resolve(unMangledInterMethod.getDeclaringType(),munger.getSourceLocation());
if (onType.isRawType()) onType = onType.getGenericType();
@@ -738,6 +739,11 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
LazyMethodGen mg = makeMethodGen(gen, mangledInterMethod);
+ if (mungingInterface) {
+ // we want the modifiers of the ITD to be used for all *implementors* of the
+ // interface, but the method itself we add to the interface must be public abstract
+ mg.setAccessFlags(Modifier.PUBLIC | Modifier.ABSTRACT);
+ }
// pr98901
// For copying the annotations across, we have to discover the real member in the aspect
@@ -829,6 +835,11 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
AjcMemberMaker.interMethod(unMangledInterMethod, aspectType, false);
LazyMethodGen mg = makeMethodGen(gen, mangledInterMethod);
+ if (mungingInterface) {
+ // we want the modifiers of the ITD to be used for all *implementors* of the
+ // interface, but the method itself we add to the interface must be public abstract
+ mg.setAccessFlags(Modifier.PUBLIC | Modifier.ABSTRACT);
+ }
Type[] paramTypes = BcelWorld.makeBcelTypes(mangledInterMethod.getParameterTypes());
Type returnType = BcelWorld.makeBcelType(mangledInterMethod.getReturnType());
diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java
index cb31e7a36..f74306851 100644
--- a/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java
+++ b/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java
@@ -782,6 +782,10 @@ public final class LazyMethodGen {
public int getAccessFlags() {
return accessFlags;
}
+
+ public void setAccessFlags(int newFlags) {
+ this.accessFlags = newFlags;
+ }
public Type[] getArgumentTypes() {
initialize();