JetBrains / JetBrainsRuntime

Runtime environment based on OpenJDK for running IntelliJ Platform-based products on Windows, macOS, and Linux
GNU General Public License v2.0
1.28k stars 193 forks source link

JBR-6647 Disable check for final field access from method $$ha$clinit #309

Closed skybber closed 6 months ago

skybber commented 6 months ago

Kotlin compiler can create a new static variable INSTANCE on redefinition, that is normally initialized by <clinit>, but in case of redefinition the initializer is not called, since instances of static variables from old class must be preserved and initizelizer for a new class shoudl initialize only new variables. So it is not work for JVM level dcevm, but for high level agent. HotswapAgent solves the problem creating static method $$ha$clinit, that serves for initialization of new static varables.