Skip to content

feat: Upgrade java 17#18

Closed
sr4850 wants to merge 7 commits intomainfrom
upgrade-java-21
Closed

feat: Upgrade java 17#18
sr4850 wants to merge 7 commits intomainfrom
upgrade-java-21

Conversation

@sr4850
Copy link
Copy Markdown
Contributor

@sr4850 sr4850 commented Feb 16, 2026

Description

Related issue: JIRA_TICKET_NUMBER

Before submitting (or marking as "ready for review")

  • Does the pull request title follow the conventional commit specification?
  • Have you performed a self-review of the code
  • Have you have added tests that prove the fix or feature is effective and working
  • Did you make sure to update any documentation relating to this change?

sr4850 and others added 6 commits February 16, 2026 10:23
- Updated Maven compiler plugin from 3.8.1 to 3.11.0
- Changed Java release from 11 to 21
- Modernized switch statement in setPolicyId() to use switch expressions
- Replaced string concatenations with text blocks for better readability
- Used String.formatted() instead of String.format() and concatenation
- Implemented pattern matching in extractUserId() method
- Added pattern matching with instanceof in headersAndResponseSummaryTable()
- Improved code readability and maintainability using Java 21 features

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Replace String.formatted() calls with String.format() for better compatibility
- Keep text blocks and other Java 21 features that work correctly
- Maintain all modernization improvements while ensuring compilation success

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Updated maven-compiler-plugin from 3.11.0 to 3.13.0 for proper Java 21 support
- Added explicit maven.compiler.source and maven.compiler.target properties
- Verified successful compilation and packaging with Java 21

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Changed from <release>21</release> to <source>21</source> and <target>21</target>
- Successfully compiles and packages with Java 21
- All Java 21 language features working correctly
- Build output shows 'debug target 21' confirming proper Java 21 usage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Updated zap-clientapi from 1.16.0 to 1.17.0
- Verified successful compilation and packaging with Java 21
- Ensures latest security updates and improved compatibility

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Changed Maven compiler source/target from 21 to 17
- Reverted Java 21-specific pattern matching to Java 17 compatible code
- Maintained all other modern features (switch expressions, text blocks)
- Successfully compiles and packages with Java 17
- Java 17 is LTS and more widely supported

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sr4850 sr4850 requested a review from Copilot February 16, 2026 11:06
@sr4850 sr4850 changed the title feat: Upgrade java 21 feat: Upgrade java 17 Feb 16, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the project from Java 11 to Java 17, leveraging modern Java features including text blocks, pattern matching for instanceof, and switch expressions. The changes modernize the codebase while maintaining the same functionality.

Changes:

  • Upgraded Java version from 11 to 17 and updated Maven compiler plugin to 3.13.0
  • Refactored string concatenation to use text blocks for improved HTML template readability
  • Replaced traditional switch statements with modern switch expressions

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/main/java/scanner/ScannerMethods.java Modernized code to use Java 17 features: text blocks for HTML strings, pattern matching instanceof, switch expressions, and improved String.format usage
pom.xml Updated Java source/target to 17, upgraded Maven compiler plugin to 3.13.0, and updated zap-clientapi to 1.17.0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +97 to +98
null, null, null, null, String.format("%s%s - %d", reportName, date, seconds), null,
String.format("%s/%s", System.getProperty("user.dir"), dir), null);
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

The report output path is built with a hardcoded '/' separator (String.format("%s/%s", ...)), which is not portable across OSes. Prefer dir.getAbsolutePath() or Paths.get(System.getProperty("user.dir"), dir.getPath()).toString() / File(base, child) to construct the path safely.

Suggested change
null, null, null, null, String.format("%s%s - %d", reportName, date, seconds), null,
String.format("%s/%s", System.getProperty("user.dir"), dir), null);
null, null, null, null, String.format("%s%s - %d", reportName, date, seconds), null,
new File(System.getProperty("user.dir"), dir.getPath()).getAbsolutePath(), null);

Copilot uses AI. Check for mistakes.
Comment on lines +13 to 16
<maven.compiler.version>3.13.0</maven.compiler.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<github.url>https://maven.pkg.github.com/dvsa/vol-app-security-lib</github.url>
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

<maven.compiler.source> and <maven.compiler.target> are defined as properties, but the maven-compiler-plugin config below hardcodes 17 instead of referencing these properties. Consider wiring the plugin values to the properties (or removing the unused properties) to avoid configuration drift.

Copilot uses AI. Check for mistakes.
Comment on lines 25 to 28
<configuration>
<release>11</release>
<source>17</source>
<target>17</target>
</configuration>
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

Consider using 17 instead of separate /. ensures the correct platform APIs are targeted and is the recommended maven-compiler-plugin configuration for reproducible builds.

Copilot uses AI. Check for mistakes.
Comment on lines +48 to +52
</tr>
<p></p>
<p></p>
<p></p>
<p></p>""", this.reportURL, this.reportURL);
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

This summary table HTML inserts multiple

elements directly inside a (outside any /
) and doesn’t close the table, which is invalid markup and can render inconsistently. Consider using CSS spacing or spacer
rows, and ensure the table is properly closed.

Copilot uses AI. Check for mistakes.
Comment on lines +61 to +65
<table width=45%% border=0>
<tr bgcolor=#666666>
<h3>Server Requests and Responses</h3><div class=spacer></div>
<td width=50%%>Request</td>
<td width=50%%><p>Response</p></td>""");
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

The header markup is not valid table structure:

and
are placed directly inside a rather than within a /, and the opening isn’t closed before additional rows are appended. Move the heading outside the table (or use ) and ensure each row has proper ... with cells.

Copilot uses AI. Check for mistakes.
@sr4850 sr4850 closed this Feb 16, 2026
@sr4850 sr4850 deleted the upgrade-java-21 branch February 16, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants