Community
Participate
Working Groups
If an aspect is declared with a package and uses the fully qualified name of a class inside that same package to inject fields or methods, the AJDT UI gives error messages and faulty auto-completions. Steps to reproduce: 1. Create an AspectJ Project in Eclipse 2. Create an empty class Baz inside of package foo.bar package foo.bar; public class Baz { public Baz() { } } 3. Create an aspect Baz_AJ inside of package foo.bar with the following content: package foo.bar; public aspect Baz_AJ { public int foo.bar.Baz.hi; } 4. Create class Qux and try to access Bar#hi using autocompletion: package foo.bar; public class Qux { public static void main(String[] args) { Baz b = new Baz(); b.<Ctrl+Space> (shows: "b.bar : int - Baz", expected: "b.hi : int - Baz") 4.1 Variant: manually access b.hi - causes an error marker to appear: "b.hi cannot be resolved or is not a field" package foo.bar; public class Qux { public static void main(String[] args) { Baz b = new Baz(); b.hi = 42; System.out.println(b.hi); } } Despite of the errors markers displayed, the "problems" view is not updated. Running the class Qux is possible and causes prints 42 on the console, as expected.
Yes, this is a reconciling error. It is not a compiler error. When performing reconciling (which is the basis for eager parsing and for content assist), AJDT translates the AspectJ buffer into a related Java buffer and passes that on to the Java reconciler. In this case, the buffer translation is not happening correctly. I will have a look at it, but I don't know if this will be able to get into 2.0.
This problem has to do with how we extract the name for an ITD when creating a mock JavaElement for it. In the past, AJDT erroneously assumed that the name would always be of the form <target>.<itd_name>, not <path.to.target>.<target>.<itd_name>. So, it is a small fix and it is working now. I just want to do a little more testing and I will commit.
Commited the fix with regression test. Will be available in next dev build.
should be fixed.