Pitching Kotlin: An Engineering Leader's Guide to Legacy Modernization
Most Kotlin pitches stall on developer preference. This reviewer's framework prices the friction, phases the rollout behind gates, and wins approval.
I've been on both sides of the Kotlin conversation: the engineer making the case, and the architect who reviews it and recommends a direction before a committee decides. On the reviewing side, the pattern is predictable: most Kotlin pitches die in the second meeting. A tech lead shows up with a list of syntax wins, managers or architects ask about migration risk, and the conversation ends with "we'll revisit this next quarter." The technical case for Kotlin is usually sound, but the pitch stalls because it argues from developer preference, while engineering leaders approve migrations based on cost and risk. I've spent a large part of my career on systems where a defect moves real money (I talked about what that means for Kotlin code at KotlinConf 2026), and when I wrote the Kotlin Enterprise Playbook, I ran this exact argument through a financial model across mobile, edge, and backend domains. The proposals that held up were the ones that priced cost and risk honestly, including the cases where the answer was "not here."
This guide is the framework I use when I review these proposals. Decide domain by domain, solution by solution, instead of organization-wide. Make the cost of the status quo measurable. Price the migration, including the parts nobody budgets for. Place gates where decisions stop being reversible. Make sure the people who carry the risk own the outcome. Kotlin is the worked example, but the same framework applies to any large technical migration, whether it's a language, a framework, or a data platform.
Technical Debt as an Engineering Friction Metric
Before you can pitch a migration, you need to make the cost of staying put visible. That cost is spread across pull request (PR) timelines, defect densities, and onboarding logs. It only becomes clear when you add those numbers up over several months, because an incident report only records one failure at a time.
Start with four concrete measurements your team already has access to:
- PR cycle time on service-layer changes. Verbose Java boilerplate (getters, setters, null checks, builder patterns) means more code per feature, which requires longer reviews. A data class in Kotlin replaces a 40-line Java POJO with four lines in a representative case (Java records narrow this gap for immutable value types, though not for mutable or framework-bound classes), and that compression shows up directly in review time.
- NullPointerException rate in production. Pull your error-tracking data from the last two or three release cycles. A persistent NPE trend is one of the clearest health signals a Java codebase gives you. Kotlin's type system reduces null-related runtime failures at the compiler level, so this number becomes a defensible baseline for the risk argument.
- Time-to-productive for new engineers. Ask your most recent hires how long it took them to make their first independent commit to your most heavily annotated service layer. In my experience, boilerplate-heavy Java codebases show longer onboarding ramps, and this measurement tells you whether yours does.
- Effort on existing code per quarter. Count the engineering hours per quarter spent changing existing code and the hours spent writing new functionality. In mature Java monoliths, the time on existing code tends to grow as the codebase ages. Separate structural changes from bug fixes and behavior changes, because only the structural share is the friction you are pricing.
When you present these numbers, frame them as a cost to team throughput. A statement like "We're spending 30% of sprint capacity on structural changes to code that hasn't changed business logic in 18 months" gives leadership a number they can weigh against the cost of migrating, while "Java is too verbose" is a preference leadership can dismiss. If your organization already reports DORA metrics (lead time for changes, deployment frequency, change failure rate, and failed deployment recovery time), use them as the backbone for your case and attach the four friction measurements to each one. Leadership already reads DORA as delivery performance, so your Kotlin case arrives in a format they trust.
Adoption Friction and Long-Term Velocity Gains
A realistic adoption model will show a short-term slowdown before the long-term gains, and presenting only the gains will cost you credibility with your peers.
During the initial rollout, your team will write slower Kotlin than they write Java. Code review will slow down while reviewers build pattern recognition for Kotlin idioms. Budget two to four sprints for the team to get comfortable with the idioms, and expect full velocity parity by sprint 8, midway through phase 2. Your Gradle or Maven build configuration will also need updating to add the Kotlin JVM plugin and compiler targets alongside existing Java compilation.
Plan for the less visible costs too. Mixed Java and Kotlin compilation adds build time (the K2 compiler that shipped with Kotlin 2.0 narrowed the gap, and Gradle's build cache and configuration cache help further, but measure it on your own codebase before you promise anything), annotation processors need a path off kapt (now in maintenance mode) toward KSP where your libraries support it, and Spring or JPA code needs the kotlin-spring and kotlin-jpa compiler plugins, because Kotlin classes are final by default and both frameworks rely on proxies and no-arg constructors. Note that kotlin-jpa only adds the no-arg constructor: entities also need allOpen configured for @Entity, @MappedSuperclass, and @Embeddable, or Hibernate's lazy loading turns into eager loading without warning. These line items are where migration estimates fall apart, because the visible conversion work is only the tip of the iceberg.
Once your team reaches parity, the gains will compound with each module you convert, because Kotlin produces an estimated 40% fewer lines of code than equivalent Java, which means a smaller surface area to read, review, and debug. Treat that figure as directional, since it's a vendor estimate, and replace it with numbers from your own converted modules as soon as you have them. A stronger reference point is JetBrains' telemetry study of about 28 million development cycles: on comparable work, Kotlin developers spent roughly 15-20% less time from first edit to push than Java developers. Compile-time null safety catches most null-related runtime errors before they reach staging. Extension functions let Kotlin code add convenience APIs on top of existing Java classes without touching the original source, which smooths incremental adoption. They're resolved statically, though, so Java callers see them as ordinary static utility methods.
Kotlin is designed for Java interoperability at the JVM level, which means you don't convert a service and then wait for everything else to catch up. New features ship in Kotlin while stable Java modules stay exactly where they are. Both compile to JVM bytecode and call each other's APIs directly, so the adoption boundary moves at whatever pace your team sets.
AI-assisted tooling further changes the conversion economics. The kotlin-tooling-java-to-kotlin AI Agent Skill, published by JetBrains, integrates with IntelliJ IDEA's AI Assistant and external agent tools to automate module translation with a structured four-step conversion process. The skill performs a faithful semantic translation first, then refines nullability and mutability, converts collection APIs to idiomatic Kotlin, and restructures for framework idioms. It checks five invariants at every step, verifying that public signatures stay compatible and that annotation site targets don't break reflection-based frameworks like Spring or Jackson. Present this to skeptics as a safety net on the conversion pipeline, since it reduces the manual cleanup burden on each converted file, and your team still reviews and commits the output. One caution from the wider migration literature: LLM-assisted translation can produce code that compiles and passes the existing tests while still changing behavior at the edges. Tests generated by the same pipeline tend to confirm the translation instead of challenging it. Keep the tests that guard a converted module independent of the tool that converted it, and before converting a module, add characterization tests that pin down its current behavior.
Why the Case Gets Stronger When AI Writes the Code
For most teams, a growing share of new code is now drafted by AI assistants and agents. That moves the bottleneck from writing code to verifying it, and verification is where the language matters. Every non-null type, every exhaustive when expression over a sealed hierarchy, and every value class that keeps two lookalike IDs from being swapped is a check the compiler runs on generated code before any human reviewer looks at it. Explicit types also work as a specification the agent reads: a non-null field in a signature states the contract more reliably than a comment the model may ignore. And less code per feature means less generated code to review, which matters more once generation is cheap, and review isn't.
AI doesn't settle the question, though. Models have seen far more Java than Kotlin, so output quality can vary, and AI also makes a modern-Java upgrade cheaper. It also shrinks only the visible part of the migration cost: conversion gets cheaper, but parallel running, governance, and decommissioning cost the same with or without an agent. The question becomes which language lets your reviewers trust code they didn't write. In domains where a wrong value is expensive, a stricter type system pays off.
Team Velocity Through a Phased Rollout
Incremental adoption turns a high-risk initiative into a gated engineering program. The goal is to give leadership defined checkpoints to evaluate stability before authorizing the next phase, because a plan approved in stages is much easier to sign off on than a multi-year roadmap.
Phase 1 (tests-first, sprints 1 to 4). Write all new unit and integration tests in Kotlin. Your existing Java production code stays untouched. The team gets hands-on time with Kotlin syntax in a low-stakes context, and your test suite stays green throughout. It is also the cheapest step in the plan to reverse. If the pilot fails, you delete test files, and nothing changes in production.
Phase 2 (leaf modules, sprints 5 to 10). Start with independent utility classes, DTOs, and value objects. These are the leaf nodes of your dependency graph. Because they depend on almost nothing else in your codebase, converting one can't break the code it relies on. Check their fan-in, though. A widely shared DTO is a leaf with many callers, and every nullability decision in its Kotlin signature reaches each Java caller, so convert low-fan-in leaves first and treat shared DTOs as a separate step.
Two framework details trip up DTO conversions: Jackson needs jackson-module-kotlin to deserialize data classes, and Kotlin code in a mixed module can't see Lombok-generated members without the Kotlin Lombok compiler plugin. Most of these objects translate cleanly to Kotlin data class declarations (JPA entities are the exception: keep them as regular classes, because data-class equals() and hashCode() conflict with Hibernate's lazy proxies), and conversion regressions are easy to catch with the test suite you built in phase 1. Commit the mechanical J2K conversion on its own, then follow it with an idiomatic cleanup so your code reviewers can diff them separately.
Phase 3 (new service boundaries, ongoing). Any new microservice or greenfield module ships in Kotlin from day one. This is the Strangler Fig pattern applied to a language: new capability grows around the legacy system, which keeps running until each domain is ready to retire. Existing Java services stay untouched unless they're candidates for targeted conversion. This is where most of the return sits. When I modeled adoption across a full product portfolio, new development came out clearly positive, while migrating highly stable legacy code often produced a negative net present value (NPV). A good plan says so openly and classifies each domain as Kotlin by default, gated behind a business case, or not now.
Use a lightweight decision matrix to triage which modules go into which phase, so the sequencing decision is traceable. The following table applies the decision matrix to modules from an example codebase:
| Module | Fan-in (modules depending on it) | Current friction signal | Translates cleanly to a data class? | Phase | Notes |
|---|---|---|---|---|---|
OrderDto |
Low | NPEs in the mapping code around it | Yes | 2 | Leaf used by one service, good J2K candidate |
PricingService |
High | High refactor hours/quarter | No | 3 (new boundary) or targeted | Core business logic, convert only if rewriting anyway |
NotificationUtils |
Low | Long PR cycle time | N/A (utility class) | 2 | Pure utility class, no callers outside its module; becomes top-level functions, so add @file:JvmName to keep Java call sites unchanged |
PaymentGatewayClient |
High | Mixed | No | Hold | High fan-in, defer until phase 2 modules are stable |
Score your own modules on the same four columns: dependency count, which friction metric from the baseline section it shows up in, whether it translates cleanly to a data class, and the phase it belongs to. Modules with low fan-in and a clean data-class shape go to phase 2 first. High fan-in modules wait until the team has review-cycle data from earlier conversions.
Velocity through these phases usually follows a predictable curve. You'll see a brief slowdown during phase 1 as the team learns the idioms, a recovery to baseline by sprint 8, and then a compounding improvement as shared modules accumulate in Kotlin. The right milestone gate at the end of phase 1 asks whether the team shipped tests on schedule and whether the suite passes. The gate at the end of phase 2 asks whether conversion regressions appeared and how many review cycles each converted file required. Measure both against a control group: comparable Java modules the team changed over the same period. Without one, a before-and-after comparison picks up everything else that changed that quarter, and a careful reviewer will discount it.
Each gate is a go/no-go evaluation point. You should place gates where the next step stops being cheap to reverse. Kotlin tests and new modules are easy to back out. A shared DTO with dozens of Java callers, or an organization-wide default, is not, so that is where the evidence bar goes up. Where you can, encode the gate criteria as fitness functions in the build instead of meeting agendas: architecture checks with Konsist or ArchUnit, a build-time budget, and a rule that rejects new Java files in domains classified as Kotlin by default. A gate that runs on every commit doesn't depend on anyone remembering to hold it. If a team misses gate 1, treat that as data about the plan, not as a scheduling problem to absorb in phase 2.
Show leadership a velocity chart comparing your team's adoption path with the trend for your Java codebase if nothing changes, so they see the short-term dip and the long-term payoff on the same timeline.
The legacy line trends down as refactoring overhead compounds, while the adoption line follows the dip-and-recovery pattern described above. Use your own baseline numbers from the friction metrics section to recalibrate the axis before presenting it.
Four Objections I Check When Reviewing a Kotlin Migration
When a Kotlin proposal comes to me for review, how it answers these four objections shapes my recommendation to the committee, and each maps to a concrete technical answer.
"What if we need to roll back?" Kotlin's interoperability with Java means each module conversion can be reversed on its own, at least for a while. A Kotlin file compiles to standard JVM bytecode that Java code calls directly, and in most cases existing Java callers need no changes, as long as the converted code keeps a Java-friendly API (@JvmStatic, @JvmOverloads, @Throws, and the kotlin-spring plugin for proxied Spring beans). Once other Kotlin code relies on Kotlin-only features of the converted module (default arguments, extension functions, suspend functions, sealed hierarchies), reverting it breaks those callers, so make the rollback window part of your gate criteria.
If a converted module introduces instability, revert the commit. Because the mechanical J2K output lives in its own commit, the rollback is one small, reviewable change. For higher-risk modules, run the Java and Kotlin versions side by side behind a feature flag (under different class names, since both can't share one on the classpath), or shadow a slice of production traffic through both and compare outputs before switching over. In payments, shadow only side-effect-free logic such as fee calculation or routing decisions, never authorizations, captures, or refunds, and keep in mind that mirroring card data widens your Payment Card Industry Data Security Standard (PCI DSS) scope.
"The conversion overhead is too high." IntelliJ IDEA's built-in Java-to-Kotlin (J2K) converter handles the syntactic translation automatically. The two-commit pattern (one commit for the J2K output, one commit for idiomatic cleanup) keeps code review tractable.
"We'll introduce null-safety regressions during conversion." The compiler catches most of these before they ship. The gap is the Java–Kotlin boundary. Unannotated Java types reach Kotlin as platform types with no compile-time check, so annotate the remaining Java side with JSpecify. The boundary can also fail at runtime in the other direction. Kotlin inserts null checks on public non-null parameters, so a Java caller that used to pass null now fails immediately with an NPE. Check the Java callers of each converted API before you mark a parameter non-null. The J2K converter infers nullability from annotations and usage and inserts non-null assertions (!!) where it can't decide, so your team reviews each one and replaces it with safe calls (?.) or Elvis operators (?:), or keeps the non-null assertion where a contract guarantees it.
In practice, the bigger risk runs the other way. A converted field gets marked nullable "just in case," and a broken upstream contract turns into a silent fallback deep in the code. Keep mandatory fields non-null, validate them once at the system boundary, and make invalid input fail loudly there. I covered this pattern in my KotlinConf 2026 talk on type-driven reliability.
"Why not just upgrade to modern Java?" This is the objection to take most seriously in 2026. Records, sealed classes, pattern matching, and virtual threads have closed much of the gap that drove early Kotlin adoption. For stable, low-change backends, a Java upgrade plus stronger engineering standards is often the higher-return choice. Kotlin earns its place where the bottleneck is modeling correctness, safe refactoring speed, or business logic shared across channels, especially when those factors show up in incident rates or time to market. A credible proposal compares Kotlin with the Java you could run next year (today, Java 25, the current long-term support release), not the Java 8 or 11 the codebase was written in, and it is willing to say "not here" where Java is enough.
Architects in enterprise Java usually ask whether Spring fully supports Kotlin, and JetBrains and the Spring team answered that with a strategic partnership to make Kotlin a first-class language for Spring applications. The collaboration covers full null safety across the Spring portfolio (based on JSpecify annotations and shipped in Spring Boot 4), official Kotlin-first Spring learning materials, faster Kotlin reflection, and evolving configuration DSLs. Coroutine support in Spring WebFlux predates the partnership and has been available since Spring Framework 5.2. Spring and Spring Boot remain among the most widely used backend frameworks in JetBrains' own Kotlin developer surveys, with enterprise teams at Expedia Group, Kakao Pay, and Mercedes-Benz.io among those running Kotlin in production on that stack.
Who Says Yes, and the Decision on One Page
A proposal that only answers engineering gets approved and then stalls in the next review. Before you write it, map who has to say yes and what each of them protects: finance looks at payback and predictability, security at supply chain and scanning coverage, product at delivery risk during the dip, and platform engineering at a toolchain it will support for years. Then make ownership explicit. The architecture board owns the default, gated, and not-now classification. Platform engineering owns the toolchain and upgrade cadence. A small guild owns Kotlin conventions, with rotating membership so it doesn't harden into a gatekeeping inner circle. Write the result as an architecture decision record (ADR), including the context, the options you rejected and why, the decision, and who owns each consequence. The evidence behind the ADR comes down to four things:
- Codebase health baseline. Present your current friction metrics, including PR cycle time on service-layer changes, NPE rate from your error-tracking tool, engineering hours per quarter on structural refactoring, and new-engineer time-to-first-independent-commit. These establish the cost of the status quo in terms of team throughput. Pair them with an honest cost estimate that covers training, the learning dip, parallel running, governance, and the eventual decommissioning of legacy code.
- Phased migration plan with gates. Outline the three phases (tests-first, leaf module conversion, new service boundaries) with sprint estimates and go/no-go criteria at each gate. Request approval for phase 1 only. Add a kill switch: if build time, incident rate, or review load regress past agreed thresholds, expansion pauses until the platform is fixed. Name an owner for Kotlin conventions (a style guide, static analysis with detekt, and a short review checklist), so converted code doesn't turn into Java written in Kotlin syntax.
- Tooling and safety net inventory. Name the specific tools in the conversion pipeline, including IntelliJ IDEA's J2K converter for mechanical translation, the kotlin-tooling-java-to-kotlin AI Agent Skill for framework-aware idiomatic refinement and invariant checks, and the existing Gradle or Maven build for mixed-codebase compilation. Include the supply-chain controls security will ask about: a software bill of materials (SBOM), dependency scanning, and pinned, approved versions of the Kotlin compiler and Gradle plugins. The Kotlin standard library,
kotlin-reflect, andkotlinx-coroutinesbecome new runtime dependencies in your component inventory. Security will want to agree on which code may be sent to an AI conversion tool, especially anything that touches keys, hardware security module (HSM) integration, or cryptography. This answers the "how do we actually do this" question before it's asked. - Ecosystem maturity signals. The JetBrains and Spring strategic partnership (announced May 2025), Google's continued backing of Kotlin as Android's recommended language (a sign that investment extends beyond any single vendor, not a reason to scope this migration around mobile), the enterprise case studies at kotlinlang.org/server-side, and the roughly 8.1 million Kotlin developers JetBrains estimates in its State of Kotlin 2026 report give leadership the external validation they need. For most backend teams, ecosystem maturity is no longer the main adoption risk. Treat vendor numbers, including these, as directional: independent case studies and your own pilot data carry more weight with a skeptical review board.
Keep the main document to one page, two at most, and move the detail into appendices. Your goal is a decision the committee can make in a single 30-minute review, not a series of follow-up meetings.
Building the Case, Section by Section
This guide's framework comes down to five moves. Decide domain by domain which code is Kotlin by default, which needs a business case, and which is not now. Quantify the friction in your current Java codebase as throughput metrics, measured against a control group. Model both sides of the adoption curve honestly, including the short-term slowdown and the costs nobody budgets for. Phase the rollout through gates placed where decisions stop being cheap to reverse. Then map who has to say yes, make ownership explicit, and put the recommendation in a short ADR.
The tooling makes conversion manageable, but tooling was never what blocked approval. A migration gets approved when the decision is scoped by domain, priced honestly, reversible at each step, and owned by the people who carry its risk. That holds whether the change is Kotlin, a new framework, or a new data platform, and it holds just as well when the honest answer is "not here."
For the full financial model (NPV, IRR, payback, and the migration iceberg) and the governance setup behind this guide, see the Kotlin Enterprise Playbook I wrote, available at kotlinlang.org, and the recap of my KotlinConf 2026 talk.
Where have you said "not here" to a migration your team wanted, and what evidence settled it?
Opinions expressed by DZone contributors are their own.