Conversation
- 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>
There was a problem hiding this comment.
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-clientapidependency. - Refactor HTML string building and some logic in
ScannerMethodsto 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.
| <artifactId>maven-compiler-plugin</artifactId> | ||
| <version>${maven.compiler.version}</version> | ||
| <configuration> | ||
| <release>11</release> | ||
| <release>17</release> | ||
| </configuration> |
There was a problem hiding this comment.
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).
| <release>17</release> | ||
| </configuration> |
There was a problem hiding this comment.
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.
Description
Related issue: JIRA_TICKET_NUMBER
Before submitting (or marking as "ready for review")