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 202894 - Cannot attach multiple source dirs to JAR
Summary: Cannot attach multiple source dirs to JAR
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Platform (show other bugs)
Version: 7.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks: 200698
  Show dependency tree
 
Reported: 2011-09-30 14:16 UTC by Jesse Glick
Modified: 2013-07-20 02:09 UTC (History)
1 user (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 Jesse Glick 2011-09-30 14:16:58 UTC
The fallback SourceJavadocAttacher impl does not work well for JavaHelp. I have in $userdir/config/Preferences/org/netbeans/modules/java/j2seplatform/Sources.properties:

jar\:file\:.../main/javahelp/external/jhall-2.0_05.jar!/-0=file:.../javahelp/jhMaster/JSearch/indexer/

after opening Indexer.class and then first attaching .../javahelp/jhMaster/JavaHelp/src/new/ and then .../javahelp/jhMaster/JavaHelp/src/impl/ and only finally the third source root which actually has this class. Would have been nicer to be able to specify all three dirs at once.
Comment 1 Tomas Zezula 2011-09-30 19:02:09 UTC
You can attach all three source dirs. The JFileChooser is multi selection.
What is the problem?
Comment 2 Tomas Zezula 2011-09-30 19:12:13 UTC
Here is a sample of Sources.properties for binding of lucene-core-2.9.3.jar with 2 source roots:

jar\:file\:/Users/tom/NetBeansProjects/libs/lucene-core-2.9.3.jar!/-0=file:/Users/tom/NetBeansProjects/libs/src/
jar\:file\:/Users/tom/NetBeansProjects/libs/lucene-core-2.9.3.jar!/-1=file:/Users/tom/NetBeansProjects/libs/src2/
Comment 3 Tomas Zezula 2011-09-30 19:14:21 UTC
In the current implementation the attach replaces all existing bindings for given root (because there is no UI to delete the current bindings).
Comment 4 Tomas Zezula 2011-09-30 19:55:41 UTC
The multiple source dirs can be attached to sinngle JAR by multi selection in JFileChooser.
Currently the attache does not extend the set of attached sources (javadoc) but it rather replaces the original set, the reason for this is not to accumulate trash in binary->source(javadoc) bindings.
If you think it should be changed to extend the original set feel free to reopen.
Comment 5 Jesse Glick 2011-10-19 19:52:26 UTC
(In reply to comment #1)
> You can attach all three source dirs. The JFileChooser is multi selection.

No, with a multiselection file chooser you would attach two of them but not the third, since selections must all be in the same parent dir. In other words, this only works if all the source roots are sibling directories.

(In reply to comment #3)
> In the current implementation the attach replaces all existing bindings for
> given root (because there is no UI to delete the current bindings).

That is fine, but within a given dialog there is no UI to add multiple nonsibling directories.
Comment 6 Tomas Zezula 2011-10-20 07:14:14 UTC
Aha, now I understand.
This will require changing the source (javadoc) text field to list (to allow add more entries).
Adding Jano to cc.
Comment 7 Tomas Zezula 2013-07-15 16:37:48 UTC
Fixed jet-main 66f79be3b364
Comment 8 Quality Engineering 2013-07-20 02:09:01 UTC
Integrated into 'main-silver', will be available in build *201307192300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/66f79be3b364
User: Tomas Zezula <tzezula@netbeans.org>
Log: #202894:Cannot attach multiple source dirs to JAR