Bug 25039

Summary: Non-existing package fragment roots should not be openable
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: RESOLVED WORKSFORME QA Contact:
Severity: major    
Priority: P3    
Version: 2.0   
Target Milestone: 2.1 M3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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()