Bug 119434 - [code select] Code select returns doubled java element
Summary: [code select] Code select returns doubled java element
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.4 M1   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-06 11:26 EST by Tobias Widmer CLA
Modified: 2007-08-03 06:43 EDT (History)
0 users

See Also:


Attachments
Proposed fix (3.61 KB, patch)
2007-06-27 04:32 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Widmer CLA 2005-12-06 11:26:40 EST
JDT Core HEAD

Steps to reproduce:
- Create a simple test project "Bar" with a package "p" and a type "Type"
- Export the package "p" into a JAR file
- Create another test project "Foo" and put exported JAR onto the classpath
- Create a source folder "src" in "Foo" with a package "p" and a type "Type"
- Move classpath entry with linked JAR to the last position of classpath
- Create cu "MyType":

import p.Type;
public class MyType extends Type {}

-> Invoking Open Declaration in cu with selection

import p.<Start>Type<End>;

returns the same Java element twice.
Comment 1 Jerome Lanneluc CLA 2005-12-08 11:49:39 EST
SelectionRequestor.addElement(IJavaElement) should ensure that the same (i.e. equals(...)) element is not already present in the list.
Comment 2 David Audel CLA 2007-06-27 04:32:08 EDT
Created attachment 72565 [details]
Proposed fix
Comment 3 David Audel CLA 2007-06-27 04:36:46 EDT
Released for 3.4M1.

Test added: 
  ResolveTests#testDuplicateTypeDeclaration7()

Duplicate are now filtered.

Comment 4 Frederic Fusier CLA 2007-08-03 06:43:10 EDT
Verified for 3.4M1 using build I20070802-0800.