Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8243596

ModuleLayer::parents should return an unmodifiable list

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9, 15
    • Fix Version/s: 15
    • Component/s: core-libs
    • Labels:
      None

      Description

      If a module layer is created with the defineModulesXXXX methods then the "parents" method that returns the list of parent layers returns a modifiable list, it should return an unmodifiable list. This bug does not impact the boot layer (or the empty layer). Configuration::parents does not have this issue.

      As part of this, we should clarify the ModuleLayer.parents() to make it clear that the returned list is unmodifiable. Configuration::parents javadoc is already clear that the returned list is unmodifiable.


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alanb Alan Bateman
                Reporter:
                alanb Alan Bateman
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: