Skip to content
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

Fix JSpecify generics code on JDK 21 #827

Closed
msridhar opened this issue Sep 4, 2023 · 0 comments · Fixed by #869
Closed

Fix JSpecify generics code on JDK 21 #827

msridhar opened this issue Sep 4, 2023 · 0 comments · Fixed by #869
Labels
jspecify Related to support for jspecify standard (see jspecify.dev)

Comments

@msridhar
Copy link
Collaborator

msridhar commented Sep 4, 2023

The code relies on constructing TypeMetadata$Entry objects, which no longer exist on JDK 21 due to this change:

openjdk/jdk@b9951dd

We'll have to do some reflection to make our code work on both JDK 21 and earlier JDKs.

@msridhar msridhar added the jspecify Related to support for jspecify standard (see jspecify.dev) label Sep 4, 2023
msridhar added a commit that referenced this issue Sep 5, 2023
It looks like most of our tests pass on JDK 21. Exceptions are the
JSpecify generics tests, which rely on an API that changed in JDK 21
(see #827), and the JarInfer tests, as it looks like WALA does not yet
support running on JDK 21 (see #829). Core NullAway support (ignoring
the experimental/WIP JSpecify mode) should be working. This PR adds test
configs so that we run tests on JDK 21 wherever possible. We update our
Jacoco and Mockito versions to make this work.

We also take the opportunity to move some common test configuration code
to the `nullaway.java-test-conventions.gradle` file, which previously
just held configuration for Jacoco.
msridhar added a commit that referenced this issue Jan 10, 2024
Our JSpecify mode would not run on JDK 21 due some some internal javac
API changes. This PR adapts to those changes using code specific to JDK
21.

Fixes #827

---------

Co-authored-by: Manu Sridharan <msridhar@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jspecify Related to support for jspecify standard (see jspecify.dev)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant