mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8345186: Incorrect @throws doc for MemorySegment::getString
Reviewed-by: mcimadamore, jvernee
This commit is contained in:
parent
6fa5cea984
commit
39cdadfb6a
1 changed files with 8 additions and 11 deletions
|
@ -1277,9 +1277,9 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
|
|||
* @throws IllegalArgumentException if the size of the string is greater than the
|
||||
* largest string supported by the platform
|
||||
* @throws IndexOutOfBoundsException if {@code offset < 0}
|
||||
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - (B + 1)}, where
|
||||
* {@code B} is the size, in bytes, of the string encoded using UTF-8 charset
|
||||
* {@code str.getBytes(StandardCharsets.UTF_8).length})
|
||||
* @throws IndexOutOfBoundsException if no string terminator (e.g. {@code '\0'}) is
|
||||
* present in this segment between the given {@code offset} and the end of
|
||||
* this segment.
|
||||
* @throws IllegalStateException if the {@linkplain #scope() scope} associated with
|
||||
* this segment is not {@linkplain Scope#isAlive() alive}
|
||||
* @throws WrongThreadException if this method is called from a thread {@code T},
|
||||
|
@ -1315,14 +1315,11 @@ public sealed interface MemorySegment permits AbstractMemorySegmentImpl {
|
|||
* @throws IllegalArgumentException if the size of the string is greater than the
|
||||
* largest string supported by the platform
|
||||
* @throws IndexOutOfBoundsException if {@code offset < 0}
|
||||
* @throws IndexOutOfBoundsException if {@code offset > byteSize() - (B + N)}, where:
|
||||
* <ul>
|
||||
* <li>{@code B} is the size, in bytes, of the string encoded using the
|
||||
* provided charset (e.g. {@code str.getBytes(charset).length});</li>
|
||||
* <li>{@code N} is the size (in bytes) of the terminator char according
|
||||
* to the provided charset. For instance, this is 1 for
|
||||
* {@link StandardCharsets#US_ASCII} and 2 for {@link StandardCharsets#UTF_16}.</li>
|
||||
* </ul>
|
||||
* @throws IndexOutOfBoundsException if no string terminator (e.g. {@code '\0'}) is
|
||||
* present in this segment between the given {@code offset} and the end of
|
||||
* this segment. The byte size of the string terminator depends on the
|
||||
* selected {@code charset}. For instance, this is 1 for
|
||||
* {@link StandardCharsets#US_ASCII} and 2 for {@link StandardCharsets#UTF_16}
|
||||
* @throws IllegalStateException if the {@linkplain #scope() scope} associated with
|
||||
* this segment is not {@linkplain Scope#isAlive() alive}
|
||||
* @throws WrongThreadException if this method is called from a thread {@code T},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue