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

VarHandleByteArrayView nioAccess field should be static final

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 14, 15, repo-panama
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • Introduced In Version:
      14

      Description

      The static JavaNioAccess nioAccess field (introduced by JDK-8234049) in VarHandleByteArrayAs* should be final. It would probably also make sense to move it to VarHandleByteArrayBase.

      This is not a problem for inlining because there's only a single implementor of that interface, but it'll result in an unnecessary field load and null check.

      ```
      final class VarHandleByteArrayAsInts extends VarHandleByteArrayBase {
          static JavaNioAccess nioAccess = SharedSecrets.getJavaNioAccess();
      ```

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              psandoz Paul Sandoz
              Reporter:
              aw Andreas Woess
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: