-
Notifications
You must be signed in to change notification settings - Fork 41.4k
Add Java 15 CI #21713
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
Add Java 15 CI #21713
Conversation
Thanks for the PR @dreis2211
This was required when Gradle does not support the target JDK which does not seem to be case with Java15 at this point. I don't see this PR using that feature either so I am a bit confused. Switching my local JDK to Java 15ea and building |
@snicoll You're absolutely right. I was under the impression that I'm getting the same results with the custom home property being set. |
No, it does not. I have a compilation failure:
and one test failure before I gave up:
This in a branch of your first PR I am about to merge. Maybe something is cached and shouldn't be?
|
I guess the first one can be explained by |
In JDK 15 the concept of hidden classes was introduced, which also affects Lambdas in so far that Class.getCanonicalName() will return null for those. Using Class.getName() works around that behavior change. See spring-projectsgh-21604
JDK 15 introduces isEmpty() on CharSequence which clashes with the one declared in StringSequence because it is not public. See spring-projectsgh-21604
I've pushed two additional commits that fix the syntax error and the failure in |
I see some intermittent failures for tests that all seem to be related to timing. I wonder if https://bugs.openjdk.java.net/browse/JDK-8242504 is related as this got introduced recently as well. |
I've also seen some flaky tests that are annotated with |
I just tried with JDK 14 and see similar flaky failures there as well. Particularly, the "performance" tests |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're almost done here but there is one change I'd like us to reconsider. I've added a comment
@@ -29,7 +29,7 @@ | |||
private final String className; | |||
|
|||
HandlerFunctionDescription(HandlerFunction<?> handlerFunction) { | |||
this.className = handlerFunction.getClass().getCanonicalName(); | |||
this.className = handlerFunction.getClass().getName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should do this. Perhaps as a fallback if getCanonicalName
is empty? It's a change of format so it's a breaking change.
Or perhaps we could adapt the test? I haven't looked in details yet so thinking out loud.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote to the core-libs mailing list a week ago, I think, and got this reply.
A hidden class has no canonical name [1] and it can't be nominally referenced [...] For diagnosiability, Class::getName or Class::toString can be used.
As HandlerFunction
is often a lambda, it will probably often return null on JDK 15 at least. I don't have a problem with the fallback idea. In reality, there will be only a change for inner classes though. See the following example output from JDK 14 of canonical vs name:
com.example.demo.Example$$Lambda$14/0x0000000800b66c40
com.example.demo.Example$$Lambda$14/0x0000000800b66c40
com.example.demo.AFunction
com.example.demo.AFunction
com.example.demo.Example.InnerFunction
com.example.demo.Example$InnerFunction
Give me a minute to implement the fallback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Trying with 15-ea-27 introduced a change for missing Javadocs: https://bugs.openjdk.java.net/browse/JDK-8242607 That produces quite a lot of warnings like the following:
It's not breaking the builds, so I guess it's fine for this PR, but probably needs to be tackled in another one. |
Ah ah. I was building locally and I've already polished that checkstyle issue here Christoph. |
Sorry - I've noticed this one just now. :/ |
In JDK 15 the concept of hidden classes was introduced, which also affects Lambdas in so far that Class.getCanonicalName() will return null for those. This commit uses Class.getName() as a fallback when no canonical name is available. See gh-21713
JDK 15 introduces isEmpty() on CharSequence which clashes with the one declared in StringSequence because it is not public. See gh-21713
Hi,
this PR tackles #21604 as discussed. Fortunately, even the automatic JDK upgrade should already work.
Before merging this, #21605 needs to be merged. Apart from that I haven't seen any test failures when I run with the custom
buildJavaHome
property being set to my local JDK 15 installation.Cheers,
Christoph