Skip to content

feat:Upgrade java 17#19

Merged
sr4850 merged 7 commits intomainfrom
upgrade-java-17
Feb 16, 2026
Merged

feat:Upgrade java 17#19
sr4850 merged 7 commits intomainfrom
upgrade-java-17

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 7 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>
- Use <release>17</release> instead of separate source/target for better reproducibility
- Remove unused maven.compiler.source/target properties to avoid configuration drift
- Fix cross-platform path construction using File.getAbsolutePath()
- Fix invalid HTML markup in createReportSummaryTable (remove <p> tags outside table)
- Fix invalid HTML table structure in headersAndResponseSummaryTable (move <h3> outside table)
- Improve string formatting spacing consistency with proper spacing around dash
- Ensure proper table closing tags for valid HTML markup

All review comments addressed while maintaining Java 17 compatibility and functionality.

Co-authored-by: Copilot <223556219+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

Updates the project to target Java 17 and modernizes parts of the codebase to use Java 17 language features, alongside a dependency/tooling refresh.

Changes:

  • Upgrade Maven compiler target from Java 11 to Java 17 (and bump maven-compiler-plugin version).
  • Upgrade zap-clientapi dependency.
  • Refactor HTML string building and some logic in ScannerMethods to use Java 17 features (text blocks, switch expressions, pattern matching).

Reviewed changes

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

File Description
pom.xml Targets Java 17 (<release>17</release>) and updates plugin/dependency versions to support the upgrade.
src/main/java/scanner/ScannerMethods.java Refactors string construction and switch logic to Java 17 constructs; minor logging improvement.

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

Comment on lines 21 to 25
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<release>11</release>
<release>17</release>
</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.

The project now compiles with release 17, but the GitHub Actions workflows still set up JDK 11 (e.g. .github/workflows/cd.yaml and security.yaml). Those jobs will fail once this merges unless the workflows are updated to install/use JDK 17 (or the shared Maven workflow is updated to always set up the right Java version).

Copilot uses AI. Check for mistakes.
Comment on lines +24 to 25
<release>17</release>
</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.

Bumping the compiler release from 11 to 17 is a breaking change for any downstream consumers still on Java 11. Consider reflecting this as a breaking change in release/versioning (e.g., conventional commit with breaking indicator and/or a major version bump via release tooling) so consumers aren’t surprised by runtime/bytecode incompatibility.

Copilot uses AI. Check for mistakes.
@sr4850 sr4850 merged commit 56a43f8 into main Feb 16, 2026
11 checks passed
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.

3 participants