Community
Participate
Working Groups
To reproduce the bug. Use Eclipse 3.3 and the AJDT 1.5.2 and 1.5.3 (dev build), and open the attached source as an AJDT project I'm pretty sure this is a bug because AJDT 1.5.0 produces no error on the same code. can't determine implemented interfaces of missing type dstm2.factory.ofree.Adapter$Getter when weaving type dstm2.factory.ofree.Adapter when weaving classes when weaving when batch building BuildConfig[/home/charlesz/eclipse/dstm] #Files=64 [Xlint:cantFindType] dstm/src/dstm2/factory/ofree Adapter.java Unknown 1212674178104 30172
this is an AspectJ issue.
I cant see any attached source Charles?
Created attachment 103785 [details] An AJDT project that recreates the bug
yikes that is some exciting generics!
Looks like it might be a base JDT compiler bug. Here is the simple case: a/Adapter.java --- package a; public interface Adapter<T> { interface Setter<V> {} public <V> Setter<V> makeSetter(); } --- a/b/Adapter.java --- package a.b; public class Adapter<T> implements a.Adapter<T> { public <V> Adapter.Setter<V> makeSetter() { return new Adapter.Setter<V>() {}; } } --- On compilation the generic signature of the inner type a.b.Adapter$1 (representing the type returned by the makeSetter method) should be: Ljava/lang/Object;La/Adapter$Setter<TV>; but when using the AspectJ compiler the package name is wrong and it becomes: Ljava/lang/Object;La/b/Adapter$Setter<TV>; and so that leads to a missing type message. I just created a pure Java project in eclipse 3.3.2 - and this was broken, it generated the wrong signature.
also broken in eclipse 3.4rc1
I raised it as JDT bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=235921 I implemented a fix that seems to work but will let those guys determine if it is a good change or not. In the interim I will probably commit my change to our tree so that Charles can compile his app.
My fix for this is committed - it will be in the next dev build - hopefully tomorrow. If you need a quick workaround, change the name of either your interface or implementation, so they aren't both called Adapter - or qualify the reference to Setter/Getter in the implementation class with the package name of the adapter interface ( public pkg.Adapter.Setter makeSetter(...)). I might review the change based on what the JDT guys say but AspectJ now compiles your application just fine.