[foreign-memaccess+abi] RFR: 8296315: Add get/set-AtIndex methods for byte, boolean [v2]

Jorn Vernee jvernee at openjdk.org
Fri Feb 10 00:13:12 UTC 2023


On Thu, 3 Nov 2022 15:03:59 GMT, RedIODev <duke at openjdk.org> wrote:

>> This PR adds the left out getAtIndex and setAtIndex methods for byte and boolean to java.lang.foreign.MemorySegment.java
>
> RedIODev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   added tests to TestMemoryAccessInstance

During some last minute testing it turned out there are some compilation failures after rebasing on the latest `foreign-memaccess+abi` branch, due to classes being renamed, and the javadoc still pointing to the old class name.

I've added the needed doc changes as inline suggestions. You should be able to easily apply them from GitHub.

Sorry about that.

src/java.base/share/classes/java/lang/foreign/MemorySegment.java line 1720:

> 1718:      * {@linkplain MemorySession#isAlive() alive}.
> 1719:      * @throws WrongThreadException if this method is called from a thread other than the thread owning
> 1720:      * the {@linkplain #session() session} associated with this segment.

Suggestion:

     * @throws IllegalStateException if the {@linkplain #scope() scope} associated with this segment is not
     * {@linkplain SegmentScope#isAlive() alive}.
     * @throws WrongThreadException if this method is called from a thread {@code T},
     * such that {@code scope().isAccessibleBy(T) == false}.

src/java.base/share/classes/java/lang/foreign/MemorySegment.java line 1744:

> 1742:      * {@linkplain MemorySession#isAlive() alive}.
> 1743:      * @throws WrongThreadException if this method is called from a thread other than the thread owning
> 1744:      * the {@linkplain #session() session} associated with this segment.

Suggestion:

     * @throws IllegalStateException if the {@linkplain #scope() scope} associated with this segment is not
     * {@linkplain SegmentScope#isAlive() alive}.
     * @throws WrongThreadException if this method is called from a thread {@code T},
     * such that {@code scope().isAccessibleBy(T) == false}.

src/java.base/share/classes/java/lang/foreign/MemorySegment.java line 1769:

> 1767:      * {@linkplain MemorySession#isAlive() alive}.
> 1768:      * @throws WrongThreadException if this method is called from a thread other than the thread owning
> 1769:      * the {@linkplain #session() session} associated with this segment.

Suggestion:

     * @throws IllegalStateException if the {@linkplain #scope() scope} associated with this segment is not
     * {@linkplain SegmentScope#isAlive() alive}.
     * @throws WrongThreadException if this method is called from a thread {@code T},
     * such that {@code scope().isAccessibleBy(T) == false}.

src/java.base/share/classes/java/lang/foreign/MemorySegment.java line 1793:

> 1791:      * {@linkplain MemorySession#isAlive() alive}.
> 1792:      * @throws WrongThreadException if this method is called from a thread other than the thread owning
> 1793:      * the {@linkplain #session() session} associated with this segment.

Suggestion:

     * @throws IllegalStateException if the {@linkplain #scope() scope} associated with this segment is not
     * {@linkplain SegmentScope#isAlive() alive}.
     * @throws WrongThreadException if this method is called from a thread {@code T},
     * such that {@code scope().isAccessibleBy(T) == false}.

-------------

Changes requested by jvernee (Committer).

PR: https://git.openjdk.org/panama-foreign/pull/747


More information about the panama-dev mailing list