Bug 491981 - source lookup unpredictable and cannot be influenced
Summary: source lookup unpredictable and cannot be influenced
Status: REOPENED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.5.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.14 M3   Edit
Assignee: Sarika Sinha CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 433315 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-04-19 06:01 EDT by arne anka CLA
Modified: 2023-05-13 03:26 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description arne anka CLA 2016-04-19 06:01:05 EDT
i get a stacktrace which goes into a JAR not part of the project nor in its build path.
click on  the "(classname.java:line)" link tries to find the JAR elsewhere, taking whatever it finds in the workspace.
i have to close all projects possibly containing a version of the JAR in their build paths to finally get a "Source not found for ....".

it is apparently impossible to influence JDT in its arbitrary decisions and even if it fails, it does not offer a way to select the JAR on my own.

having to close other projects, which are in no way related or connected to the current project, just because JDT fails to accept that it doesn't know what it does, is inacceptable -- and that even when it finally gives up it does not offer a way for me to finally tell it how wrong it is and where to look instead, even more.
Comment 1 Sarika Sinha CLA 2016-04-19 12:28:54 EDT
Can you please provide reproducible steps.
Comment 2 arne anka CLA 2016-07-01 05:35:34 EDT
- create several jars with the same class
- distribute over several open projects in workspace
- use a project that by name or creation date is in the middle of all those projects (since i don't know why eclipse choses the worng prject/jar, i cannot be more specfic)
- create stacktrace that involves the class from the jar
- click the stacktrace's "(classname.java:line)" part
- find yourself in the wrong project/jar
Comment 3 arne anka CLA 2016-07-01 05:36:13 EDT
*** Bug 433315 has been marked as a duplicate of this bug. ***
Comment 4 Sarika Sinha CLA 2016-07-11 04:34:58 EDT
(In reply to arne anka from comment #2)
> - create several jars with the same class
> - distribute over several open projects in workspace
> - use a project that by name or creation date is in the middle of all those
> projects (since i don't know why eclipse choses the worng prject/jar, i
> cannot be more specfic)
> - create stacktrace that involves the class from the jar
> - click the stacktrace's "(classname.java:line)" part
> - find yourself in the wrong project/jar

Can you attach a sample workspace, I tried with exporting to 5 different jars.
Comment 5 Eclipse Genie CLA 2019-10-22 06:43:47 EDT
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.

If you have further information on the current state of the bug, please add it. 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.
Comment 6 Sarika Sinha CLA 2019-10-22 07:09:56 EDT
Can not reproduce. Please reopen and provide workspace if you still see the issue.
Comment 7 arne anka CLA 2021-04-22 05:10:29 EDT
I cannot provide a workspace of several GB and with commercial projects in it.

From current experiences with
- Java Stacktrace Console
- Junit view

I confidently can say that the source lookup 
a) takes the first source file matching package and class name in the workspace
b) does not check the originating project's class path 
to make sure whether that source file's location is actually part of it

If you cannot reproduce, it may happen only in large workspaces with many files and projects? 
OTOH I've experienced that issue over the years in at least 4 completely unrelated workspaces and Eclipse installations.

Can you give me some pointers as to where to enable logging for the lookup or where to start debugging the code flow in JDT?
Comment 8 arne anka CLA 2021-04-22 05:22:57 EDT
Forgot another bit of damning evidence:
the momnent I close the "competing" project, source lookup stays on the straight and narrow.
Comment 9 Eclipse Genie CLA 2023-05-11 17:57:42 EDT
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.

If you have further information on the current state of the bug, please add it. 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.
Comment 10 arne anka CLA 2023-05-13 03:26:26 EDT
Nothing changed.
Issue persists.