Community
Participate
Working Groups
Take --------- import java.util.List; public interface Foo { <T> List<T> createList(); } --------- and --------- import java.util.ArrayList; import java.util.List; public aspect FooAspect { public <T> List<T> Foo.createList() { return new ArrayList<T>(); } } --------- compiling with ajc results in the following error message: FooAspect.aj:9 [error] can't override java.util.List<T> Foo.createList() with java.util.List<T> Foo.createList() return types don't match public <T> List<T> Foo.createList() { ^^^^^^^^^^ Foo.java:7 [error] can't override java.util.List<T> Foo.createList() with java.util.List<T> Foo.createList() return types don't match <T> List<T> createList(); ^^^^^^^^^^ 2 errors
the bug occurs because in ResolvedType.checkLegalOverride the return types List<T> for the parent and List<T> for the child are difference instances of a ReferenceType and == equality is used to determine compatibility.
Normally I let the owner change the severity of reported bugs. We stumble about this bug very regularly and as a workaround we have to change our interfaces to make some progress. Changes that later have to be taken back. We sometimes forgot to work around this bug and unfortunately ajdt can sometimes under unknown circumstances compile similar code. But compiling the whole project containing similar code like this with maven2 regularly fails. So we find missing workaraounds very late. When is the next maintainance release for ajdt and apsectj scheduled? I have the feeling its "conference time" and work on both is suspended. This bug seems easy to fix. Can it be incorporated in the next release? So I would like the severity raised to critical.
fix committed
Thank you very much!
fix available in latest AJ dev build.
Changing OS from Mac OS to Mac OS X as per bug 185991