On Thu, 8 May 2025 16:06:27 GMT, Chen Liang <li...@openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/ClassValue.java line 241:
>> 
>>> 239:                 } else {
>>> 240:                     throw ex instanceof Error err ? err : new 
>>> Error(ex);
>>> 241:                 }
>> 
>> Hello Chen, i think this if/else for exception type checks can instead just 
>> be replaced with an unconditional `throw ex`;
>
> I tried that and failed compilation before

This could also use `jdk.internal.misc.Unsafe​::throwException​(Throwable)`:

Unsafe.getUnsafe().throwException(ex);
return null;

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24043#discussion_r2261045331

Reply via email to