Skip to content

Comments

Java 21#28605

Open
alexduf wants to merge 5 commits intomainfrom
adu-java-21
Open

Java 21#28605
alexduf wants to merge 5 commits intomainfrom
adu-java-21

Conversation

@alexduf
Copy link
Contributor

@alexduf alexduf commented Feb 12, 2026

Move the project to java 21

I've had to do a few things following the move to java 21:

  • There was one use of reflection which I wasn't sure was still going to work. But we didn't need to use reflection anymore so I've just removed it
  • There were two deprecated calls to fetch how much RAM is being used by the JVM, I've replaced them
  • Java 21 deprecates the construction of java.net.URL. We were only using java.net.URL for parsing, so it was just a matter of replacing by java.net.URI, which has almost the same behaviour. I've noticed that one of our unit test failed with a null pointer exception, and I think potentially java.net.URI can return null in places that didn't return null on java.net.URL, so we'll keep an eye on the logs after releasing this
  • Finally, Mockito (which is using some pretty deep JVM stuff) needed to be upgraded too, which meant changing quite a few imports and some slight tweaks to our tests.

@alexduf alexduf added the maintenance Departmental tracking: maintenance work, not a fix or a feature label Feb 12, 2026
@alexduf alexduf force-pushed the adu-java-21 branch 2 times, most recently from d802015 to c763385 Compare February 13, 2026 10:14
The phone number library now supports the feature we need
@alexduf alexduf force-pushed the adu-java-21 branch 3 times, most recently from 72e8bac to 497d612 Compare February 13, 2026 14:01
The java.net.URL implementation always does DNS resolution, which is bad when it's mostly used for its URL parsing ability. URI should be used for that
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

@alexduf alexduf marked this pull request as ready for review February 13, 2026 15:12
@alexduf alexduf requested a review from a team as a code owner February 13, 2026 15:12
@alexduf
Copy link
Contributor Author

alexduf commented Feb 13, 2026

smoke tested in CODE ✅

@SiAdcock SiAdcock linked an issue Feb 14, 2026 that may be closed by this pull request
Copy link
Member

@arelra arelra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📈 🎉

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

Labels

maintenance Departmental tracking: maintenance work, not a fix or a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade frontend to Java 21

2 participants