Skip to content

AssertTrueNegationToAssertFalse: support Kotlin via LST manipulation#1057

Merged
timtebeek merged 1 commit into
mainfrom
tim/add-kotlin-support
Jul 23, 2026
Merged

AssertTrueNegationToAssertFalse: support Kotlin via LST manipulation#1057
timtebeek merged 1 commit into
mainfrom
tim/add-kotlin-support

Conversation

@timtebeek

Copy link
Copy Markdown
Member

AssertTrueNegationToAssertFalse rewrote assertTrue(!x) to assertFalse(x) via a JavaTemplate, which produces a J.Erroneous node on Kotlin sources and crashed with J$Erroneous cannot be cast to J$MethodInvocation. This replaces the template with direct LST manipulation (renaming the method and unwrapping the J.Unary argument), mirroring the pattern already used in AssertEqualsNullToAssertNull. A Kotlin test is added to cover the previously failing case.

@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Jul 23, 2026
@timtebeek
timtebeek merged commit 5a35eaf into main Jul 23, 2026
1 check passed
@timtebeek
timtebeek deleted the tim/add-kotlin-support branch July 23, 2026 15:57
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant