Bug 299830 - Referencing ITDs in non-AJ projects
Summary: Referencing ITDs in non-AJ projects
Status: NEW
Alias: None
Product: AJDT
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.0.0   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-15 17:21 EST by Andrew Eisenberg CLA
Modified: 2014-06-06 08:58 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Eisenberg CLA 2010-01-15 17:21:34 EST
As described here:

http://forum.springsource.org/showthread.php?t=83147

There is a user who is referencing an ITD in a non-Java project and the Java editor is not recognizing this reference, giving a spurious error.

Early on when starting with JDT weaving, we made the decision to disable all effects of JDT weaving when working outside of Java projects.  This was to ensure that Java users would see 0 impact on their code when JDT Weaving is enabled.  However, perhaps we are being too strict and Java projects that reference AJ projects should include ITD capability where appropriate (eg- content assist and reconciles).
Comment 1 Andrew Eisenberg CLA 2010-01-29 14:23:20 EST
The simplest solution here is to add the AJ nature to a project, but not change anything else.  This will mark the project as 'interesting' from the point of view of the weaving service, but will not force any new compiler or builder on the Java project.

Perhaps the best solution is to support this in the UI by perhaps adding a new context menu command that adds the nature w/o adding the builder.
Comment 2 Andrew Clement CLA 2010-01-29 16:26:48 EST
interesting solution.  On one hand sounds scary but I can't think of any downsides. Able to automate it if the trigger is adding/removing a project dependency?
Comment 3 Andrew Clement CLA 2010-03-09 18:59:41 EST
discussion on the mailing list about this issue, from Sharon Gorman:

1) I do not really have an issue with making it and AspectJ project.   In my opinion this is fine as a work around.  My issue was that even when I did this, the code assist did not work correctly.  
2) Once I removed and re-added my project dependency via eclipse, rather than relying on m2eclipse, the code assist started working.  I note that the m2Eclipse adds the dependency under "Maven Dependencies" on the Package explorer whereas once I re-added it it appears under the "Web App Libraries".
Comment 4 Andrew Eisenberg CLA 2010-03-10 00:46:19 EST
For a detailed description of the workaround see:
http://contraptionsforprogramming.blogspot.com/2010/03/intertype-declaration-support-in-java.html

As described in comment 1, this should be supported in the UI.
Comment 5 Andrew Clement CLA 2010-03-10 11:38:45 EST
After thinking on it some more, i am starting to think addition of the nature is probably still only a temporary workaround.  Even if it was done automatically, it is going to show up as something quirky in your pure java projects - I wouldn't want to see it in mine really, and I know what it is doing.  It will show up when committing projects into repos and worse when someone else is sync'ing/extracting a project, they'll see this odd thing that apparently has no business being there.
And perhaps sometime later you remove the dependency on the AJ project, you are left with this 'thing' in your .project file (unless we are doing the necessary analysis of project dependencies, which if we were:)

The trigger for offering ITD completion in a pure-java project is whether it has a dependency in some fashion to an AJ project.  I think that is something we could compute once then maintain as project dependencies are changed in eclipse - does this detail really have to manifest in the project as a real setting?
Comment 6 Andrew Eisenberg CLA 2010-09-01 15:41:27 EDT
*** Bug 324240 has been marked as a duplicate of this bug. ***
Comment 7 Christopher Smith CLA 2014-06-06 08:58:26 EDT
I'm attempting to use Roo-generated getters and setters from a Groovy project, and AspectJ and Groovy simply will not play nice together in Eclipse. The dupe discussed a fix for 3.6, but I'm on Kepler, and I'm still getting the same behavior. Any chance of necro-bumping this bug?