@@ -869,7 +869,7 @@ MemorySegment reinterpret(long newSize,
869
869
* this segment is not {@linkplain Scope#isAlive() alive}
870
870
* @throws WrongThreadException if this method is called from a thread {@code T},
871
871
* such that {@code isAccessibleBy(T) == false}
872
- * @throws UnsupportedOperationException if this segment is
872
+ * @throws IllegalArgumentException if this segment is
873
873
* {@linkplain #isReadOnly() read-only}
874
874
*/
875
875
MemorySegment fill (byte value );
@@ -894,7 +894,7 @@ MemorySegment reinterpret(long newSize,
894
894
* {@code src} is not {@linkplain Scope#isAlive() alive}
895
895
* @throws WrongThreadException if this method is called from a thread {@code T},
896
896
* such that {@code src.isAccessibleBy(T) == false}
897
- * @throws UnsupportedOperationException if this segment is
897
+ * @throws IllegalArgumentException if this segment is
898
898
* {@linkplain #isReadOnly() read-only}
899
899
* @return this segment
900
900
*/
@@ -1269,6 +1269,8 @@ MemorySegment reinterpret(long newSize,
1269
1269
* this segment is not {@linkplain Scope#isAlive() alive}
1270
1270
* @throws WrongThreadException if this method is called from a thread {@code T},
1271
1271
* such that {@code isAccessibleBy(T) == false}
1272
+ * @throws IllegalArgumentException if this segment is
1273
+ * {@linkplain #isReadOnly() read-only}
1272
1274
*/
1273
1275
void setString (long offset , String str );
1274
1276
@@ -1306,6 +1308,8 @@ MemorySegment reinterpret(long newSize,
1306
1308
* such that {@code isAccessibleBy(T) == false}
1307
1309
* @throws IllegalArgumentException if {@code charset} is not a
1308
1310
* {@linkplain StandardCharsets standard charset}
1311
+ * @throws IllegalArgumentException if this segment is
1312
+ * {@linkplain #isReadOnly() read-only}
1309
1313
*/
1310
1314
void setString (long offset , String str , Charset charset );
1311
1315
@@ -1493,7 +1497,7 @@ static MemorySegment ofAddress(long address) {
1493
1497
* @throws IndexOutOfBoundsException if {@code dstOffset > dstSegment.byteSize() - bytes}
1494
1498
* @throws IndexOutOfBoundsException if either {@code srcOffset},
1495
1499
* {@code dstOffset} or {@code bytes} are {@code < 0}
1496
- * @throws UnsupportedOperationException if {@code dstSegment} is
1500
+ * @throws IllegalArgumentException if {@code dstSegment} is
1497
1501
* {@linkplain #isReadOnly() read-only}
1498
1502
*/
1499
1503
@ ForceInline
@@ -1552,7 +1556,7 @@ static void copy(MemorySegment srcSegment, long srcOffset,
1552
1556
* {@code dstSegment} is not {@linkplain Scope#isAlive() alive}
1553
1557
* @throws WrongThreadException if this method is called from a thread {@code T},
1554
1558
* such that {@code dstSegment.isAccessibleBy(T) == false}
1555
- * @throws UnsupportedOperationException if {@code dstSegment} is {@linkplain #isReadOnly() read-only}
1559
+ * @throws IllegalArgumentException if {@code dstSegment} is {@linkplain #isReadOnly() read-only}
1556
1560
* @throws IndexOutOfBoundsException if {@code elementCount * srcLayout.byteSize()} overflows
1557
1561
* @throws IndexOutOfBoundsException if {@code elementCount * dtsLayout.byteSize()} overflows
1558
1562
* @throws IndexOutOfBoundsException if {@code srcOffset > srcSegment.byteSize() - (elementCount * srcLayout.byteSize())}
@@ -1605,7 +1609,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
1605
1609
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
1606
1610
* in the provided layout
1607
1611
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
1608
- * @throws UnsupportedOperationException if this segment is
1612
+ * @throws IllegalArgumentException if this segment is
1609
1613
* {@linkplain #isReadOnly() read-only}
1610
1614
*/
1611
1615
void set (ValueLayout .OfByte layout , long offset , byte value );
@@ -1643,7 +1647,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
1643
1647
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
1644
1648
* in the provided layout
1645
1649
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
1646
- * @throws UnsupportedOperationException if this segment is
1650
+ * @throws IllegalArgumentException if this segment is
1647
1651
* {@linkplain #isReadOnly() read-only}
1648
1652
*/
1649
1653
void set (ValueLayout .OfBoolean layout , long offset , boolean value );
@@ -1681,7 +1685,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
1681
1685
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
1682
1686
* in the provided layout
1683
1687
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
1684
- * @throws UnsupportedOperationException if this segment is
1688
+ * @throws IllegalArgumentException if this segment is
1685
1689
* {@linkplain #isReadOnly() read-only}
1686
1690
*/
1687
1691
void set (ValueLayout .OfChar layout , long offset , char value );
@@ -1719,7 +1723,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
1719
1723
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
1720
1724
* in the provided layout
1721
1725
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
1722
- * @throws UnsupportedOperationException if this segment is
1726
+ * @throws IllegalArgumentException if this segment is
1723
1727
* {@linkplain #isReadOnly() read-only}
1724
1728
*/
1725
1729
void set (ValueLayout .OfShort layout , long offset , short value );
@@ -1757,7 +1761,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
1757
1761
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
1758
1762
* in the provided layout
1759
1763
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
1760
- * @throws UnsupportedOperationException if this segment is
1764
+ * @throws IllegalArgumentException if this segment is
1761
1765
* {@linkplain #isReadOnly() read-only}
1762
1766
*/
1763
1767
void set (ValueLayout .OfInt layout , long offset , int value );
@@ -1795,7 +1799,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
1795
1799
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
1796
1800
* in the provided layout
1797
1801
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
1798
- * @throws UnsupportedOperationException if this segment is
1802
+ * @throws IllegalArgumentException if this segment is
1799
1803
* {@linkplain #isReadOnly() read-only}
1800
1804
*/
1801
1805
void set (ValueLayout .OfFloat layout , long offset , float value );
@@ -1833,7 +1837,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
1833
1837
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
1834
1838
* in the provided layout
1835
1839
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
1836
- * @throws UnsupportedOperationException if this segment is
1840
+ * @throws IllegalArgumentException if this segment is
1837
1841
* {@linkplain #isReadOnly() read-only}
1838
1842
*/
1839
1843
void set (ValueLayout .OfLong layout , long offset , long value );
@@ -1871,7 +1875,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
1871
1875
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
1872
1876
* in the provided layout
1873
1877
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
1874
- * @throws UnsupportedOperationException if this segment is
1878
+ * @throws IllegalArgumentException if this segment is
1875
1879
* {@linkplain #isReadOnly() read-only}
1876
1880
*/
1877
1881
void set (ValueLayout .OfDouble layout , long offset , double value );
@@ -1921,8 +1925,10 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
1921
1925
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - layout.byteSize()}
1922
1926
* @throws UnsupportedOperationException if this segment is
1923
1927
* {@linkplain #isReadOnly() read-only}
1924
- * @throws UnsupportedOperationException if {@code value} is not a
1928
+ * @throws IllegalArgumentException if {@code value} is not a
1925
1929
* {@linkplain #isNative() native} segment
1930
+ * @throws IllegalArgumentException if this segment is
1931
+ * {@linkplain #isReadOnly() read-only}
1926
1932
*/
1927
1933
void set (AddressLayout layout , long offset , MemorySegment value );
1928
1934
@@ -2055,7 +2061,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
2055
2061
* @throws IllegalArgumentException if {@code layout.byteAlignment() > layout.byteSize()}
2056
2062
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize()} overflows
2057
2063
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize() > byteSize() - layout.byteSize()}
2058
- * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
2064
+ * @throws IllegalArgumentException if this segment is {@linkplain #isReadOnly() read-only}
2059
2065
*/
2060
2066
void setAtIndex (ValueLayout .OfByte layout , long index , byte value );
2061
2067
@@ -2078,7 +2084,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
2078
2084
* @throws IllegalArgumentException if {@code layout.byteAlignment() > layout.byteSize()}
2079
2085
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize()} overflows
2080
2086
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize() > byteSize() - layout.byteSize()}
2081
- * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
2087
+ * @throws IllegalArgumentException if this segment is {@linkplain #isReadOnly() read-only}
2082
2088
*/
2083
2089
void setAtIndex (ValueLayout .OfBoolean layout , long index , boolean value );
2084
2090
@@ -2101,7 +2107,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
2101
2107
* @throws IllegalArgumentException if {@code layout.byteAlignment() > layout.byteSize()}
2102
2108
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize()} overflows
2103
2109
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize() > byteSize() - layout.byteSize()}
2104
- * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
2110
+ * @throws IllegalArgumentException if this segment is {@linkplain #isReadOnly() read-only}
2105
2111
*/
2106
2112
void setAtIndex (ValueLayout .OfShort layout , long index , short value );
2107
2113
@@ -2146,7 +2152,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
2146
2152
* @throws IllegalArgumentException if {@code layout.byteAlignment() > layout.byteSize()}
2147
2153
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize()} overflows
2148
2154
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize() > byteSize() - layout.byteSize()}
2149
- * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
2155
+ * @throws IllegalArgumentException if this segment is {@linkplain #isReadOnly() read-only}
2150
2156
*/
2151
2157
void setAtIndex (ValueLayout .OfInt layout , long index , int value );
2152
2158
@@ -2191,7 +2197,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
2191
2197
* @throws IllegalArgumentException if {@code layout.byteAlignment() > layout.byteSize()}
2192
2198
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize()} overflows
2193
2199
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize() > byteSize() - layout.byteSize()}
2194
- * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
2200
+ * @throws IllegalArgumentException if this segment is {@linkplain #isReadOnly() read-only}
2195
2201
*/
2196
2202
void setAtIndex (ValueLayout .OfFloat layout , long index , float value );
2197
2203
@@ -2236,7 +2242,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
2236
2242
* @throws IllegalArgumentException if {@code layout.byteAlignment() > layout.byteSize()}
2237
2243
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize()} overflows
2238
2244
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize() > byteSize() - layout.byteSize()}
2239
- * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
2245
+ * @throws IllegalArgumentException if this segment is {@linkplain #isReadOnly() read-only}
2240
2246
*/
2241
2247
void setAtIndex (ValueLayout .OfLong layout , long index , long value );
2242
2248
@@ -2281,7 +2287,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
2281
2287
* @throws IllegalArgumentException if {@code layout.byteAlignment() > layout.byteSize()}
2282
2288
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize()} overflows
2283
2289
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize() > byteSize() - layout.byteSize()}
2284
- * @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
2290
+ * @throws IllegalArgumentException if this segment is {@linkplain #isReadOnly() read-only}
2285
2291
*/
2286
2292
void setAtIndex (ValueLayout .OfDouble layout , long index , double value );
2287
2293
@@ -2336,7 +2342,9 @@ static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long sr
2336
2342
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize()} overflows
2337
2343
* @throws IndexOutOfBoundsException if {@code index * layout.byteSize() > byteSize() - layout.byteSize()}
2338
2344
* @throws UnsupportedOperationException if this segment is {@linkplain #isReadOnly() read-only}
2339
- * @throws UnsupportedOperationException if {@code value} is not a {@linkplain #isNative() native} segment
2345
+ * @throws IllegalArgumentException if {@code value} is not a {@linkplain #isNative() native} segment
2346
+ * @throws IllegalArgumentException if this segment is
2347
+ * {@linkplain #isReadOnly() read-only}
2340
2348
*/
2341
2349
void setAtIndex (AddressLayout layout , long index , MemorySegment value );
2342
2350
@@ -2460,7 +2468,7 @@ static void copy(MemorySegment srcSegment, ValueLayout srcLayout, long srcOffset
2460
2468
* <a href="MemorySegment.html#segment-alignment">incompatible with the alignment constraint</a>
2461
2469
* in the source element layout
2462
2470
* @throws IllegalArgumentException if {@code dstLayout.byteAlignment() > dstLayout.byteSize()}
2463
- * @throws UnsupportedOperationException if {@code dstSegment} is {@linkplain #isReadOnly() read-only}
2471
+ * @throws IllegalArgumentException if {@code dstSegment} is {@linkplain #isReadOnly() read-only}
2464
2472
* @throws IndexOutOfBoundsException if {@code elementCount * dstLayout.byteSize()} overflows
2465
2473
* @throws IndexOutOfBoundsException if {@code dstOffset > dstSegment.byteSize() - (elementCount * dstLayout.byteSize())}
2466
2474
* @throws IndexOutOfBoundsException if {@code srcIndex > srcArray.length - elementCount}
0 commit comments