Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 464492

Summary: Code select for binary type gives corresponding source type
Product: [Eclipse Project] JDT Reporter: Noopur Gupta <noopur_gupta>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, manoj.palat, markus.kell.r
Version: 4.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Noopur Gupta CLA 2015-04-13 05:31:23 EDT
- Create a Java project "P1" and add the following:

package p1;

public class C1 {
	C1 c1 = new C1();
}

- Export the above project as a .jar file with source files.

- Create a new Java project "P2" and add the following:

package p1;

/**
 * My impl
 *
 */
class C1 {
}

- In P2's build path, click Add External JARs and add the .jar that was created for P1.

- Open the source file C1.java in P2 and press Ctrl+Shift+G at "C1". => Search shows result from the binary file in jar.

- Add field "C1 c11;" in source file and save. Now, press Ctrl+Shift+G at "C1" in binary file. => Search shows result from source file and no result from binary file.

- Hover on "C1" in binary file. => It shows Javadoc of C1 from source file.

- Ctrl+click on "C1" in binary file. => It navigates to C1 in source file.

It can also be seen with the JavaElement view by setting input for the binary type "C1" from codeSelect. 
Not sure if this is the expected behavior but it looks odd with the operations listed above (Search, Javadoc etc.).
Comment 1 Jay Arthanareeswaran CLA 2015-04-15 04:54:50 EDT
NameLookup and other text based features like search seem to be confused by presence of two same types in the project. It's also possible that the source type (in P1) is considered to be the source attachment of the binary type, which would be wrong of course.

I would say this is a very unusual situation, though.
Comment 2 Eclipse Genie CLA 2020-01-25 04:39:12 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.