Bug 29652 - Can't attach source to some ZIP files
Summary: Can't attach source to some ZIP files
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0.2   Edit
Hardware: PC Windows 2000
: P2 major (vote)
Target Milestone: 2.1 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-16 13:42 EST by Andrew Cornwall CLA
Modified: 2003-01-17 09:20 EST (History)
1 user (show)

See Also:


Attachments
example.zip (486 bytes, application/octet-stream)
2003-01-16 13:43 EST, Andrew Cornwall CLA
no flags Details
example-src.zip (494 bytes, application/octet-stream)
2003-01-16 13:43 EST, Andrew Cornwall CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cornwall CLA 2003-01-16 13:42:05 EST
I ran into a problem that prevented me from attaching source to the classes in 
my .zip file.

Steps to reproduce:

1. Create a Java project CantAttachSource.
2. File -> Properties...
3. Java Build Path -> Libraries
4. Add External JARs... and select "example.zip" attached to this PR.
5. Attach Source... and select "example-src.zip" attached to this PR.
6. Finish.
7. Browse the class test.HelloWorld from example.zip. You don't see any source!
Comment 1 Andrew Cornwall CLA 2003-01-16 13:43:02 EST
Created attachment 3014 [details]
example.zip

ZIP file containing classes
Comment 2 Andrew Cornwall CLA 2003-01-16 13:43:33 EST
Created attachment 3015 [details]
example-src.zip

Source file (.java) for example.zip
Comment 3 Olivier Thomann CLA 2003-01-16 15:26:16 EST
No problem in 2.1.
Comment 4 Andrew Cornwall CLA 2003-01-16 16:33:14 EST
Are there any workarounds for 2.0.2?
Comment 5 Philipe Mulet CLA 2003-01-17 06:58:10 EST
As long as the example.zip was compiled with debug attributes, it should work.
Olivier - can you investigate if this was the case ?
Comment 6 Olivier Thomann CLA 2003-01-17 08:59:11 EST
The HelloWorld.class in the example.zip file doesn't contain any debug
attribute. The source file attribute is enough, but it is not there. Therefore
it failed. I checked that if the file contains debug attributes (default one:
source and lines), it works fine.
So the workaround is to compile with source file attribute.
Ok to close?
Comment 7 Olivier Thomann CLA 2003-01-17 09:20:41 EST
Close as INVALID.
There is no problem. In 2.0.2 the source file attribute is used to retrieve the
attached source. This behavior has been improved in 2.1.