From 851da68a07bcbfac4414fadc1b9f3bc02fa810a5 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 9 Aug 2004 10:26:53 +0000 Subject: Fix for Bug 71377: Cannot advise private method call in around advice --- weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'weaver') 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 { -- cgit v1.2.3