← Lab /Security & privacy

Automatic conversion of 800k-line C++ monolith to Java EE succeeded on WildFly

The authors assert they successfully converted a large C++ monolith to Java EE and ran it on WildFly

Security & privacy arXiv 9 Mar 2026 Method Prototype evidence

Published as “Experience on Automatically Converting a C++ Monolith to Java EE”

Why it matters

The work shows that large-scale, language-to-language migration with architectural changes can be largely automated, but teams should budget for manual handling of edge cases such as complex inheritance and exception semantics.

Summary

The authors built a clang-tool based transpiler that automatically converts an 800 kLOC C++ monolith to Java EE, handling multiple inheritance, enums, and I/O translation, and integrates with the build system for incremental conversion. Most of the codebase was converted automatically, leaving about ten classes that required manual tweaks and roughly 60 compilation errors that were fixed manually before the Java version ran correctly. The evidence comes from a single real-world case study, showing feasibility but also highlighting remaining manual effort.

What they found 2

  1. Only about ten classes required manual tweaking after automatic conversion

    “Nevertheless are in the end about ten classes left, that need some manual tweaking.”

  2. The project was abandoned with roughly 60 remaining Java compilation errors that were later fixed manually

    “The author left the project, when about 60 errors remained.”

Caveats 6

  • A few (less than five) classes with multiple inheritance could not be transformed automatically and needed manual conversion.
  • The conversion process never achieved fully automated, error-free Java code; manual fixes were still required.
  • Exception-handling strategy was undecided at project end, leaving a gap in the migration plan.
  • This of course was never accomplished in the real world. Albeit are the remaining manual interventions quite limited.
  • A few (less than five) classes had more than one base class that were not transformable in the described ways.
  • Unfortunately at the time the author left the project the decision of how to handle exceptions more thoroughly had not been made.

What’s new here 4

  • Uses a clang AST visitor to drive a template-based code generator for Java, enabling continuous regeneration as C++ changes.
  • Implements systematic handling of multiple inheritance by converting DAO bases to composition and Chain-of-Command bases to interfaces.
  • Provides an enum conversion scheme that preserves numeric values and adds helper methods for bidirectional mapping.
  • Integrates a checked-replace mechanism in the build system to automatically swap generated Java files when they match known-good templates.