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

Bug 414651

Summary: Console view open wrong source code file when click to Log4j %F output
Product: [Eclipse Project] JDT Reporter: Ivan Yiu <ivanyiu>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: major    
Priority: P3 CC: jarthana, shankhba
Version: 4.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug
Attachments:
Description Flags
TestCase none

Description Ivan Yiu CLA 2013-08-08 05:43:38 EDT
When using log4j to output the log entry to the console with the %F pattern. the console view provide a link to access the file.

But when multiple project opened with identical class name, the source file link will point to a different project instead of the current project working on.
Comment 1 Jay Arthanareeswaran CLA 2013-08-12 00:38:23 EDT
Shankha, can you please take a look at this? At this point, I am not sure if JDT/Core is involved here. But we should investigate this so that we can assign to the appropriate component asap.
Comment 2 shankha banerjee CLA 2013-08-12 00:45:44 EDT
I will look into it.
Comment 3 shankha banerjee CLA 2013-08-12 05:38:41 EDT
Created attachment 234296 [details]
TestCase
Comment 4 shankha banerjee CLA 2013-08-12 08:02:01 EDT
(In reply to comment #0)
> When using log4j to output the log entry to the console with the %F pattern.
> the console view provide a link to access the file.
> 
> But when multiple project opened with identical class name, the source file
> link will point to a different project instead of the current project
> working on.

Could you please modify the test case (HelloWorld log4j) I have attached to have the %F in a configuration file. I am not able to figure it out.

Thanks
Comment 5 Ivan Yiu CLA 2013-08-12 22:57:17 EDT
(In reply to comment #4)
> (In reply to comment #0)
> > When using log4j to output the log entry to the console with the %F pattern.
> > the console view provide a link to access the file.
> > 
> > But when multiple project opened with identical class name, the source file
> > link will point to a different project instead of the current project
> > working on.
> 
> Could you please modify the test case (HelloWorld log4j) I have attached to
> have the %F in a configuration file. I am not able to figure it out.
> 
> Thanks

The problem occur when you have two different projects, containing same package and class name and both opened.

When clicking on the console view of Log4J output with class name and line number, sometimes it will open the source code of another project.

The problem is, how the console view search for the corresponding source code? does it look up in the current project working on first? or the search criteria vary?
Comment 6 shankha banerjee CLA 2013-08-13 01:41:34 EDT
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #0)
> > > When using log4j to output the log entry to the console with the %F pattern.
> > > the console view provide a link to access the file.
> > > 
> > > But when multiple project opened with identical class name, the source file
> > > link will point to a different project instead of the current project
> > > working on.
> > 
> > Could you please modify the test case (HelloWorld log4j) I have attached to
> > have the %F in a configuration file. I am not able to figure it out.
> > 
> > Thanks
> 
> The problem occur when you have two different projects, containing same
> package and class name and both opened.
> 
> When clicking on the console view of Log4J output with class name and line
> number, sometimes it will open the source code of another project.
> 
> The problem is, how the console view search for the corresponding source
> code? does it look up in the current project working on first? or the search
> criteria vary?

Hi Ivan,
I am not aware of the code to tell you how the code flows while performing a console search. For that I need a test case which outputs "class name and line
 number," on console as you mentioned. I can debug it and then figure it out.

Thanks.
Comment 7 Eclipse Genie CLA 2020-02-09 20:17:09 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.