Skip to content
Notifications
Clear all

My experience using Q for code migrations (e.g., Java 8 to 11). Mixed bag.

1 Posts
1 Users
0 Reactions
4 Views
(@jennyk8)
Estimable Member
Joined: 1 week ago
Posts: 78
Topic starter   [#10206]

Alright, I promised a few folks in the DMs I'd write up my experience using Amazon Q Developer for a specific, meaty task: migrating a legacy enterprise application from Java 8 to Java 11. I've just wrapped up the bulk of it, and my feelings are... complicated. It's a powerful tool, but it's not a silver bullet, and understanding its quirks is crucial.

I approached this as a structured project. I didn't just ask "migrate this." I broke it down: dependency analysis, POM/file updates, deprecated API identification, and then actual code refactoring. Here's where Q shined and where it stumbled.

**Where Q Developer was genuinely helpful:**

* **Dependency Triage:** I fed it our main `pom.xml`. Its analysis of which dependencies had compatible versions for Java 11, and its suggestions for known alternative libraries (e.g., for JAXB modules), were fast and mostly accurate. It saved me hours of manual searching.
* **Bulk File Updates:** For straightforward updates—like changing `javax.xml.bind` imports to `jakarta.xml.bind` across hundreds of files—the `/transform` feature was a godsend. I could describe the change in plain English and apply it in batches.
* **Explaining Complex Errors:** When we hit obscure `IllegalReflectiveAccess` warnings or module path issues, Q's explanations were clearer than most Stack Overflow threads. It provided context and multiple remediation paths.

**Where it fell short or required heavy oversight:**

* **Over-Confidence in Code Generation:** When asked to refactor code using removed internal APIs (like `sun.misc.*`), it would sometimes generate plausible-looking code that used... other internal APIs or non-existent methods. It required me to have enough context to spot the hallucination.
* **Lack of "Project-Wide" Context:** It would fix a class in isolation beautifully. But it wouldn't always flag that the "fix" would break five other classes that depended on the old structure. You really have to guide it module-by-module.
* **Inconsistent Suggestions:** Sometimes, for identical patterns in different parts of the codebase, it would suggest different migration strategies. This forced me to establish a standard manually and then enforce it via Q, which added a step.

Here’s a quick, real-world comparison I kept in my notes:

| Task | Q's Performance | My Manual Effort Saved? | Need for Vigilance |
| :--- | :--- | :--- | :--- |
| Update `pom.xml` versions | **Excellent** | ~80% | Low |
| Replace deprecated API calls | **Good** | ~60% | Medium (check each suggestion) |
| Refactor for module system (JPMS) | **Variable** | ~40% | **Very High** (architectural understanding needed) |
| Explain migration-related build errors | **Superb** | ~90% | Low |

**My takeaway for the community:** If you're using Q Developer for a migration, treat it as a **brilliant but junior engineer who needs clear, bounded tasks and constant code review**. Don't expect it to own the migration end-to-end. Its value is in accelerating the *mechanical* parts and explaining the *arcane* parts. The architectural synthesis and final consistency checks are still firmly on you.

For those who've used GitHub Copilot or JetBrains AI Assistant for similar lifts, how did your experience compare? I'm particularly curious about consistency across a large codebase.

~jenny


Let the data speak.


   
Quote