AWS Transform Custom — Completed

Java 8 → Java 21 Migration

Full-stack modernization of aws-appconfig-java-sample-maven — Spring Boot 3.x, Jakarta EE, JUnit 5, and modern Java idioms. Powered by AWS Transform agentic AI.

11/11
Steps Completed
7/7
Tests Passing
24/26
Criteria Pass
0
Failures

01Transformation Timeline

11 sequential steps — each verified with a successful build before proceeding.

02Dependency Upgrades

Every dependency updated for Java 21 and Spring Boot 3.x compatibility.

ComponentBeforeAfter
Java Version1.8→21
Spring Boot2.0.5.RELEASE→3.2.1
AWS SDK BOM2.14.27→2.20.0
Log4j2.13.3→2.21.0
org.json20200518→20231013
Validation APIjavax.validation 2.0.1→jakarta.validation 3.0.2
Maven Compiler3.8.1→3.11.0
JUnitJUnit 4.13.1→JUnit 5 (Jupiter)
Mockitomockito-all 1.10.19→Mockito 5.x (via Spring Boot)
AppConfig SDKgetConfiguration() (deprecated)→AppConfigDataClient (session API)

03Code Modernizations

Modern Java 21 idioms applied across the entire codebase.

🔄 Jakarta Namespace

All javax.* imports migrated to jakarta.* — required for Spring Boot 3.x and Jakarta EE 10.

MoviesController · Security

📦 Java Records

ConfigurationKey converted to a Java record with compact constructor and automatic equals/hashCode/toString.

ConfigurationKey.java

⚡ Switch Expressions

Traditional switch/break statements replaced with arrow-syntax switch expressions for cleaner control flow.

MovieAnalyticsService

📝 Text Blocks

Multi-line string concatenation replaced with text blocks and .formatted() for HTML, JSON, and reports.

MovieUtilities · MoviesController · Analytics

🌊 Stream API

10+ imperative loops converted to stream operations — filter, map, collect, toList, groupingBy, joining.

MovieAnalyticsService · MovieUtilities

🎯 Pattern Matching

Verbose instanceof checks replaced with pattern matching: if (!(obj instanceof Movie other))

Movie.java

🔒 Try-with-Resources

Manual try-finally blocks replaced with try-with-resources using var for automatic resource management.

MovieUtilities

📋 Modern Collections

Arrays.asList() → List.of(), raw types eliminated, proper generics throughout.

MoviesController · MovieUtilities

🧪 JUnit 5 Migration

All 4 test files migrated: Jupiter annotations, Assertions API, @ExtendWith, @BeforeEach, openMocks().

All test files

04Validation Results

26 exit criteria evaluated — 24 full pass, 2 partial (environment limitation).

Overall Compliance92% (24/26 PASS)
✓
pom.xml java.version = 21
Properties section confirmed
✓
Spring Boot 3.2.1
Parent version verified
✓
JAVA_HOME set to Java 21
Persistent in .bashrc, .profile, /etc/environment
✓
java -version shows 21.x
openjdk 21.0.11 — Amazon Corretto
✓
javax.* → jakarta.* complete
Zero javax imports remaining
✓
All dependencies updated
AWS SDK, Log4j, org.json, jakarta.validation
✓
JUnit 4 → JUnit 5
No JUnit 4 imports in any test file
✓
Java record conversion
ConfigurationKey.java is a record
✓
Switch expression used
getGenreDescription() with arrow syntax
✓
Text blocks used
4+ methods across 3 files
✓
3+ stream operations
10+ streams across 2 service classes
✓
Lambda / method reference
Comparator.comparingDouble(Movie::getRating)
✓
Optional usage
Optional.ofNullable().map().orElse()
✓
Modern equals/hashCode
Objects.equals + Objects.hash + pattern matching
✓
Raw types eliminated
No @SuppressWarnings("rawtypes")
✓
mvn clean install succeeds
BUILD SUCCESS with Java 21
✓
mvn test passes
7 tests, 0 failures, 0 errors
✓
JUnit 5 annotations
All 4 test files use Jupiter
⚠
spring-boot:run starts
Partial — requires AWS AppConfig connectivity
⚠
REST endpoints functional
Partial — requires running application
✓
No deprecated API warnings
0 deprecation warnings with -Xlint
✓
Git branch exists
migrate-java21-spring-boot-3x
✓
README.md updated
Java 21, Spring Boot 3.2.1, migration notes
✓
Code quality baseline met
7/7 tests, 0 errors, clean tree
✓
Functional equivalence
All features preserved, 7/7 tests pass
✓
Migration summary created
MIGRATION_SUMMARY.md with full documentation

05About AWS Transform Custom

The agentic AI service that powered this migration.

🤖 Define

Out-of-the-box transformation definitions for Java, Python, Node.js version upgrades, SDK migrations, and more. Or create custom transformations via natural language.

⚡ Execute

Run interactively with human-in-the-loop or autonomously via CLI. Embed into any pipeline. Scale to hundreds of repos in parallel via AWS Batch/Fargate.

✅ Verify

User-defined validation: automated build checks, test execution, code reviews. Failed code is sent back to the agent for self-debugging and fixing.

🧠 Learn & Improve

Continual learning from every execution. The agent identifies knowledge items from debugging steps, human input, and code observations to improve future runs.

This migration was executed using AWS Transform Custom — the Java version upgrade transformation definition. The agent analyzed the codebase, planned 11 transformation steps, executed each with build verification, and applied modern Java 21 idioms including records, switch expressions, text blocks, streams, pattern matching, and Optional. The entire transformation completed with zero test failures and full guardrail compliance.

Learn more about AWS Transform → Read: Smash Tech Debt →