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

SegmentAllocator:allocateArray throws IllegalArgumentException in some cases

    XMLWordPrintable

Details

    • Enhancement
    • Status: Closed
    • P3
    • Resolution: Won't Fix
    • 19
    • None
    • core-libs

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: