Skip to content

Build the Java models library with JDK 22 and newer - #9566

Draft
tautschnig wants to merge 1 commit into
diffblue:developfrom
tautschnig:kiro/bump-java-models-jdk25
Draft

tautschnig wants to merge 1 commit into
diffblue:developfrom
tautschnig:kiro/bump-java-models-jdk25

Conversation

@tautschnig

Copy link
Copy Markdown
Collaborator

Depends-on: diffblue/java-models-library#52

The java-models-library submodule did not compile with JDK 22 and newer: javac rejects the statement in the constructor of the models' java.lang.Object with -source 8 ("flexible constructors is not supported"), and JDK 24 removed ClassLoader.checkClassLoaderPermission, which the models' java.lang.Class called. Ubuntu 26.04, and with it GitHub's ubuntu-latest runners, default to JDK 25, so that the CodeQL workflow currently fails to build JBMC.

Update the submodule to a commit that applies the fix of diffblue/java-models-library#49 to the version of the models that we use. It only changes these two files, and (built with JDK 21) the bytecode differs only in the constructor of Object no longer storing 0 (the default value) to cproverMonitorCount, in the removed call, and in constant-pool indices. Updating to the current
master of the models instead would also bring in new models, with which more than 100 JBMC regression tests fail (e.g., as Class.forName now fails an assertion for classes that are not modelled).

With models built by JDK 25, all JBMC, janalyzer, jdiff and Java unit tests pass. Update COMPILING.md, which said that JDK 22 and newer do not work.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

The java-models-library submodule did not compile with JDK 22 and
newer: javac rejects the statement in the constructor of the models'
java.lang.Object with -source 8 ("flexible constructors is not
supported"), and JDK 24 removed ClassLoader.checkClassLoaderPermission,
which the models' java.lang.Class called. Ubuntu 26.04, and with it
GitHub's ubuntu-latest runners, default to JDK 25, so that the CodeQL
workflow currently fails to build JBMC.

Update the submodule to a commit that applies the fix of
diffblue/java-models-library#49 to the version of the models that we
use. It only changes these two files, and (built with JDK 21) the
bytecode differs only in the constructor of Object no longer storing 0
(the default value) to cproverMonitorCount, in the removed call, and in
constant-pool indices. Updating to the current
master of the models instead would also bring in new models, with which
more than 100 JBMC regression tests fail (e.g., as Class.forName now
fails an assertion for classes that are not modelled).

With models built by JDK 25, all JBMC, janalyzer, jdiff and Java unit
tests pass. Update COMPILING.md, which said that JDK 22 and newer do not
work.

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant