Bug 520656 - [9] ISourceReference.getSource() returns "/" for a BinaryModule
Summary: [9] ISourceReference.getSource() returns "/" for a BinaryModule
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: BETA J9   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 519150 (view as bug list)
Depends on: 520651 521058
Blocks:
  Show dependency tree
 
Reported: 2017-08-08 04:39 EDT by Noopur Gupta CLA
Modified: 2017-10-09 17:21 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Noopur Gupta CLA 2017-08-08 04:39:48 EDT
ISourceReference.getSource() is called from org.eclipse.jdt.internal.ui.infoviews.SourceView.computeInput(Object input) to get the source to be shown in Declaration view.

For a BinaryModule, it always returns "/" instead of the source.
Comment 1 Stephan Herrmann CLA 2017-08-17 12:36:42 EDT
Same root cause also break JavadocView for module-info.class.
Comment 2 Eclipse Genie CLA 2017-08-17 17:06:20 EDT
New Gerrit change created: https://git.eclipse.org/r/103261
Comment 3 Stephan Herrmann CLA 2017-08-17 17:12:01 EDT
(In reply to Eclipse Genie from comment #2)
> New Gerrit change created: https://git.eclipse.org/r/103261

On top of other pending fixes, only one thing needed fixing: org.eclipse.jdt.internal.core.BinaryModule didn't use a SourceMapper for getSourceRange().

With this fix Javadoc view and Declaration view are working fine with module-info.class from JRT.

Other changes in the patch:
- enable tests to create a modular jar on the fly
- fix a compile order issue, where "exports" was resolved before 
  any CU declaring the desired package was touched.
Comment 5 Stephan Herrmann CLA 2017-08-19 06:48:59 EDT
(In reply to Eclipse Genie from comment #4)
> Gerrit change https://git.eclipse.org/r/103261 was merged to [BETA_JAVA9].
> Commit:
> http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=57cf79139dd515086d92744c56f6963d0d91fd3a
> 

released
Comment 6 Stephan Herrmann CLA 2017-10-09 17:21:37 EDT
*** Bug 519150 has been marked as a duplicate of this bug. ***