diff options
author | aclement <aclement> | 2005-11-16 15:59:15 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-11-16 15:59:15 +0000 |
commit | abb5d6c097d8c0ec8f33dc95342732855148bb18 (patch) | |
tree | 7898c0ffad8509a6aa3894f17449544b75522669 | |
parent | 887fab820369d0fdefd14ef7cffe66014c1e6843 (diff) | |
download | aspectj-abb5d6c097d8c0ec8f33dc95342732855148bb18.tar.gz aspectj-abb5d6c097d8c0ec8f33dc95342732855148bb18.zip |
next round of fixes for list bug reported by Alexandru.
-rw-r--r-- | tests/java5/generics/bugs/lists/case1/Bean.java (renamed from tests/java5/generics/bugs/lists/Bean.java) | 0 | ||||
-rw-r--r-- | tests/java5/generics/bugs/lists/case1/Identifiable.java (renamed from tests/java5/generics/bugs/lists/Identifiable.java) | 0 | ||||
-rw-r--r-- | tests/java5/generics/bugs/lists/case1/IdentifiableAspect.java (renamed from tests/java5/generics/bugs/lists/IdentifiableAspect.java) | 0 | ||||
-rw-r--r-- | tests/java5/generics/bugs/lists/case1/LongIdentifiable.java (renamed from tests/java5/generics/bugs/lists/LongIdentifiable.java) | 0 | ||||
-rw-r--r-- | tests/java5/generics/bugs/lists/case2/Bean.java | 3 | ||||
-rw-r--r-- | tests/java5/generics/bugs/lists/case2/Identifiable.java | 5 | ||||
-rw-r--r-- | tests/java5/generics/bugs/lists/case2/IdentifiableAspect.java | 20 | ||||
-rw-r--r-- | tests/java5/generics/bugs/lists/case2/LongIdentifiable.java | 2 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java | 5 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 8 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/ResolvedType.java | 4 |
11 files changed, 42 insertions, 5 deletions
diff --git a/tests/java5/generics/bugs/lists/Bean.java b/tests/java5/generics/bugs/lists/case1/Bean.java index b1260caea..b1260caea 100644 --- a/tests/java5/generics/bugs/lists/Bean.java +++ b/tests/java5/generics/bugs/lists/case1/Bean.java diff --git a/tests/java5/generics/bugs/lists/Identifiable.java b/tests/java5/generics/bugs/lists/case1/Identifiable.java index 645ee36de..645ee36de 100644 --- a/tests/java5/generics/bugs/lists/Identifiable.java +++ b/tests/java5/generics/bugs/lists/case1/Identifiable.java diff --git a/tests/java5/generics/bugs/lists/IdentifiableAspect.java b/tests/java5/generics/bugs/lists/case1/IdentifiableAspect.java index 32fe42390..32fe42390 100644 --- a/tests/java5/generics/bugs/lists/IdentifiableAspect.java +++ b/tests/java5/generics/bugs/lists/case1/IdentifiableAspect.java diff --git a/tests/java5/generics/bugs/lists/LongIdentifiable.java b/tests/java5/generics/bugs/lists/case1/LongIdentifiable.java index 37fa76252..37fa76252 100644 --- a/tests/java5/generics/bugs/lists/LongIdentifiable.java +++ b/tests/java5/generics/bugs/lists/case1/LongIdentifiable.java diff --git a/tests/java5/generics/bugs/lists/case2/Bean.java b/tests/java5/generics/bugs/lists/case2/Bean.java new file mode 100644 index 000000000..3415bed70 --- /dev/null +++ b/tests/java5/generics/bugs/lists/case2/Bean.java @@ -0,0 +1,3 @@ +public class Bean implements LongIdentifiable { + +} diff --git a/tests/java5/generics/bugs/lists/case2/Identifiable.java b/tests/java5/generics/bugs/lists/case2/Identifiable.java new file mode 100644 index 000000000..645ee36de --- /dev/null +++ b/tests/java5/generics/bugs/lists/case2/Identifiable.java @@ -0,0 +1,5 @@ +public interface Identifiable<T> { + T getId(); + + void setId(T t); +} diff --git a/tests/java5/generics/bugs/lists/case2/IdentifiableAspect.java b/tests/java5/generics/bugs/lists/case2/IdentifiableAspect.java new file mode 100644 index 000000000..bbf593657 --- /dev/null +++ b/tests/java5/generics/bugs/lists/case2/IdentifiableAspect.java @@ -0,0 +1,20 @@ +public aspect IdentifiableAspect { + declare parents: Bean implements LongIdentifiable; + + private Long LongIdentifiable.m_id; + + public Long LongIdentifiable.getId() { + return m_id; + } + + public void LongIdentifiable.setId(Long id) { + m_id= id; + } + + public static void main(String []argv) { + Bean b = new Bean(); + b.setId(37L); + long l = b.getId(); + if (l!=37L) throw new RuntimeException("id should be 37"); + } +} diff --git a/tests/java5/generics/bugs/lists/case2/LongIdentifiable.java b/tests/java5/generics/bugs/lists/case2/LongIdentifiable.java new file mode 100644 index 000000000..37fa76252 --- /dev/null +++ b/tests/java5/generics/bugs/lists/case2/LongIdentifiable.java @@ -0,0 +1,2 @@ +public interface LongIdentifiable extends Identifiable<Long> { +} diff --git a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java index a42f62f05..7d0865b5f 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java @@ -208,9 +208,8 @@ public class GenericsTests extends XMLBasedAjcTestCase { runTest("Compilation error on generic member introduction"); } - public void testGenericsOverrides() { - runTest("generics and ITD overrides"); - } + public void testGenericsOverrides_1() { runTest("generics and ITD overrides - 1"); } + public void testGenericsOverrides_2() { runTest("generics and ITD overrides - 2"); } public void testPR88606() { runTest("Parameterized types on introduced fields not correctly recognized"); diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index f84bcf8cf..545495004 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -191,7 +191,13 @@ </compile> </ajc-test> - <ajc-test dir="java5/generics/bugs/lists" title="generics and ITD overrides"> + <ajc-test dir="java5/generics/bugs/lists/case1" title="generics and ITD overrides - 1"> + <compile files="Identifiable.java,Bean.java,LongIdentifiable.java,IdentifiableAspect.java" options="-1.5"> + </compile> + <run class="IdentifiableAspect"/> + </ajc-test> + + <ajc-test dir="java5/generics/bugs/lists/case2" title="generics and ITD overrides - 2"> <compile files="Identifiable.java,Bean.java,LongIdentifiable.java,IdentifiableAspect.java" options="-1.5"> </compile> <run class="IdentifiableAspect"/> diff --git a/weaver/src/org/aspectj/weaver/ResolvedType.java b/weaver/src/org/aspectj/weaver/ResolvedType.java index 34a7b05e2..e4cbb5be7 100644 --- a/weaver/src/org/aspectj/weaver/ResolvedType.java +++ b/weaver/src/org/aspectj/weaver/ResolvedType.java @@ -1424,7 +1424,10 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl private boolean compareToExistingMembers(ConcreteTypeMunger munger, Iterator existingMembers) { ResolvedMember sig = munger.getSignature(); while (existingMembers.hasNext()) { + ResolvedMember existingMember = (ResolvedMember)existingMembers.next(); + // don't worry about clashing with bridge methods + if (existingMember.isBridgeMethod()) continue; //System.err.println("Comparing munger: "+sig+" with member "+existingMember); if (conflictingSignature(existingMember, munger.getSignature())) { //System.err.println("conflict: existingMember=" + existingMember + " typeMunger=" + munger); @@ -1501,7 +1504,6 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl } boolean incompatibleReturnTypes = false; - // In 1.5 mode, allow for covariance on return type if (world.isInJava5Mode() && parent.getKind()==Member.METHOD) { |