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

Adam Sotona asotona at openjdk.org
Fri Jan 16 09:31:01 UTC 2026


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`.

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

Commit messages:
 - fix of the infinite recursion test
 - break infinite recursion in ReflectMethods

Changes: https://git.openjdk.org/babylon/pull/849/files
  Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=849&range=00
  Stats: 10 lines in 1 file changed: 7 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/babylon/pull/849.diff
  Fetch: git fetch https://git.openjdk.org/babylon.git pull/849/head:pull/849

PR: https://git.openjdk.org/babylon/pull/849


More information about the babylon-dev mailing list