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

Adjust behaviour when --enable-native-access is not specified to be more tolerant

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Duplicate
    • P4
    • None
    • repo-panama
    • tools

    Description

      Tweak the policy of the --enable-native-access flag, as follows (this change was first discussed in [1]):

      * when the flag is specified, we keep existing behavior. This means getting an exception on every unsafe access, if the accessing module is not listed in the flag;
      * when the flag is not specified, access to unsafe functionalities is allowed, with runtime warning (instead of an error).

      The new, more-tolerant behavior in the absence of flag would facilitate migration away from JNI in cases where altering the set of command line options might be difficult. This mode would also help us (later) to migrate JNI to require a similar opt-in, effectively putting both JNI and Panama on the same grounds. The new mode is transitional and in a future release, this mode will be disabled and the new flag will be required _always_.

      [1] https://mail.openjdk.java.net/pipermail/panama-dev/2022-January/016011.html

      Attachments

        Issue Links

          Activity

            People

              jboes Julia Boes (Inactive)
              jboes Julia Boes (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: