Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 522073 - [9] core support for --limit-modules
Summary: [9] core support for --limit-modules
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:
Depends on:
Blocks: 521666
  Show dependency tree
 
Reported: 2017-09-08 15:27 EDT by Stephan Herrmann CLA
Modified: 2017-09-16 07:18 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 Stephan Herrmann CLA 2017-09-08 15:27:10 EDT
One more option to support: when Jrt container specifies limit-modules only the transitive closure of the mentioned modules should be observable.

I don't see use for other classpath entries.
Comment 1 Eclipse Genie CLA 2017-09-10 18:25:10 EDT
New Gerrit change created: https://git.eclipse.org/r/104815
Comment 3 Stephan Herrmann CLA 2017-09-11 16:44:31 EDT
(In reply to Eclipse Genie from comment #2)
> Gerrit change https://git.eclipse.org/r/104815 was merged to [BETA_JAVA9].
> Commit:
> http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=9b8300bd40097f83910af2d40fdc1cb6ee0c88af
> 

Released for BETA_JAVA9.
Comment 4 Stephan Herrmann CLA 2017-09-11 16:44:43 EDT
.
Comment 5 Stephan Herrmann CLA 2017-09-14 16:39:15 EDT
Once limit-modules has been defined, removing the limitation doesn't restore the original set of modules (need to close the project).

Additionally, in a project with --limit-modules, UI (bug 521666) has no means to retrieve the list of available modules. This may actually require new API.
Comment 6 Eclipse Genie CLA 2017-09-15 18:35:44 EDT
New Gerrit change created: https://git.eclipse.org/r/105257
Comment 7 Stephan Herrmann CLA 2017-09-15 18:41:26 EDT
(In reply to Eclipse Genie from comment #6)
> New Gerrit change created: https://git.eclipse.org/r/105257

Fixes for both issues in comment 5:

- Don't persist the filtered set of roots in PerProjectInfo#jrtRoots (we don't have the updating mechanism in place to update this list), instead consistently apply limit-modules filtering on every access.

- I added provisional API, exported only to JDT/UI to allow access to the unfiltered list or roots corresponding to a given raw IClasspathEntry.

For the API I'd be happy to merge this back into IJavaProject, if people like it, but since I didn't want to block necessary work by this API discussion I opted for the provisional API approach.
Comment 8 Stephan Herrmann CLA 2017-09-15 18:45:42 EDT
@Jay, I noticed no-one was subscribed to this bug, so repeating my last comment to keep you in the loop:

(In reply to Stephan Herrmann from comment #7)
> [...]
> - I added provisional API, exported only to JDT/UI to allow access to the
> unfiltered list or roots corresponding to a given raw IClasspathEntry.
> 
> For the API I'd be happy to merge this back into IJavaProject, if people
> like it, but since I didn't want to block necessary work by this API
> discussion I opted for the provisional API approach.

See also https://git.eclipse.org/r/plugins/gitiles/jdt/eclipse.jdt.core/+/refs/changes/57/105257/1/org.eclipse.jdt.core/model/org/eclipse/jdt/core/provisional/JavaModelAccess.java
Comment 10 Stephan Herrmann CLA 2017-09-16 07:14:20 EDT
(In reply to Eclipse Genie from comment #9)
> Gerrit change https://git.eclipse.org/r/105257 was merged to [BETA_JAVA9].
> Commit:
> http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=54049bd43ee6ccfbd3f1b67192d2ed3baee764e3
> 

Both fixes mentioned in comment 7 released for BETA_JAVA9
Comment 11 Stephan Herrmann CLA 2017-09-16 07:18:26 EDT
Provisional API to be finalized in the 4.8 frame via bug 522391