RFR: 8374113: Taughtological if check in Reflection::array_set

Stefan Karlsson stefank at openjdk.org
Fri Dec 19 16:34:52 UTC 2025


On Fri, 19 Dec 2025 15:48:05 GMT, Chen Liang <liach at openjdk.org> wrote:

> This one seems safe because this seems only used by `Array.set` and the primitive overloads. I checked `JVM_SetArrayElement` and `JVM_SetPrimitiveArrayElement` callers in `Array.c`. However note that `java.lang.reflect.Array` is poorly tested/covered, so please help check if there are other sites that can pass in inconsistent array oop + value type.

Thanks for taking a look at this!

There are no other callers to Reflection::array_set. And if there are future additions that are problematic then those should be found by the added assert.

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

PR Comment: https://git.openjdk.org/jdk/pull/28921#issuecomment-3675719259


More information about the hotspot-runtime-dev mailing list