Conversation
- Replace unused variables with underscore - Migrate to IO utility class - Use switch expression
There was a problem hiding this comment.
Pull request overview
This pull request migrates the codebase from Java 21 to Java 25, implementing several modern Java features:
- Replaces unused exception variables with underscore
_(JEP 443 - Unnamed Patterns and Variables) - Migrates from
System.out.println()toIO.println()utility class - Converts traditional switch statements to switch expressions
- Replaces
.get(0)with.getFirst()for better semantics - Updates Java version configuration across build and CI/CD files
Reviewed changes
Copilot reviewed 249 out of 250 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| build.gradle | Updates Java source and target compatibility from 21 to 25 |
| .github/workflows/*.yml | Updates CI/CD pipelines to use Java 25 |
| Test files (multiple) | Replaces unused exception variables with _, migrates to IO.println() |
| Main source files (multiple) | Same modernization patterns as test files |
| Switch statement files | Converts to switch expressions in SecurityFilterChainPostProcessor, SimpleSearchQueryConverter, StringUtilities |
| Collection access files | Replaces .get(0) with .getFirst() |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| void main() { | ||
| LdapSecurityConstants test = PasswordUtil.findAlgorithm("{sha}YaE1CJ6sVhov987e77A5db7QAPg=".getBytes()); | ||
| System.out.println(test); | ||
| IO.println(test); | ||
| } |
There was a problem hiding this comment.
The main method signature has been changed from public static void main(String[] args) to void main(). This breaks the standard Java main method contract and will prevent this class from being executed as an entry point. The signature should remain public static void main(String[] args) or follow Java 21+'s new main method conventions with void main(String[] args) if removing the args parameter is intentional.
| } | ||
|
|
||
| public static void main(String[] args) throws Exception { | ||
| void main(String[] args) throws IOException { |
There was a problem hiding this comment.
The main method signature has been changed from public static void main(String[] args) to void main(String[] args). While Java 21+ allows instance main methods, removing the public static modifiers will prevent this class from being executed as a standard entry point unless the launch mechanism specifically supports this feature. Consider keeping the traditional signature or documenting the execution requirements.
| with: | ||
| distribution: 'liberica' | ||
| java-version: '21' | ||
| java-version: '25' |
There was a problem hiding this comment.
do you plan to upgrade java within the normal patches or with a major version update ?
There was a problem hiding this comment.
No real functional changes, so it could be a minor bump
There was a problem hiding this comment.
On one side correct, on the other side it will affect our clients.
With this change the code is only compatible with java 25. As mentioned... we have an internal UAA repo where we build UAA from code and then colleagues needs to be informed to adopt to java 25 because with this PR it would not compile anymore.
There was a problem hiding this comment.
Good point. Yes, for those consuming from source, this would be an issue. It looks like we did do a major bump to v78 on the Java 21 changes, so should also do a major bump when we decide to merge this.
|
Need to update docker files, and uaa-release before merging this