Bug 72969 - Referenced projects in main project get changed to /bin
Summary: Referenced projects in main project get changed to /bin
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: Core (show other bugs)
Version: 1.2.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Helen Beeken CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-31 10:56 EDT by Arco Oost CLA
Modified: 2004-09-08 06:28 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arco Oost CLA 2004-08-31 10:56:07 EDT
Using AJDT 1.1.12
When I reference other projects in my current project, after some time the class
path gets changed. Project references disappear and directory entries to the bin
directories of those project appear.

e.g. I have a project Persistence which contains the persistence aspects for our
applications, and which is used in all other applications. At first I will see
in .classpath:

<classpathentry kind="src" path="/Persistence"/>

after a while, it changes to:

<classpathentry kind="lib" path="/Persistence/lib"/>

This only happens in projects with an AspectJ nature, not in those with a Java
nature.
Comment 1 Helen Beeken CLA 2004-09-01 03:34:04 EDT
Hi Arco,

In your comment you mentioned that 

"after a while it changes to 
<classpathentry kind="lib" path="/Persistence/lib"/>"

Have you set the output directory of Persistence to be Persistence/lib?

If so, then this is working as designed. Whenever projects have a project 
dependency on an AspectJ project, this project dependency is changed to be a 
classfolder dependency. Therefore, the .classpath entry will be changed as you 
are seeing.

Thanks, Helen

Comment 2 Arco Oost CLA 2004-09-01 04:13:38 EDT
Sorry, I have mistakenly put /lib in my report, it should have been Persistence/bin.
Comment 3 Helen Beeken CLA 2004-09-01 04:21:55 EDT
In which case, this is working as designed.
Comment 4 Arco Oost CLA 2004-09-02 04:03:55 EDT
The problem is, that in versions up to AJDT 1.1.10 the project reference stayed
in place.
In 1.1.12, if I select the project as part of the build path in the projects
tab, after a while, the project reference disappears from the projecs tab, and
an entry only containing the bin directory appears in the libraries tab. The
projects continue to build, but stuff like finding references spanning multiple
projects doesn't work anymore. The only way to get the functionality back, is to
go to the properties dialog, and set the references again. The problem then is
of course that shortly thereafter the reference is gone again.
Comment 5 Helen Beeken CLA 2004-09-02 04:14:54 EDT
Can you go into more detail about "stuff like finding references spanning 
multiple projects doesn't work anymore"? If possible, can you give me a 
specific scenario? Fixes have gone into this area recently which will be 
included in the 1.1.13 release, so I would like to know if what you're seeing 
has already been fixed, or whether it's another scenario which needs to be 
addressed before 1.1.13. 

Thanks, Helen
Comment 6 Arco Oost CLA 2004-09-02 06:20:43 EDT
When I try to find references for a class or method in my Persistence project,
using menu Search->References->Workspace, I will find references to all
locations in the projects that reference the Persistence project, as long as the
Persistence project is referenced on the Projects-tab of the build path. If it
is only referenced through the classpath, I will only find references within the
Persistence project itself. 

The same goes for refactorings. If I rename a method while the project is
referenced "properly", all references will be renamed. Otherwise only the
references in the project itself are renamed, and I get compilation errors in
the referencing projects.

Arco Oost
Comment 7 Helen Beeken CLA 2004-09-08 06:28:49 EDT
This has raised an interesting point, namely that when project dependencies 
are kept then we get many feature for free. One example is the problem 
reported here. Changing to classfolder dependencies breaks many of these 
features. In particular, regarding the references issue raised here, the same 
behaviour occurs between two java projects where one has a class folder 
dependency on another. 

Looking back over the reasons why we switched the dependencies to class folder 
dependencies it seems that the nicest way to deal with this is to keep project 
dependencies as they are defined originally by the user (and consequently pick 
up the nice features for free) BUT look at creating a state.dat file which is 
meaningful for the AJ project and which the JavaBuilder understands (this is 
the root of all the problems).

I've therefore backed out the code which changes the dependencies so now 
project dependencies are preserved and the problem reported here is no longer 
an issue.

To cover the investigation/work on the state.dat file I've raised AJDT bug 
number 73435.