Bug 4923

Summary: IJavaProject.getPackageFragmentRoots returns roots from other projects
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 2.0   
Target Milestone: 2.0 M1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Martin Aeschlimann CLA 2001-10-12 08:39:00 EDT
JavaDoc from IJavaProject.getPackageFragmentRoots states:
 * Returns all of the  package fragment roots contained in this
 * project, identified on this project's resolved classpath. The result
 * does not include package fragment roots in other projects referenced
 * on this project's classpath.

Currently, JAR optained from required projects are returned as well.
They should only be returned in getAllPackageFragmentRoots
Comment 1 Philipe Mulet CLA 2001-10-12 09:24:21 EDT
Need to revise current implementation
Comment 2 Philipe Mulet CLA 2001-10-23 09:02:42 EDT
Agreed, note that internal JARs of other projects where also answered amongst 
the package fragment roots. 

I am planning on only answering roots located inside the same project + 
external ones (which are referenced directly one the immediate classpath).

Would this be fine ?
Comment 3 Martin Aeschlimann CLA 2001-10-23 09:39:29 EDT
I think it should still return internal jars located in other projects.

The roots returned are the ones shown in the package view: Problem with not 
showing internal jars located in other projects is that you would not see them 
in the package view at all, if they are not also on the containing project's 
classpath.

What the JavaDoc says is ideal for the package view: all package fragment 
roots, except those optained from other projects (through a project-classpath 
entry).

As an addition: Could , as an additional specification, the roots be returned 
in the order how they appear in the classpath? 
Comment 4 Philipe Mulet CLA 2001-10-23 11:42:37 EDT
Agreed, we will do so, the point on internal JARs is real.
Comment 5 Philipe Mulet CLA 2001-11-01 14:06:39 EST
Fixed. Handles to exported roots are made in context of originating projects.