-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when running on Java 21-ea #310
Comments
I've downloaded https://search.maven.org/artifact/com.blazebit/blaze-persistence-integration-graphql-spqr/1.6.8/jar and trying to index it with these JDKs:
They both seem to work just fine (as in, they write an index file and don't fail). Could you please provide a JAR on which indexing fails? Alternatively, a stack trace might be enough ( |
The problem appears when the module is compiled with the Java 21 class file version. I guess it doesn't really matter what the content of the JAR file is, as long as there is one class file compiled with the latest version. |
So far, I reproduced this issue locally with Azul Zulu JDK 21-ea build 22. Here is the JAR (added .zip to the end because GitHub doesn't allow uploading JAR files): Here is the full error:
|
No, that doesn't seem to reproduce. Do you have a Maven project I can clone and build myself? https://github.com/Blazebit/blaze-persistence doesn't seem to use Jandex 3.1.1 anywhere 🤔 |
I do. Checkout the contents of this PR and first build with It will fail at that module, but then you can build just that single module by appending |
And don't forget to make sure that your |
OK, reproduced it now. Thanks! |
OK, the issue is caused by the performance improvements made in Jandex 3.1.0. As part of those improvements, the hash table used for object interning was refactored to be more type-safe (with one subclass of the hash table per interned type), but the |
I kept digging, because while my last comment is correct, there must be more to it, and indeed I found a really strange behavior of JDK 21. Say I have these 2 classes: public class Foo {
public Foo(String... strings) {
}
} public class Bar {
public Foo getFoo() {
return new Foo() {};
}
} Then compiling them using JDK 8, 11, 17:
JDK 21-ea:
That is, |
Aside: if
|
For historical reference, here are JDK issues that explain the differences in bytecode demonstrated above: |
Trying to run the 3.1.1 Maven plugin with Java 21-ea, I get the following error:
Any idea what the issue could be?
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /home/runner/.m2/wrapper/dists/apache-maven-3.6.3-bin/1iopthnavndlasol9gbrbg6bf2/apache-maven-3.6.3
Java version: 21-ea, vendor: Azul Systems, Inc., runtime: /opt/hostedtoolcache/Java_Zulu_jdk/21.0.0-ea.22/x64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.15.0-1037-azure", arch: "amd64", family: "unix"
The text was updated successfully, but these errors were encountered: