[code-reflection] RFR: throw instead returning when erasing checked to unchecked exception

Hannes Greule hgreule at openjdk.org
Wed Jan 17 10:58:14 UTC 2024


On Wed, 17 Jan 2024 10:09:30 GMT, Hannes Greule <hgreule at openjdk.org> wrote:

>> As discussed in https://mail.openjdk.org/pipermail/babylon-dev/2024-January/000006.html, I change the `erase` method to `eraseAndThrow` and added a test as suggested. I ensured that the test fails without my change and does not fail with it.
>
> test/jdk/java/lang/reflect/code/interpreter/TestThrowing.java line 45:
> 
>> 43:         Method method = TestThrowing.class.getDeclaredMethod(methodName);
>> 44:         try {
>> 45:             Interpreter.invoke(method.getCodeModel().orElseThrow(), List.of());
> 
> Note I had to add `List.of()` here as the interpreter otherwise throws an exception because of mismatching parameter sizes. I assume that's a bug too? If you want, I can look into that as well.

Can't reproduce it anymore. Not sure what I did wrong before.

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

PR Review Comment: https://git.openjdk.org/babylon/pull/2#discussion_r1455243472


More information about the babylon-dev mailing list