[code-reflection] RFR: Break infinite recursion in ReflectMethods::typeToTypeElement

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Jan 16 10:34:38 UTC 2026


On Thu, 15 Jan 2026 19:25:34 GMT, Adam Sotona <asotona at openjdk.org> wrote:

> Following piece of code to crash our compilation with `StackOverflowError`:
> 
>  @Reflect
>  <E extends Enum<E>> void crash(Enum<E> e) {}
> 
> 
> This PR breaks the infinite recursion in `ReflectMethods::typeToTypeElement`.

Looks good for now, I will add a more detailed comment later explaining the situation we face here.

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

Marked as reviewed by mcimadamore (Reviewer).

PR Review: https://git.openjdk.org/babylon/pull/849#pullrequestreview-3670128745


More information about the babylon-dev mailing list