Summary: | Weaving error: can't determine implemented interfaces | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | charles <czhang> | ||||
Component: | Compiler | Assignee: | AJDT-inbox <AJDT-inbox> | ||||
Status: | RESOLVED FIXED | QA Contact: | |||||
Severity: | blocker | ||||||
Priority: | P3 | CC: | aclement | ||||
Version: | DEVELOPMENT | ||||||
Target Milestone: | 1.6.1 | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
charles
2008-06-05 10:06:48 EDT
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. |