summaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2004-08-09 10:26:53 +0000
committeraclement <aclement>2004-08-09 10:26:53 +0000
commit851da68a07bcbfac4414fadc1b9f3bc02fa810a5 (patch)
tree8774e959f018037db9891f447e4f7070c0cc8a71 /weaver
parent299d24a82619057d3746db391afb238c213d56e5 (diff)
downloadaspectj-851da68a07bcbfac4414fadc1b9f3bc02fa810a5.tar.gz
aspectj-851da68a07bcbfac4414fadc1b9f3bc02fa810a5.zip
Fix for Bug 71377: Cannot advise private method call in around advice
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
index b25d10aa6..3185300fa 100644
--- a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
+++ b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
@@ -645,7 +645,22 @@ public final class LazyClassGen {
if (ret != null) return ret;
int modifiers = Modifier.STATIC | Modifier.FINAL;
- if (getType().isInterface()) {
+
+ // XXX - Do we ever inline before or after advice? If we do, then we
+ // better include them in the check below. (or just change it to
+ // shadow.getEnclosingMethod().getCanInline())
+
+ // If the enclosing method is around advice, we could inline the join point
+ // that has led to this shadow. If we do that then the TJP we are creating
+ // here must be PUBLIC so it is visible to the type in which the
+ // advice is inlined. (PR71377)
+ LazyMethodGen encMethod = shadow.getEnclosingMethod();
+ boolean shadowIsInAroundAdvice = false;
+ if (encMethod!=null && encMethod.getName().startsWith(NameMangler.PREFIX+"around")) {
+ shadowIsInAroundAdvice = true;
+ }
+
+ if (getType().isInterface() || shadowIsInAroundAdvice) {
modifiers |= Modifier.PUBLIC;
}
else {