This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 205782 - "Attach sources..." button not working
Summary: "Attach sources..." button not working
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Platform (show other bugs)
Version: 7.1
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-01 14:38 UTC by aldobrucale
Modified: 2012-07-23 14:56 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aldobrucale 2011-12-01 14:38:38 UTC
[ BUILD # : 201111242103 ]
[ JDK VERSION : 1.7.1 ]

In a Netbeans RCP module project I've opened (with ctrl-B) the source file for
a java class in an external library; the editor opened the generated source
file with a message "Showing generated source file. No source are attached to
class' JAR file."  I used the "Attach sources..." button but nothing changed.

The projects are based on version 7.0 of the platform, and the wrapper modules
are in a different module suite.
Comment 1 Jesse Glick 2011-12-01 14:50:42 UTC
Need steps to reproduce from scratch.
Comment 2 Tomas Zezula 2011-12-01 14:52:44 UTC
Please which sourced you are attaching to binary.
Can you share them?
Comment 3 aldobrucale 2011-12-01 15:32:38 UTC
I'm attaching slf4j-api-1.6.1-sources.jar to slf4j-api-1.6.1.jar, they can be downloaded from here http://www.slf4j.org/dist/

My slf4j module also wraps slf4j-jdk14-1.6.1.jar
Comment 4 Tomas Zezula 2011-12-01 15:35:10 UTC
Thanks!
Comment 5 Jesse Glick 2011-12-01 17:14:14 UTC
I was thinking this was a duplicate of bug #202785 but (1) slf4j-1.6.1.zip!/slf4j-1.6.1/slf4j-api-1.6.1.jar has a SHA-1 of 37ec7b9f4640c525a3b00b6fcac9ccc99f361ed3 which does not match that of org.slf4j:slf4j-api:1.6.1:jar in Central (6f3b8a24bf970f17289b234284c94f43eb42f0e4), (2) the Central artifact does in fact have sources and Javadoc, (3) it would not even matter until bug #205649 was implemented, which it is not in 7.1. So this is probably something else. The S/J attacher feature probably needs to better log what is going on.
Comment 6 Tomas Zezula 2011-12-01 17:17:54 UTC
Also UI in the Options where the default SJA shows the bindings will be good.
Comment 7 Jesse Glick 2011-12-01 17:20:04 UTC
Not sure if Options is the right place for it; more akin to stuff currently listed in the Tools menu. Perhaps a subdialog launched from a new button in the Library Manager dialog?
Comment 8 Tomas Zezula 2011-12-01 17:23:50 UTC
>new button in the Library Manager dialog
Seems the best to me.
Comment 9 Tomas Zezula 2012-06-07 08:26:41 UTC
The problem was in JavadocAndSourceRootDetection which was not able to detect the root in jar (zip) folder.
Fixed jet-main 0dcd0fb4152e

For the customizer panel I've created a new enhancement # 213718
Comment 10 Jesse Glick 2012-06-07 15:46:20 UTC
Good candidate for a unit test.
Comment 11 Tomas Zezula 2012-06-07 18:23:07 UTC
Right, I will add them.
Comment 12 Quality Engineering 2012-06-08 06:09:14 UTC
Integrated into 'main-golden', will be available in build *201206080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/0dcd0fb4152e
User: Tomas Zezula <tzezula@netbeans.org>
Log: #205782:"Attach sources..." button not working
Comment 13 Tomas Zezula 2012-06-08 06:36:11 UTC
Unit test added: jet-main b03f590f5dd3
Comment 14 Jesse Glick 2012-06-08 13:46:20 UTC
BTW TestFileUtils has easier ways of creating a ZIP file.
Comment 15 jirka_x1 2012-07-23 08:21:33 UTC
It does not work in RC1 (Build 201206272359 which is after 201206080001 where it was supposed to be integrated).

I am using 64 bit Windows 7, jdk1.7.0_04. I have several wrapper projects, I cannot use this method to add sources to any of them (nothing happens, no error, no message).

I think I should reopen the bug.
Comment 16 Tomas Zezula 2012-07-23 14:56:33 UTC
Works fine in NB 7.2rc2.
If it does not work with wrapper projects probably caused by wrapper projects ownership.
If possible attach a test project.