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

ValueLayout:: arrayElementVarHandle doesn't throws UnsupportedOperationException - if byteAlignment() > byteSize()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 21
    • 21
    • core-libs
    • None
    • b24
    • 21
    • b27

        ValueLayout ::arrayElementVarHandle
        Throws: UnsupportedOperationException - if byteAlignment() > byteSize().

        jshell> ValueLayout.JAVA_LONG_UNALIGNED.withByteAlignment(64)
        $29 ==> 64%j8

        But

        jshell> ValueLayout.JAVA_LONG_UNALIGNED.withByteAlignment(64).arrayElementVarHandle()
        | Exception java.lang.IllegalArgumentException: Element layout size is not multiple of alignment
        | at Utils.checkElementAlignment (Utils.java:181)
        | at MemoryLayout.sequenceLayout (MemoryLayout.java:626)
        | at MemoryLayout.sequenceLayout (MemoryLayout.java:646)
        | at ValueLayouts$AbstractValueLayout.arrayElementVarHandle (ValueLayouts.java:128)
        | at (#30:1)

              mcimadamore Maurizio Cimadamore
              lkuskov Leonid Kuskov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: