pietrobraione / jbse

A symbolic Java virtual machine for program analysis, verification and test generation
http://pietrobraione.github.io/jbse/
GNU General Public License v3.0
101 stars 29 forks source link

Unsafe.ensureClassInitialized is removed in JDK 22 #68

Closed cushon closed 5 months ago

cushon commented 5 months ago

jbse.meta.Analysis uses sun.misc.Unsafe.ensureClassInitialized, which is being removed in JDK 22: https://bugs.openjdk.org/browse/JDK-8316343

The method is used here:

https://github.com/pietrobraione/jbse/blob/5b1b121fe7b38e0171cdf81eb4c50f8babfbdf59/src/main/java/jbse/meta/Analysis.java#L474

The compilation error with JDK 22 is:

jbse/src/main/java/jbse/meta/Analysis.java:474: error: cannot find symbol
            if (!unsafe.shouldBeInitialized(classToCheck)) {
                       ^
  symbol:   method shouldBeInitialized(Class<CAP#1>)
  location: variable unsafe of type Unsafe
  where CAP#1 is a fresh type-variable:
    CAP#1 extends Object from capture of ?
pietrobraione commented 5 months ago

JBSE does not work with a JDK version different from 8: It is a Java 8 implementation that metacircularily reiles on a Java 8 JDK. Currently there are no plans to upgrade JBSE to later versions of the JDK.