Uploaded image for project: 'CCC Migration Project'
  1. CCC Migration Project
  2. CCC-8177530

Module system implementation refresh (4/2017)

    XMLWordPrintable

    Details

    • Subcomponent:
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Hide
      Adding new types to `java.lang` is a source incompatible change as this package is implicitly imported on demand (i.e., `import java.lang.*`).  If code in an existing source file imports some other package on demand, and that package declares a `Module` type, and the existing code refers to that type, then the file will not compile without change.  One example that we are aware of is the Guice framework, which declares its own `Module` type. Code using precise imports rather than import-and-demand wildcards will not be impacted.
      Show
      Adding new types to `java.lang` is a source incompatible change as this package is implicitly imported on demand (i.e., `import java.lang.*`).  If code in an existing source file imports some other package on demand, and that package declares a `Module` type, and the existing code refers to that type, then the file will not compile without change.  One example that we are aware of is the Guice framework, which declares its own `Module` type. Code using precise imports rather than import-and-demand wildcards will not be impacted.
    • Interface Kind:
      Java API, Other
    • Scope:
      SE

      Description

      Summary

      Module system implementation refresh (4/2017)

      Problem

      This CCC tracks updating the module system introduced by JEPs 200/260/261/282 via CCC-8142968, refreshed by CCC-8154956, CCC-8169069, CCC-8173393, CCC-8173393, CCC-8174823 and several other smaller CCCs.

      This refresh proposes to update JDK 9 to align with the most recent proposals in JSR 376.

      Solution

      A summary of the changes in this update are:

      1. Move java.lang.reflect.{Module,Layer} to java.lang.{Module,ModuleLayer}. (#MoveModuleAndLayerClasses on the JSR 376 issues list, see attached).

      2. Revise the algorithm that computes the names of automatic modules so that it preserves digits at the end of module names (updated proposal #VersionsInModuleNames in JSR 376).

      3. Clarify ModuleDescriptor.Builder.mainClass to make it clearer that it adds the package of the main class to the module.

      4. Update JVM TI and java.lang.instrument to allow for the potential for unmodifable modules.

      Specification

      The specdiff of the API changes is attached.
      
      The specdiff for the update to the JVM TI spec is also attached.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              alanb Alan Bateman
              Reporter:
              alanb Alan Bateman
              Reviewed By:
              Mandy Chung
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: