NEW DATE! Bugzilla will undergo maintenance 2024-03-28 18h00 CET. Bugzilla will be placed in read-only mode at that time.

Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 21475 - Attaching Source-Code to a library which is not compiled with debug info
Summary: Attaching Source-Code to a library which is not compiled with debug info
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 2.1 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 7637 16162 23833 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-07-11 02:57 EDT by Paolo CLA
Modified: 2002-11-21 11:46 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo CLA 2002-07-11 02:57:30 EDT
I think considering that you often get third-party libraries and you can not 
recompile them with debug info on you can never attach the source code 
(perphaps you get only a partial portion of the whole source) to this library.

I'm convinced this is something very common and leeds to a more intuitive 
handling of the ide if you can add source code independently to the state the 
library was compiled.

A lot of other IDE can handle that (e.g. IDEA) and it a great benefit Eclipse 
would gain.

Thanks

-Pavel
Comment 1 Philipe Mulet CLA 2002-07-25 07:36:11 EDT
We would have to explicitely lookup corresponding source files, instead of 
relying on the source attributes. Guessing should be doable indeed.
Comment 2 Olivier Thomann CLA 2002-09-12 17:14:43 EDT
Can IDEA retrieve source for secondary types?
For example, if the source of A.java is:
public class A {
}
class B {
}

You compile this code without debug attributes and you put:B.class and A.class
in a jar. Then create a zip containing A.java. Are you able to retrieve the
source for B.class?
If not, then the heuristic is quite simple. We simply need to rebuild the source
file name using the fully qualified name of the corresponding type. I will
investigate that approach. Could you please let me know the result for the above
test case? I don't have IDEA to try it myself.
Comment 3 Paolo CLA 2002-09-13 05:17:31 EDT
i've tested your test case with IDEA 3.0 build 384. and the result is the 
following:

source of class A is found.
source of class B is not found. (it decompiles the class file to get it...)

cheers
Comment 4 Olivier Thomann CLA 2002-09-13 08:28:51 EDT
Ok, that confirms the way they do it. They use the fully qualified name to 
build a potential source name and then they proceed the lookup of the right 
source. We don't have a decompiler in Eclipse, so the best we can have is that 
the source will be retrieved successfully for A but not for B.
Comment 5 Paolo CLA 2002-09-13 09:18:18 EDT
having this functinality helps already a lot.
Comment 6 Olivier Thomann CLA 2002-09-13 13:03:25 EDT
Fixed and released in 2.1 stream.
Comment 7 Philipe Mulet CLA 2002-09-19 07:39:06 EDT
*** Bug 16162 has been marked as a duplicate of this bug. ***
Comment 8 David Audel CLA 2002-09-19 11:14:44 EDT
Verified.
Comment 9 Philipe Mulet CLA 2002-09-20 05:09:38 EDT
*** Bug 23833 has been marked as a duplicate of this bug. ***
Comment 10 Philipe Mulet CLA 2002-09-20 05:10:32 EDT
*** Bug 23833 has been marked as a duplicate of this bug. ***
Comment 11 Jerome Lanneluc CLA 2002-11-21 11:46:25 EST
*** Bug 7637 has been marked as a duplicate of this bug. ***