Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(amazonq): support Java 21 #5226

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

feat(amazonq): support Java 21 #5226

wants to merge 9 commits into from

Conversation

dhasani23
Copy link
Contributor

@dhasani23 dhasani23 commented Jan 2, 2025

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

Support transformations to Java 21.

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dhasani23 dhasani23 requested review from a team as code owners January 2, 2025 22:13
@dhasani23 dhasani23 marked this pull request as draft January 2, 2025 22:13
@dhasani23 dhasani23 marked this pull request as ready for review January 21, 2025 19:34
@@ -308,6 +309,8 @@ class CodeModernizerSession(
}

private fun startJob(uploadId: String): StartTransformationResponse {
notifyStickyInfo("sourceLanguage", sessionContext.sourceJavaVersion.name.toTransformationLanguage().toString())
notifyStickyInfo("targetLanguage", sessionContext.targetJavaVersion.name.toTransformationLanguage().toString())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will remove

val sourceVersion = sourceJdk.toString()

notifyStickyInfo("sourceJdk is", sourceJdk.toString())
notifyStickyInfo("targetVersion is", targetVersion)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will remove

)

notifyStickyInfo("customerSelection is", selection.toString())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will remove

@@ -66,7 +66,8 @@ const val DOWNLOAD_PROXY_WILDCARD_ERROR: String = "Dangling meta character '*' n
const val DOWNLOAD_SSL_HANDSHAKE_ERROR: String = "Unable to execute HTTP request: javax.net.ssl.SSLHandshakeException"
const val INVALID_ARTIFACT_ERROR: String = "Invalid artifact"
val patchDescriptions = mapOf(
"Prepare minimal upgrade to Java 17" to "This diff patch covers the set of upgrades for Springboot, JUnit, and PowerMockito frameworks.",
"Prepare minimal upgrade to Java 17" to "This diff patch covers the set of upgrades for Springboot, JUnit, and PowerMockito frameworks in Java 17.",
"Prepare minimal upgrade to Java 21" to "This diff patch covers the set of upgrades for Springboot, JUnit, and PowerMockito frameworks in Java 21.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Same with VSCode, I haven't looked at the closures for java 21 (I can look), but assuming they make the same corresponding upgrades as the first patch for java 17

CodeTransformChatMessageContent(
message = message("codemodernizer.chat.message.one_or_multiple_diffs"),
message = message("codemodernizer.chat.message.one_or_multiple_diffs", version.substring(4)), // extract "17" / "21" from "JDK_17" / "JDK_21"
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering why we can't just have strings for "17" and "21", is it just to make use of constants we already have and not unnecessarily introduce new ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah the built-in JavaSdkVersion class we use represents Java 17 as "JDK_17" and Java 21 as "JDK_21"

@@ -620,7 +620,8 @@ codemodernizer.chat.message.button.view_diff=View diff
codemodernizer.chat.message.button.view_failure_build_log=View Failure Build Log
codemodernizer.chat.message.button.view_summary=View summary
codemodernizer.chat.message.changes_applied=I applied the changes to your project.
codemodernizer.chat.message.choose_objective=I can help you with the following tasks:\n- Upgrade your Java 8 and Java 11 codebases to Java 17, or upgrade Java 17 code with up to date libraries and other dependencies.\n- Convert embedded SQL code for Oracle to PostgreSQL database migrations in AWS DMS.\n\nWhat would you like to do? You can enter "language upgrade" or "sql conversion".
# TODO: make sure all Strings work for Java 21
Copy link
Contributor

@ntarakad-aws ntarakad-aws Jan 24, 2025

Choose a reason for hiding this comment

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

Just checking if there are still more strings to change for Java 21 like some of the error/warning messages

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