J2KMigBench: Evaluating LLMs on Java-to-Kotlin Migration in Real-World Repositories
Moshood A. Fakorede, Marcoantoni Rubio-Gonzalez, Umar Farooq
Abstract
Migrating Java to Kotlin requires preserving behavior and interfaces within a working repository. Existing callers, build configurations, and tests constrain translation. Java/Kotlin interoperability also allows partial and incomplete migrations to keep passing tests. A migration is incomplete if it does not replace every requested Java file with its Kotlin counterpart. We present J2KMigBench, a benchmark drawn from real migration pull requests. Each task combines the original Java, a specification grounded in the source and pull request, and an offline build environment with the developer's Kotlin withheld from the agent. From 383 candidate pull requests, environment and task checks yield 31 evaluable tasks across six repositories and 167 target files. We evaluate Gemini 3.8 Flash and GPT-6.1 Terra using OpenHands under identical task budgets. Resolution requires compilation, preservation of stable baseline tests, and conversion of every requested file. Gemini resolves 25 tasks (80.6%) and Terra 26 (83.9%), at mean model costs of USD 1.25 and USD 0.15. Six patches compile and preserve the tests while converting at most one target file. Gemini converts more files overall and is closer to the developer's Kotlin on shared targets, with mean token edit similarity of 0.57 against Terra's 0.53. Analysis of selected Kotlin constructs reveals different null-handling and accessor choices without establishing a ranking of idiomaticity. The benchmark exposes incomplete conversions and caller incompatibilities that build success or reference similarity alone would miss.
Create a lesson
Metadata
- Categories
- cs.SE, cs.AI, cs.PL
- Comments
- 6 pages, 2 figures, 2 tables
Related papers
SWE-GPU-Bench: Can Language Models Solve Real-World GPU Software Engineering Tasks?
Shared title terminologycs.SEFeng Chen, Binbin Liu, Wenhan Han et al.
FineCR: A Fine-Grained Benchmark for Evaluating LLMs on Raising Code Review and its Resolution
Shared title terminologycs.SETaufiqul Islam Khan, Shaowei Wang, Haoxiang Zhang et al.
GhostAPI-V: Evaluating Audited Diagnostics for Internal API Migration Repair
Shared title terminologycs.SEJingtao Zhang, Zeming Liu, Haorui Gao
RepoClean: Evaluating Coding Agents on Repository-Level Obsolete Code Cleanup
Shared title terminologycs.SEHongyixuan Yuan, Qixing Zhou, Pengcheng Huang et al.
Evaluating Code Slop in Long-Horizon Coding Agents
Shared title terminologycs.SEShubham Gandhi, Shyam Agarwal, Nachiket Kotalwar et al.
Comparing Humans and LLMs in Software Engineering Research
Shared title terminologycs.SEMarc Herrmann, Tolga Çakır, Michael Mircea et al.