Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 13, 2025

Description

Rolls back project from Java 25 to Java 17 for Elastic Beanstalk deployment compatibility.

Changes

Build Configuration

  • Updated java.version property to 17 in root POM
  • Updated all GitHub Actions workflows to use JDK 17
  • Updated devcontainer configuration to Java 17 image

Code Compatibility

  • Refactored switch pattern matching to if-else in StatementHttpMessageWriter.java:
    // Before (Java 21+ pattern matching)
    final Stream<Attachment> attachments = switch (object) {
      case Statement statement -> getRealAttachments(statement);
      case List<?> statements when !statements.isEmpty() -> ...;
      default -> null;
    };
    
    // After (Java 17 compatible)
    final Stream<Attachment> attachments;
    if (object instanceof Statement statement) {
      attachments = getRealAttachments(statement);
    } else if (object instanceof List<?> statements && !statements.isEmpty()) {
      attachments = ...;
    } else {
      attachments = null;
    }

Documentation

  • Updated README.md and CONTRIBUTING.md to reference Java 17
  • Updated SDKMAN installation examples

Checklist:

  • Public methods are documented
  • Public methods are tested
  • New and existing tests pass when run locally
  • There are no new warnings or errors

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkstyle.org
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.23.7/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.23.7/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.23.7/x64/codeql/xml/tools/xml-extractor.jar --fileList=/home/REDACTED/work/xapi-java/.codeql-scratch/dbs/java/working/files-to-index11448977796147658271.list --sourceArchiveDir=/home/REDACTED/work/xapi-java/.codeql-scratch/dbs/java/src --outputDir=/home/REDACTED/work/xapi-java/.codeql-scratch/dbs/java/trap/java (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

roll back to Java 17 in preparation for a release to elastic beanstalk which is configured for Java 17. Will need to create a PR which changes Pom files and readme and workflows and possibly other locations


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits December 13, 2025 00:48
Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Copilot AI changed the title [WIP] Rollback to Java 17 for Elastic Beanstalk release Roll back to Java 17 for Elastic Beanstalk compatibility Dec 13, 2025
Copilot AI requested a review from thomasturrell December 13, 2025 00:58
@sonarqubecloud
Copy link

@thomasturrell thomasturrell changed the title Roll back to Java 17 for Elastic Beanstalk compatibility Roll back to Java 17 Dec 13, 2025
@thomasturrell thomasturrell marked this pull request as ready for review December 13, 2025 09:52
Copilot AI review requested due to automatic review settings December 13, 2025 09:52
@thomasturrell thomasturrell merged commit 9d24395 into main Dec 13, 2025
12 checks passed
@thomasturrell thomasturrell deleted the copilot/rollback-to-java-17 branch December 13, 2025 09:52
Copy link
Contributor

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 rolls back the project from Java 25 to Java 17 to support deployment on Elastic Beanstalk, which is configured for Java 17. The changes ensure compatibility while maintaining all existing functionality.

Key Changes:

  • Updated Java version from 25 to 17 across all configuration files
  • Refactored switch pattern matching to if-else statements for Java 17 compatibility
  • Updated documentation to reflect Java 17 requirement

Reviewed changes

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

Show a summary per file
File Description
pom.xml Updated java.version property from 25 to 17
xapi-client/src/main/java/dev/learning/xapi/client/StatementHttpMessageWriter.java Refactored switch pattern matching to Java 17 compatible if-else with instanceof checks
.github/workflows/maven_push.yml Updated GitHub Actions to use JDK 17
.github/workflows/maven_pull_request.yml Updated GitHub Actions to use JDK 17
.github/workflows/manual-release.yml Updated GitHub Actions to use JDK 17
.github/workflows/copilot-setup-steps.yml Updated GitHub Actions to use JDK 17
.github/workflows/codeql.yml Updated CodeQL workflow to use JDK 17
.devcontainer/devcontainer.json Updated devcontainer image and runtime configuration to Java 17
README.md Updated Java version requirement documentation from 25 to 17
CONTRIBUTING.md Updated prerequisites and installation instructions to reference Java 17

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