Skip to content

Commit 34122b2

Browse files
authored
Merge pull request #14 from minborg/small-javadoc
Update some javadocs
2 parents 0d256f3 + 83a86be commit 34122b2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/java.base/share/classes/java/lang/foreign/MemorySegment.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@
398398
* @implSpec
399399
* Implementations of this interface are immutable, thread-safe and <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>.
400400
*
401+
* @sealedGraph
401402
* @since 19
402403
*/
403404
@PreviewFeature(feature=PreviewFeature.Feature.FOREIGN)
@@ -549,7 +550,7 @@ default MemorySegment asSlice(long offset) {
549550
* can be computed as follows:
550551
*
551552
* {@snippet lang=java :
552-
* other.address() - segment.baseAddress()
553+
* other.address() - segment.address()
553554
* }
554555
*
555556
* If the segments share the same address, {@code 0} is returned. If
@@ -881,7 +882,7 @@ default MemorySegment copyFrom(MemorySegment src) {
881882
* @return a Java string constructed from the bytes read from the given starting address up to (but not including)
882883
* the first {@code '\0'} terminator character (assuming one is found).
883884
* @throws IllegalArgumentException if the size of the UTF-8 string is greater than the largest string supported by the platform.
884-
* @throws IndexOutOfBoundsException if {@code S + offset > byteSize()}, where {@code S} is the size of the UTF-8
885+
* @throws IndexOutOfBoundsException if {@code offset < 0} or {@code S + offset > byteSize()}, where {@code S} is the size of the UTF-8
885886
* string (including the terminator character).
886887
* @throws IllegalStateException if the {@linkplain #session() session} associated with this segment is not
887888
* {@linkplain MemorySession#isAlive() alive}.
@@ -907,7 +908,7 @@ default String getUtf8String(long offset) {
907908
* @param offset offset in bytes (relative to this segment address) at which this access operation will occur.
908909
* the final address of this write operation can be expressed as {@code address() + offset}.
909910
* @param str the Java string to be written into this segment.
910-
* @throws IndexOutOfBoundsException if {@code str.getBytes().length() + offset >= byteSize()}.
911+
* @throws IndexOutOfBoundsException if {@code offset < 0} or {@code str.getBytes().length() + offset >= byteSize()}.
911912
* @throws IllegalStateException if the {@linkplain #session() session} associated with this segment is not
912913
* {@linkplain MemorySession#isAlive() alive}.
913914
* @throws WrongThreadException if this method is called from a thread other than the thread owning

0 commit comments

Comments
 (0)