aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2006-01-24 16:47:42 +0000
committeraclement <aclement>2006-01-24 16:47:42 +0000
commita4bd19d25597a31e1b76cc5fc188c3112bf0f5ff (patch)
tree2b474bb2631c9bbaf5d0d8cc2ffeab3e61575692
parentd916002f3d0ba392915ec323ff7ae189a5bdb474 (diff)
downloadaspectj-a4bd19d25597a31e1b76cc5fc188c3112bf0f5ff.tar.gz
aspectj-a4bd19d25597a31e1b76cc5fc188c3112bf0f5ff.zip
test and fix for 124999
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java7
-rw-r--r--tests/bugs151/pr124999.aj27
-rw-r--r--tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java1
-rw-r--r--tests/src/org/aspectj/systemtest/ajc151/ajc151.xml5
4 files changed, 39 insertions, 1 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java
index 1a310d980..657b3b520 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java
@@ -40,6 +40,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ArrayBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.VariableBinding;
@@ -169,7 +170,11 @@ public class AccessForInlineVisitor extends ASTVisitor {
makePublic(receiverType); //???
if (isPublic(binding)) return binding;
if (binding instanceof InterTypeMethodBinding) return binding;
-
+
+ if (binding instanceof ParameterizedMethodBinding) { // pr124999
+ binding = binding.original();
+ }
+
ResolvedMember m = null;
if (binding.isPrivate() && binding.declaringClass != inAspect.binding) {
// does this always mean that the aspect is an inner aspect of the bindings
diff --git a/tests/bugs151/pr124999.aj b/tests/bugs151/pr124999.aj
new file mode 100644
index 000000000..42ae02f15
--- /dev/null
+++ b/tests/bugs151/pr124999.aj
@@ -0,0 +1,27 @@
+abstract aspect GenericInheritedMethod<T> {
+
+ protected T getSomething() {
+ return null;
+ }
+
+}
+
+
+aspect pr124999 extends GenericInheritedMethod<Integer> {
+
+ // Runtime Error
+ void around() : execution(void someMethod()) {
+ System.out.println(getSomething());
+ }
+
+ public static void main(String[] args) {
+ new C().someMethod();
+ }
+
+
+}
+
+
+class C {
+ public void someMethod() { }
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java
index a163d396f..6e872e4e0 100644
--- a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java
@@ -26,6 +26,7 @@ public class Ajc151Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testDifferentNumbersofTVars_pr124803_2() { runTest("generics and different numbers of type variables - classes");}
public void testParameterizedCollectionFieldMatching_pr124808() { runTest("parameterized collection fields matched via pointcut");}
public void testGenericAspectsAndAnnotations_pr124654() { runTest("generic aspects and annotations");}
+ public void testCallInheritedGenericMethod_pr124999() { runTest("calling inherited generic method from around advice");}
/////////////////////////////////////////
public static Test suite() {
diff --git a/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml b/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml
index c04af9174..74dfa3e5b 100644
--- a/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml
+++ b/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml
@@ -54,6 +54,11 @@
</run>
</ajc-test>
+ <ajc-test dir="bugs151" title="calling inherited generic method from around advice">
+ <compile files="pr124999.aj" options="-1.5"/>
+ <run class="pr124999"/>
+ </ajc-test>
+
<ajc-test dir="bugs151/pr124654" title="generic aspects and annotations">
<compile files="GenericAnnotation.java,TestSubAspect.java" options="-1.5"/>
<run class="TestSubAspect">