Bug 171703 - Eclipse cannot find source for *.class files
Summary: Eclipse cannot find source for *.class files
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1.2   Edit
Hardware: PC Windows Server 2003
: P3 normal (vote)
Target Milestone: 3.3.1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-25 11:46 EST by David Pérez CLA
Modified: 2008-09-16 09:44 EDT (History)
1 user (show)

See Also:


Attachments
Source code of the jar file (76.97 KB, application/zip)
2007-01-25 11:48 EST, David Pérez CLA
no flags Details
Jar file that cannot find sources (67.76 KB, application/x-jar)
2007-01-25 11:49 EST, David Pérez CLA
no flags Details
Jar file compiled by Eclipse. It can find sources (75.03 KB, application/x-jar)
2007-01-25 11:50 EST, David Pérez CLA
no flags Details
Proposed fix (825 bytes, patch)
2007-06-22 14:33 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Pérez CLA 2007-01-25 11:46:30 EST
Build ID: M20060921-0945

Steps To Reproduce:
1. Create a Java project
2. Use the jregex 1.2_01 http://jregex.sourceforge.net
3. Specify its source code (contained in a .zip in the project)
4. Insert some code that uses a class in that library.
5. I choose F3 to navigate to the source of i.e.
6. Eclipse complains it cannot find the source
7. Compile myself the project and place *.class inside a jar
8. Replace the new jar (with debug info) with the old one
8. Now Eclipse can find the class

More information:
I expect both jars to work the same way.
Comment 1 David Pérez CLA 2007-01-25 11:48:29 EST
Created attachment 57522 [details]
Source code of the jar file
Comment 2 David Pérez CLA 2007-01-25 11:49:26 EST
Created attachment 57523 [details]
Jar file that cannot find sources
Comment 3 David Pérez CLA 2007-01-25 11:50:56 EST
Created attachment 57524 [details]
Jar file compiled by Eclipse. It can find sources

Compiled in a separate project.
With debug info.
Comment 4 Olivier Thomann CLA 2007-06-22 14:33:13 EDT
Created attachment 72208 [details]
Proposed fix

This fix corrects the source file name in case it contains the package name.
Do you know what compiler was used to compile the .class files inside the first jar file ?
Comment 5 Olivier Thomann CLA 2007-06-22 14:33:39 EDT
Philippe,
candidate for 3.3.1 ?
Comment 6 David Pérez CLA 2007-06-26 02:45:34 EDT
No, I don't know the compiler.
You could ask the jregex folks.
Comment 7 Philipe Mulet CLA 2007-06-26 06:57:10 EDT
+1 for 3.3.1. Being resilient is always a good idea.
Comment 8 Olivier Thomann CLA 2007-07-04 11:06:33 EDT
Released for 3.4M1.
No regression test added as this would require to build an invalid source attribute.
Verifier, please use the steps in comment 0 to verify this fix.
Comment 9 Olivier Thomann CLA 2007-07-04 11:56:28 EDT
Released for 3.3.1.
No regression test added as this would require to build an invalid source
attribute.
Verifier, please use the steps in comment 0 to verify this fix.
Comment 10 Frederic Fusier CLA 2007-08-07 05:33:21 EDT
Verified for 3.4M1 using build I20070806-1800.
Comment 11 Frederic Fusier CLA 2007-08-07 05:34:17 EDT
Reopen for 3.3.1 verification
Comment 12 Frederic Fusier CLA 2007-08-07 06:14:50 EDT
.
Comment 13 Eric Jodet CLA 2007-09-03 07:35:20 EDT
Verified for 3.3.1 using build M20070831-2000