Bug 25039 - Non-existing package fragment roots should not be openable
Summary: Non-existing package fragment roots should not be openable
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: 2.1 M3   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-18 07:10 EDT by Philipe Mulet CLA
Modified: 2002-10-21 04:50 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2002-10-18 07:10:14 EDT
Build 20021016

The spec claims that non-existing elements cannot be opened, however the 
implementation doesn't enforce it for package fragment roots.

Using IJavaProject.getPackageFragmentRoot(IResource) it is easy to create such 
non-existing roots, which can be openend.

The issue behind is that the element cache will be populated for these 
elements, and unless the client call #close() on this root, the cache will hold 
onto some of the children elements.
Comment 1 Jerome Lanneluc CLA 2002-10-21 04:50:01 EDT
PackageFragmentRoot.openwhenClosed(...) already ensures that the resource is on 
the classpath.
Added regression test ExistenceTests.testPkgFragmentRootNotInClasspath()