[code-reflection] RFR: Validate arguments types when interpreting an operation [v4]

Paul Sandoz psandoz at openjdk.org
Tue Aug 5 14:21:27 UTC 2025


On Mon, 4 Aug 2025 16:19:34 GMT, Mourad Abbay <mabbay at openjdk.org> wrote:

>> We don't validate arguments types in the interpreter. This PR add the validation allowing us to catch invalid arguments early.
>
> Mourad Abbay has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Apply suggestion

Marked as reviewed by psandoz (Lead).

src/jdk.incubator.code/share/classes/jdk/incubator/code/interpreter/Interpreter.java line 113:

> 111:                     case PrimitiveType pt -> pt.box().orElseThrow();
> 112:                     case JavaType jt -> jt;
> 113:                     default -> throw new IllegalStateException("Unexpected value: " + sv.type());

Suggestion:

                    default -> throw new IllegalStateException("Unexpected type: " + sv.type());

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

PR Review: https://git.openjdk.org/babylon/pull/509#pullrequestreview-3088520734
PR Review Comment: https://git.openjdk.org/babylon/pull/509#discussion_r2254509313


More information about the babylon-dev mailing list