Kotlin modernization at enterprise scale

Automate Kotlin 1.x to 2.x migrations, performance recipes, and Android deprecation cleanup across hundreds of repositories. Deterministic execution, agent-ready infrastructure.

Kotlin 2.0 shipped May 2024. The ecosystem now assumes 2.x as baseline.

Thousands of standard library renames, deprecations, and behavioral changes separate Kotlin 1.x from 2.x. Spring Boot 4, modern Android tooling, and the active Kotlin ecosystem now assume 2.x. Deprecated 1.x APIs became errors in Kotlin 2.1, so codebases lagging behind compound migration debt every quarter.

bash, ~/acmecorp

Why Kotlin modernization breaks down at scale

Manual migration doesn't scale. The codebase keeps moving, and modernization needs to move with it.

  • Kotlin 1.x to 2.x migrations touch thousands of standard library call sites across the codebase, including string case conversions, enum entries, kotlinx library bumps, and Gradle plugin upgrades
  • Idiomatic Kotlin masks performance issues. Eager Iterable operators chain into intermediate allocations that look clean but cost real CPU at runtime
  • Android deprecations accumulate faster than engineers can manually address them: AsyncTask, LocalBroadcastManager, bare Handler constructors, and the deprecation cadence that follows
  • JVM interop forces eager-by-default collection semantics, which makes “obvious” optimizations fragile without semantic understanding of the call chain

What to look for in a Kotlin modernization tool

Enterprise Kotlin teams need more than version bumps. A modernization tool must support safe, coordinated transformation at portfolio scale, across hundreds of repositories, multiple Kotlin versions, and varying team ownership.

Semantic correctness

Captures program intent at the semantic level. Changes apply safely and accurately across the entire codebase.

Multi-repository orchestration

Coordinates changes across hundreds of repositories at once, without manual sequencing or per-team coordination overhead.

Gradle and Maven dependency management

Build files, Maven coordinates, version catalogs, and Kotlin plugin versions update consistently across the portfolio.

Style and formatting preservation

Existing formatting, indentation, and coding conventions remain intact, so changes integrate cleanly without diff noise.

Portfolio-wide visibility

Migration progress, coverage, and risk are visible across the full portfolio, with rollup views above per-repository detail.

On-demand webinar

Automated Code Changes at Scale

Engineers from Netflix, Airbnb, and LinkedIn share how they tackle automated code changes at scale — and get developers to actually review and merge the PRs.

The agent-ready Kotlin modernization platform

Moderne operates on a Lossless Semantic Tree (LST), a compiler-accurate structural model of your Kotlin codebase that enables deterministic transformations across repositories.

Migrate to Kotlin 2 across your entire portfolio

  • Run UpgradeToKotlin2 once and it chains through deprecated case conversions, the appendln to appendLine shift, enum entries, kotlinx library bumps, and Gradle plugin upgrades
  • Transformations with clear targets apply automatically
  • Changes requiring judgment surface with inline markers so engineers decide before anything runs

Author recipes in idiomatic Kotlin with the new DSL

  • A K2 compiler plugin reads paired before-and-after Kotlin lambdas and synthesizes Recipe subclasses at compile time
  • Recipe authors stay in idiomatic Kotlin with no annotations, no separate template class, and no runtime reflection
  • Pattern-shaped refactorings use the declarative DSL. Structural recipes that need annotations or lexical context drop into an imperative scope

Collapse eager-collection performance traps

  • Kotlin's Iterable operators are eager by default, so chained calls like filter-then-first allocate intermediate lists
  • Performance recipes collapse these fusion patterns into single calls across the codebase
  • Recovers CPU and memory without changing behavior

Modernize Android deprecation patterns

  • Recipes target deprecation-driven patterns from AsyncTask through LocalBroadcastManager to bare Handler constructors
  • Safe to automate, tedious by hand across a portfolio of Android repositories
  • Covers the deprecation cadence that's accumulated since Android 8

Manage Kotlin and JVM dependencies at portfolio scale

  • Gradle build files (Groovy DSL and Kotlin DSL), Maven coordinates, and version catalogs parse into the LST
  • Recipes upgrade Kotlin plugin versions, kotlinx library coordinates, and transitive dependencies across the portfolio
  • Extend governance from application code to the dependency layer

Equip coding agents to operate on Kotlin safely

  • Kotlin is fully represented in the OpenRewrite LST, giving agents a compiler-accurate model to reason over
  • Recipes provide the deterministic execution layer agents call when they need transformations applied at scale
  • The Agent Tools layer for Kotlin codebases

Comprehensive Kotlin recipe coverage

Every Kotlin recipe operates on the Lossless Semantic Tree, delivering deterministic, format-preserving transformations across migration, performance, and Android. Plus broader Kotlin coverage across the OpenRewrite catalog: Gradle, static analysis, security, dependency management, and more.

Migration

Kotlin 1.x to 2.x migration

Standard library renames, deprecated API replacements, kotlinx library bumps, and Gradle plugin upgrades. UpgradeToKotlin2 chains the full migration in one recipe.

-val lower = s.toLowerCase()
-sb.appendln("hello")
-val colors = Color.values()
-val cap = s.capitalize()
+val lower = s.lowercase()
+sb.appendLine("hello")
+val colors = Color.entries
+val cap = s.replaceFirstChar { ... }
View migration recipes

Performance

Fused-operator and allocation rewrites

Kotlin's eager Iterable operators chain into intermediate allocations. Performance recipes collapse filter-then-terminal patterns and similar idiomatic-but-wasteful chains into single calls, recovering CPU and memory without changing behavior.

Examples: filter().first() to first(), filter().count() to count(), map().filterNotNull() to mapNotNull(), and the rest of the fusion pair set.

View Kotlin recipes

Android

Android deprecation cleanup

Deprecation-driven patterns across the Android ecosystem: AsyncTask, LocalBroadcastManager, bare Handler constructors, and the deprecation cadence that follows. Finder recipes locate these patterns across the codebase today, with autofix mutators following as the underlying OpenRewrite traits firm up.

Coverage includes: Jetpack Compose-aware patterns, and the deprecation chain that's accumulated since Android 8.

View Android recipes

Catalog

All Kotlin recipes

Beyond the native Kotlin catalog, Moderne ships Kotlin-aware coverage across Gradle build files, static analysis, dependency management, and security remediation. Every recipe operating on the LST works on Kotlin sources.

Includes: Kotlin Cleanup, Compose, Exposed, Kotlinx (coroutines, datetime, serialization), Format, OrderImports, and more.

Browse the full catalog

Frequently Asked Questions

What Kotlin versions does Moderne support?
What's the new Kotlin DSL for recipe authoring?
How does Moderne compare to IntelliJ inspections or Detekt?
Does Moderne support both Gradle Groovy and Kotlin DSL build files?
How do Kotlin recipes handle changes that require human judgment?
Can coding agents use Moderne's Kotlin support?