From d94ade722d8a1212aa7c9b6ca90fe47a637e2c7a Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 20 Aug 2008 22:06:53 +0000 Subject: [PATCH] 222648: testcode --- tests/bugs162/pr222648/DataAspect.aj | 11 +++++ tests/bugs162/pr222648/DataInterface.java | 9 ++++ tests/bugs162/pr222648/Foo.java | 12 +++++ tests/bugs162/pr222648/FooBase.java | 9 ++++ tests/bugs162/pr222648/Marker.java | 7 +++ tests/bugs162/pr222648/Resource.java | 5 ++ tests/bugs162/pr222648/X.java | 46 +++++++++++++++++++ .../systemtest/ajc162/Ajc162Tests.java | 2 + .../org/aspectj/systemtest/ajc162/ajc162.xml | 8 ++++ 9 files changed, 109 insertions(+) create mode 100644 tests/bugs162/pr222648/DataAspect.aj create mode 100644 tests/bugs162/pr222648/DataInterface.java create mode 100644 tests/bugs162/pr222648/Foo.java create mode 100644 tests/bugs162/pr222648/FooBase.java create mode 100644 tests/bugs162/pr222648/Marker.java create mode 100644 tests/bugs162/pr222648/Resource.java create mode 100644 tests/bugs162/pr222648/X.java diff --git a/tests/bugs162/pr222648/DataAspect.aj b/tests/bugs162/pr222648/DataAspect.aj new file mode 100644 index 000000000..e1e10803e --- /dev/null +++ b/tests/bugs162/pr222648/DataAspect.aj @@ -0,0 +1,11 @@ +package test; + +public aspect DataAspect +{ + + public CONTENT Marker.getContent() + { + return null; + } + +} diff --git a/tests/bugs162/pr222648/DataInterface.java b/tests/bugs162/pr222648/DataInterface.java new file mode 100644 index 000000000..76e9b18f8 --- /dev/null +++ b/tests/bugs162/pr222648/DataInterface.java @@ -0,0 +1,9 @@ +package test; + +public interface DataInterface +{ + + public CONTENT getContent(); + + +} diff --git a/tests/bugs162/pr222648/Foo.java b/tests/bugs162/pr222648/Foo.java new file mode 100644 index 000000000..ebf2b0b8b --- /dev/null +++ b/tests/bugs162/pr222648/Foo.java @@ -0,0 +1,12 @@ +package test; + + + +abstract public class Foo +< CONTENT extends Resource, + DATA extends DataInterface +> + extends + test.FooBase +{ +} diff --git a/tests/bugs162/pr222648/FooBase.java b/tests/bugs162/pr222648/FooBase.java new file mode 100644 index 000000000..e9e0e25b6 --- /dev/null +++ b/tests/bugs162/pr222648/FooBase.java @@ -0,0 +1,9 @@ +package test; + + + +abstract public class FooBase +{ +} + + diff --git a/tests/bugs162/pr222648/Marker.java b/tests/bugs162/pr222648/Marker.java new file mode 100644 index 000000000..46718e03e --- /dev/null +++ b/tests/bugs162/pr222648/Marker.java @@ -0,0 +1,7 @@ +package test; + + + +public interface Marker extends DataInterface +{ +} diff --git a/tests/bugs162/pr222648/Resource.java b/tests/bugs162/pr222648/Resource.java new file mode 100644 index 000000000..1a7f938be --- /dev/null +++ b/tests/bugs162/pr222648/Resource.java @@ -0,0 +1,5 @@ +package test; + +public interface Resource +{ +} diff --git a/tests/bugs162/pr222648/X.java b/tests/bugs162/pr222648/X.java new file mode 100644 index 000000000..451dd70a0 --- /dev/null +++ b/tests/bugs162/pr222648/X.java @@ -0,0 +1,46 @@ + +abstract class FooBase { } + +// Existence of this line causes the exception +abstract class Foo > extends FooBase
{ } + +interface DataInterface { + public CC getContent(); // ERR +} + +interface Marker extends DataInterface { } + +interface Resource { } + +aspect DataAspect { + // Intertype declaration onto Marker that shares the variable + public C Marker.getContent() { // ERR + return null; + } +} + +/* +X.java:7 [error] can't override CC DataInterface.getContent() with CC Marker.getContent() return types don't match +public CC getContent(); + ^^^^^^^^^ + +X.java:16 [error] can't override CC DataInterface.getContent() with CC Marker.getContent() return types don't match +public C Marker.getContent() { + ^^^^^^^^^ + +1. Two errors because both source locations reported (stupid code) + + +when failing: +parent: CC DataInterface.getContent() +child : CC Marker.getContent() +Both return types are type variable reference types (different ones though) +parent: TypeVar CC extends Resource +child : CC + +So parent discovered the wrong type variable (the wrong CC). +parent is a ResolvedMemberImpl +it is considered an 'existingmember' of the type DataInterface + +*/ + diff --git a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java index 3f970fb2f..c4578effe 100644 --- a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java @@ -19,6 +19,8 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // AspectJ1.6.2 + public void testGenericItdsOverrides_pr222648() { runTest("generic itds - overrides"); } + public void testGenericItdsOverrides_pr222648_2() { runTest("generic itds - overrides - 2"); } public void testItdCallingGenericMethod_pr145391() { runTest("itd calling generic method");} public void testItdCallingGenericMethod_pr145391_2() { runTest("itd calling generic method - 2");} public void testPublicPointcut_pr239539() { runTest("public pointcut"); } diff --git a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml index 7699dcc38..17f3ec741 100644 --- a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml +++ b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml @@ -3,6 +3,14 @@ + + + + + + + + -- 2.39.5