Bug 7597

Summary: PackageFragmentRoot which are archives loose associated resource
Product: [Eclipse Project] JDT Reporter: Claude Knaus <Claude_Knaus>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 M2   
Hardware: PC   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 3658    

Description Claude Knaus CLA 2002-01-15 08:40:07 EST
20020109-I w2k and linux:

  1) Add a binary project to the workspace (e.g. org.eclipse.jdt.core).
     If the project existed already, delete it first.
  2) Open a class from a binary project (e.g. org.eclipse.jdt.core.IJavaElement)
  3) Do a search (CTRL-H) for the IJavaElement type declaration.
  4) The search marker appears in the displayed file.
  5) Shutdown and restart Eclipse.
  6) Do the same search from 3) again.
  7) Observe how the search markers do not appear.

I debugged a bit and it looks like the PackageFragmentRoot associated with jar 
file has its resource field (fResource) set to null. The resource
locator used in the ClassFileDocumentProvider to get the jar file
then falls back to the surrounding project. This is why the marker deltas are 
not processed correctly since the resources don't match.
Comment 1 Philipe Mulet CLA 2002-01-15 10:12:46 EST
Please investigate
Comment 2 Jerome Lanneluc CLA 2002-01-18 10:09:03 EST
When restoring the IPackageFragmentRoot handle, getPackageFragmentRoot(String) 
was used instead of getPackageFragmentRoot(IPath). The former assumes that the 
string is a path to an external jar (thus it doesn't have an associated 
resource). Changed it to used the latter.