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

VarHandleByteArrayView nioAccess field should be static final

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • 14, 15, repo-panama
    • 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();
      ```

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

              Created:
              Updated:
              Resolved: