Community
Participate
Working Groups
Build RC3 1. Create Java project 'P' 2. Add 'test.jar' (attached to this bug report) as external jar 3. Edit its source attachement to add also 'test.jar' 4. Open Type... p/X.class Observe: The source src/p/X.java is not found for p/X.class
Created attachment 4313 [details] test.jar
That was supposed to work... Olivier, pls investigate.
Setting the rootpath by editing the .classpath file doesn't work either. This used to work in 2.0
The problem was during the computation of the first level package names. I didn't check that the entry was a .class file name. Then the src/p/X.java was considered as an entry and src was considered as a first level package name. Then the computed root path was always "". I have a fix for it. I will attach the patch to this PR.
Created attachment 4319 [details] Apply this patch on SourceMapper.java Select the SourceMapper compilation unit and apply the above patch. It should fix your problem. All existing attach source tests are still green.
This should be a RC4 fix. It can be considered as a regression since 2.0.
*** Bug 35510 has been marked as a duplicate of this bug. ***
Olivier - in patch, are you sure you can reuse existing root path set ? + if (this.rootPaths == null) { + this.rootPaths = new HashSet(); + } Shouldn't it be cleared when reused ?
Candidating for RC4
+1
The roots are computed only once. As far as I know the source mapper is created only once when a source is attached to a root. Therefore the rootPaths should not be reinitialized if a root has been specified in the constructor, otherwise you need to initialize the set.
Ok, sounds good then.
Released for integration
Verified.