Browse Source

tests and fix for pr105181, implicit cast of itd field type on return from generic collection erroneously casting to aspect (declaring) type, not owning (target) type.

tags/preDefaultReweavable
acolyer 19 years ago
parent
commit
776613eebf

+ 5
- 0
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeFieldBinding.java View File

@@ -112,5 +112,10 @@ public class InterTypeFieldBinding extends FieldBinding {
public ReferenceBinding getTargetType() {
return targetType;
}
// overrides ITD'd method in FieldBinding...
public ReferenceBinding getOwningClass() {
return targetType;
}

}

BIN
org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip View File


BIN
org.eclipse.jdt.core/jdtcore-for-aspectj.jar View File


+ 10
- 0
tests/bugs150/pr105181.aj View File

@@ -21,4 +21,14 @@ public class pr105181 {
*/
Foo f2 = source.get(0).foo();
}
public void worksOK() {
java.util.Vector<Bar> source = new java.util.Vector<Bar>();
source.add(new Bar());
Bar b = source.get(0).field;
}
}

class Bar {
Bar field;
}

+ 4
- 7
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java View File

@@ -405,7 +405,7 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testSuperCallInITD() {
runTest("super call in ITD");
}
public void testSuperCallInITDPart2() {
runTest("super call in ITD - part 2");
}
@@ -426,12 +426,9 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("cant find type error with generic return type or parameter");
}

// currently failing...
// public void testNoVerifyErrorOnGenericCollectionMemberAccess() {
// runTest("no verify error on generic collection member access");
// }
public void testNoVerifyErrorOnGenericCollectionMemberAccess() {
runTest("no verify error on generic collection member access");
}
// helper methods.....

Loading…
Cancel
Save