VarHandleByteArrayView nioAccess field should be static final

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • None
    • Affects Version/s: 14, 15, repo-panama
    • Component/s: tools
    • 14

      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();
      ```

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

              Created:
              Updated:
              Resolved: