Community
Participate
Working Groups
Scenario: Create a Java class with an ITD that declares two additional methods for that class (in my case, with the use of Roo). Create a compile error unrelated to that ITD in that class (e.g. missing import). Result: - The editor area shows two errors, one for the missing import, and one for a call to the ITD-declared methods, "undefined method". - The Problems view only shows the root cause error, which is the missing import. - Code completion for the ITD-declared methods does not work anymore. Expected result: - The editor area should show the same result as the Problems view, which is only the error related to the root cause, the missing import. - Code completion should still work for the ITD methods. As the Problems view seems to be able to deal with this, I suspect that this has something to do with AJDT, not the AspectJ compiler? Example to reproduce this: DEMONSTRATE.JAVA import org.springframework.roo.addon.javabean.RooJavaBean; @RooJavaBean public class Demonstrate { @NotNull private String myField; public void demo() { this.getMyField(); } } DEMONSTRATE_ROO_JAVABEAN.AJ import Demonstrate; privileged aspect Demonstrate_Roo_JavaBean { public String Demonstrate.getMyField() { return this.myField; } public void Demonstrate.setMyField(String myField) { this.myField = myField; } }
Created attachment 220760 [details] Attempt to reproduce error Here is a project that I used to try to reproduce the bug you are reporting. Unfortunately, in this project, everything behaves as you would expect (ie- there is no extra error in the file). Can you attach a similar kind of project that does have the problem? It may be something to do with packages or something else that is not entirely intuitive.
And, indeed. I move the classes from the default package and I can now reproduce the problem.
Apologies. I spoke too soon. I did an incremental build of the class and the behavior remains the same as before (ie- still cannot reproduce).
Created attachment 220764 [details] Screenshot of sample in Juno I downloaded your example and imported it into my Eclipse, I still get the described behaviour, both in default package and in a non-default package. To make sure this is not just an issue of my older version, I also tested in Juno (see screenshot). Downloaded Juno for Java EE from eclipse.org, installed AJDT for Juno from the market place, imported your project. (Had to remove a project dependency from the build path to a project that wasn't included?) Did a "Clean" build, to be sure. I also switched the JRE to Java 7, to exclude that possibility, same result.
Comment on attachment 220764 [details] Screenshot of sample in Juno Right. Now I see it. I have made some changes since the 2.2.0 release and it looks like one of the changes inadvertently fixed this problem. I reverted back to 2.2.0 and I now see the error. Apologies for not checking this out sooner, but it looks like the problem is fixed in head. If you update to the latest from: http://download.eclipse.org/tools/ajdt/42/dev/update/ You should see this as fixed.
Confirmed, retest successful with the head. That's great, this error potentially led to a lot of error markers in the editor, very confusing without the problems view. > You can close this bug then.
Thanks for getting back to us. Please raise more bugs and feature requests for anything else you find.