Skip to content

Only add AddMissingMethodImplementation templates to Java sources - #1439

Open
kmccarp wants to merge 1 commit into
mainfrom
fix/add-missing-method-java-sources-only
Open

kmccarp wants to merge 1 commit into
mainfrom
fix/add-missing-method-java-sources-only

Conversation

@kmccarp

@kmccarp kmccarp commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

What

AddMissingMethodImplementation now runs only on Java sources, via JavaFileChecker. Its method template is Java, so applying it to a Kotlin class wrote code like public <T> unwrap( iface: Class<T>): T {, which does not compile. That included classes where Kotlin delegation already supplies the method.

Why

Found running UpgradeToJava25 over about 1,400 Kotlin-ecosystem repositories: 11 files in 6 repositories were affected.

Testing

  • New regression test in AddMissingMethodImplementationTest, which passes on this branch (12 tests) and fails without the fix.
  • The full module suite passed before rebasing onto current main.
  • Unit tests only; not rerun against a real LST.

The template printed Java into Kotlin classes, such as 'public <T> unwrap( iface: Class<T>): T {', which does not compile, including where Kotlin delegation already supplies the method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant