It looks like the JNI local handles capacity isn't enough in System.c:
52724: // Ensure capacity for the array and for a string for each fixed length element
52724: if ((*env)->EnsureLocalCapacity(env, nstrings + 2) < 0) {
52724: return NULL;
52724: }
-Xcheck:jni gives an error:
STDOUT:
WARNING: JNI local refs: 74, exceeds capacity: 73
at jdk.internal.util.SystemProps$Raw.vmProperties(java.base/Native Method)
at jdk.internal.util.SystemProps$Raw.cmdProperties(java.base/SystemProps.java:253)
at jdk.internal.util.SystemProps.initProperties(java.base/SystemProps.java:55)
at java.lang.System.initPhase1(java.base/System.java:2004)
To reproduce run:
make test TEST=tools/javac/tree/MakeTypeTest.java JTREG="VM_OPTIONS=-Xcheck:jni"