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

Lookup.in should allow teleporting from a lookup class in a named module without dropping all access

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 14
    • Component/s: core-libs

      Description

      Lookup.in(Class<?>) is currently specified to drop all access when teleporting from a lookup class in a named module to a lookup in another module. This is necessary to guarantee that the new lookup does not have more access than the old (because the new Lookup will do access checking with only the new lookup class).

      [ The exception is publicLookup() where the lookup class is java.lang.Object (in java.base). The `in` method can be used to teleport to a lookup class in another module without loosing PUBLIC access. ]

      This issue tracks re-examining this method with a view to having Lookup retain a reference to the old lookup class so that a "double access check" can be done to ensure that any method handles created are checked with both the old and new. All access would be be dropped with a second hop to avoid Lookup needing to remember more than one previous lookup class.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: