SegmentAllocator:allocateArray throws IllegalArgumentException in some cases

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P3
    • None
    • Affects Version/s: 19
    • Component/s: core-libs

      Observed that SegmentAllocator:allocateArray(*) methods throws undocumented IllegalArgumentException where the layout alignment is more than their bitsize.

      The possible scenario of these methods throwing IAEx is not documented.

      For the below case :
       SegmentAllocator.implicitAllocator().allocateArray(ValueLayout.JAVA_BYTE.withBitAlignment(16),new byte[]{1,2,
                      3});
      will result in - java.lang.IllegalArgumentException: Source layout alignment greater than its size

      The spec can be enhanced for this case.

            Assignee:
            Unassigned
            Reporter:
            Krushnareddy Ganapureddy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: