Bug 526054 - [9] define default set of JDK modules on the module path for modular projects
Summary: [9] define default set of JDK modules on the module path for modular projects
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.7.1a   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.7.2   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 526688
  Show dependency tree
 
Reported: 2017-10-15 15:27 EDT by Stephan Herrmann CLA
Modified: 2017-12-06 07:47 EST (History)
3 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-10-15 15:27:27 EDT
Follow-up from bug 522328

JEP 261 defines the reduced set of root modules only for the case when compiling an unnamed module. (Modular projects explicitly pull in any modules they require).

Our implementation correctly reflects this by asking isUnnamedModule() (inside JavaProject.computePackageFragmentRoots()).

Unfortunately, we're now inconsistent in two ways:

- isUnnamedModule() answers true during initialization of a NameEnvironment, even if the project is modular (is this a chicken-n-egg problem?).
   => Even in modular projects not all JDK modules are visible.

- JDT/UI's ModuleDialog uses org.eclipse.jdt.core.provisional.JavaModelAccess.defaultRootModules(Iterable<IPackageFragmentRoot>) even in a modular project.

These two quirks are consistent among each other: compilation and dialog speak the same language. OTOH, Package Explorer and even Build Path > Libraries still show the full JDK content.


When both quirks are fixed, the default from bug 522328 will no longer be used for modular projects.

It could still be interesting to use that default for a modular project, to test whether clients in an unnamed module would need any --add-module options.

This could, e.g., be achieved by a button: "Use default root modules like for unnamed modules", which would then populate the Contents sub-lists accordingly. Note, that also persisting limit-modules must be aware if current project is modular to compare against the appropriate default.
Comment 1 Eclipse Genie CLA 2017-11-03 15:06:17 EDT
New Gerrit change created: https://git.eclipse.org/r/110989
Comment 4 Sasikanth Bharadwaj CLA 2017-11-17 01:39:18 EST
Verified for 4.7.2 using M20171115-1700 build
Comment 5 Jay Arthanareeswaran CLA 2017-12-06 07:47:38 EST
Verified for 4.8 M4 using build I20171205-2000.