Bug 162037

Summary: [model] Wrong Project for Java-Element
Product: [Eclipse Project] JDT Reporter: Heywinkel <klaus.heywinkel>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, frederic_fusier, markus.kell.r
Version: 3.1.2   
Target Milestone: 3.3 RC4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Heywinkel CLA 2006-10-24 02:36:43 EDT
In the case that more than one Project reference the same jar-File, the Project for each Java-Element (e.g. IType) out of this jar-File (taken from the Types-View) seems to be the same, regardless of the Selection in the Project- and Package-View. I think the Types-View should take these selection into account.
Comment 1 Frederic Fusier CLA 2006-10-24 04:58:20 EDT
Move to JDT/UI
Comment 2 Markus Keller CLA 2006-10-26 10:27:38 EDT
Moving back to core. This is a model problem.

Import org.junit as binary plug-in. Create a second project org.junit.number2 and add org.junit/junit.jar to build path. Now look at the JarPackageFragmentRoot 'org.junit/junit.jar' (e.g. with the JavaElement view from http://www.eclipse.org/jdt/ui/update-site):

- It has children (e.g. JarPackageFragment 'junit.framework') that answer org.junit.number2 on getJavaProject(); expected: org.junit.

- The getParent() of these children is a JarPackageFragmentRoot with handleIdentifier '=org.junit.number2/\/org.junit\/junit.jar'.
This parent thinks it is Object#equals(..) to the original JarPackageFragmentRoot with handleIdentifier '=org.junit/junit.jar'
Comment 3 Frederic Fusier CLA 2007-06-19 07:50:22 EDT
Reproduced with 3.3 RC4
Comment 4 Jerome Lanneluc CLA 2007-06-20 08:03:49 EDT
Known limitation of the Java model. No action planned.
Comment 5 Markus Keller CLA 2010-07-19 12:09:49 EDT

*** This bug has been marked as a duplicate of bug 39468 ***