-
Bug
-
Resolution: Fixed
-
P3
-
22
-
b25
-
Verified
MemorySegment::reinterpret allows developers to specify a cleanup action - an action that should be executed when the arena associated with the reinterpreted segment is closed.
The custom cleanup action might throw some exceptions. Unfortunately, in the current API, Arena::close is only specified to throw IllegalStateException, UnsupportedOperationException or WrongThreadException, meaning that any exception thrown by the custom cleanup action would effectively violate the javadoc.
It would be better for cleanup action exceptions to be wrapped to some other runtime exception which is then specified to be part of the contract when calling Arena::close.
The custom cleanup action might throw some exceptions. Unfortunately, in the current API, Arena::close is only specified to throw IllegalStateException, UnsupportedOperationException or WrongThreadException, meaning that any exception thrown by the custom cleanup action would effectively violate the javadoc.
It would be better for cleanup action exceptions to be wrapped to some other runtime exception which is then specified to be part of the contract when calling Arena::close.
- csr for
-
JDK-8319929 Exceptions thrown by cleanup actions should be handled correctly
-
- Closed
-