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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 21
    • Affects Version/s: 21
    • Component/s: 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)

              Assignee:
              Maurizio Cimadamore
              Reporter:
              Leonid Kuskov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: