Private implementation detail of `System.arraycopy` in OpenJ9 builds results in casts to parameters being generated for all invocations of method
jellysquid3 opened this issue · 1 comments
When OpenJ9 is used during ForgeGradle's decompile process, additional parameter casts are generated when calling System#arrayCopy(Object, int, Object, int, int)
in the produced source code.
For HotSpot builds, the following code may be produced:
System.arraycopy(arr1, 0, arr2, 0, arr2.length);
When using OpenJ9 builds, the following code will instead be generated:
System.arraycopy((Object) arr1, 0, (Object) arr2, 0, arr2.length);
This can lead to issues such as MinecraftForge/ForgeGradle#597, where patches expecting there to be no additional cast fail.
The only difference that can be seen between the OpenJ9 and HotSpot builds for this method is that OpenJ9 includes a private reference implementation alongside it. I suspect this is the reason the cast is produced, as two methods exist with different parameter types.
Likely also the cause of MinecraftForge/ForgeGradle#595.