[foreign-memaccess+abi] RFR: 8291286: Improve JavaDocs for static constructors in MemorySession
Maurizio Cimadamore
mcimadamore at openjdk.org
Wed Aug 3 15:22:47 UTC 2022
On Thu, 28 Jul 2022 11:58:35 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> This PR adds information to the static constructor methods in MemorySession to improve clarity for new users.
>>
>> This is my first PR for a JDK project so I am eager to receive feedback and improvement suggestions from the community.
>
> src/java.base/share/classes/java/lang/foreign/MemorySession.java line 295:
>
>> 293: * openShared(Cleaner.create()).asNonCloseable();
>> 294: * }
>> 295: * @return a non-closeable, thread-shared memory session, managed by a private {@link Cleaner} instance
>
> not a big fan of thread-shared... maybe better expand the text a bit (e.g. `returns a non-closeable memory session that can be shared across threads, ...`)
Actually I would borrow a bit from what you did for `openShared`:
@return a new closeable memory session that can be shared across threads
so:
@return a new non-closeable memory session that can be shared across threads, managed by ...
-------------
PR: https://git.openjdk.org/panama-foreign/pull/693
More information about the panama-dev
mailing list