Bug 4923 - IJavaProject.getPackageFragmentRoots returns roots from other projects
Summary: IJavaProject.getPackageFragmentRoots returns roots from other projects
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-12 08:39 EDT by Martin Aeschlimann CLA
Modified: 2002-01-11 09:22 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.