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

Java 21 #261

Merged
merged 29 commits into from
Dec 2, 2023
Merged

Java 21 #261

merged 29 commits into from
Dec 2, 2023

Conversation

kriegaex
Copy link
Contributor

Closes #260

Signed-off-by: Alexander Kriegisch <[email protected]>
Signed-off-by: Alexander Kriegisch <[email protected]>
Background: JDT Core dependencies now contain hundreds of Java 17 class
files, i.e. Ajc now requires Java 17+ runtime environment. :-(
For more details, see:
#260 (comment)

Adoptium Java 21 release is not available yet, so we need to run on EA.

Signed-off-by: Alexander Kriegisch <[email protected]>
@kriegaex kriegaex self-assigned this Sep 27, 2023
@kriegaex kriegaex added the enhancement New feature or request label Sep 27, 2023
@kriegaex kriegaex added this to the 1.9.21 milestone Sep 27, 2023
Signed-off-by: Alexander Kriegisch <[email protected]>
Signed-off-by: Alexander Kriegisch <[email protected]>
While trying to understand the code a bit better in order to fix failing
builds, I applied some cosmetic refactoring and reformatting. This
commit does not change any functionality.

Whether the static import of CompilationAndWeavingContext.* is a good
thing or not is debatable, but I like the code to be less chatty than it
was before, assuming that every developer uses an IDE helping to find
out where static methods and constants come from.

Signed-off-by: Alexander Kriegisch <[email protected]>
…disabled"

In JDK 21, the prefix has changed once again, no longer being a JVM
specifier like "OpenJDK 64-Bit Server VM" or "Java HotSpot(TM) 64-Bit
Server VM" but rather something like "[0.016s][warning][cds]".

Even worse, before J21, the warning appears on stdErr, but in J21+, it
appears on stdOut.

Fixes LTWTests.testJ14LTWWithXML, which started failing on Java 21.

Signed-off-by: Alexander Kriegisch <[email protected]>
The tests and their XML definitions are still copy & paste and need to
be cleaned up. Separate Java 21 feature tests do not exist yet.

Signed-off-by: Alexander Kriegisch <[email protected]>
Since JDK 21, a public main method of a non-public (e.g. default-scoped)
class can no longer be invoked without making it accessible first.
Because many test sources contain multiple aspects and classes in one
file, this is a frequent use case.

Signed-off-by: Alexander Kriegisch <[email protected]>
This mostly affects pattern matching for switch and record patterns.

Two tests which were working before for pattern matching for switch
(preview 4), started to fail, so the corresponding code was commented
out and eclipse-jdt/eclipse.jdt.core#1466
recorded.

Signed-off-by: Alexander Kriegisch <[email protected]>
@driverpt
Copy link

Any ETA on this one ?

Signed-off-by: Alexander Kriegisch <[email protected]>
Two test classes which had redundant default clauses for switch with
record patterns were copied from the java19 to the java21 directory and
the redundant clauses deactivated, i.e. the test now run as originally
intended. For older JDK versions, the old tests still stay active in
order to document the old state of affairs.

Signed-off-by: Alexander Kriegisch <[email protected]>
Signed-off-by: Alexander Kriegisch <[email protected]>
Signed-off-by: Alexander Kriegisch <[email protected]>
Sonatype has not solved the problems in Nexus Staging Maven Plugin for
years, so it makes sense to document them.

Signed-off-by: Alexander Kriegisch <[email protected]>
Filter out a warning which occurs, if the current release does not match
the stored binary in lib/test:

  bad version number found in aspectjrt.jar
  expected 1.9.21.M1 found 1.9.20.1

If e.g. we run tests for a milestone release a.b.5.M1 and afterwards
switch back to a.b.5-SNAPSHOT, we do not want to update lib/test for a
single commit, just to make this test pass. Hence, we ignore this
warning here.

Signed-off-by: Alexander Kriegisch <[email protected]>
This file was missing, which did not trigger an error in CI builds,
because AllTestsAspectJ1921 was not part of the AllTests19 suite before.
The latter will be fixed in the next commit.

Signed-off-by: Alexander Kriegisch <[email protected]>
Until now, the CI build did not run Java 21 tests, but they look OK
locally. Now, let's find out what GitHub Actions says.

Signed-off-by: Alexander Kriegisch <[email protected]>
More exactly:
Eclipse Compiler c13b03ceabf0c1 (26Nov2023) - Java21

Signed-off-by: Alexander Kriegisch <[email protected]>
Mostly StringBuffer -> StringBuilder API changes

Signed-off-by: Alexander Kriegisch <[email protected]>
Signed-off-by: Alexander Kriegisch <[email protected]>
Signed-off-by: Alexander Kriegisch <[email protected]>
@kriegaex kriegaex merged commit dfd6e38 into master Dec 2, 2023
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Java 21 support
2 participants