openrewrite / openrewrite/rewrite-static-analysis

`OperatorWrap` and `WrappingAndBraces` causing wrong result for Kotlin

Open
#302 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
62
Forks
112
Avg merge
1d 19h
Merged PRs (30d)
40

Description

What version of OpenRewrite are you using?

I am using

  • OpenRewrite 8.27.4
  • Maven/Gradle plugin 6.16.0
  • rewrite-static-analysis 1.9.0

How are you running OpenRewrite?

Gradle.
Single Module
https://github.com/SettingDust/TheAbyss

What is the smallest, simplest way to reproduce the problem?

https://discord.com/channels/996548279191998535/996548280118935674/1249202116883513425
Run the rewrite with gradle.

  1. 图片
  2. 图片

What did you expect to see?

  1. 图片
  2. No

What did you see instead?

  1. 图片
  2. 图片
    图片

Are you interested in contributing a fix to OpenRewrite?

No

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report in the linked TheAbyss project with Gradle, focusing on the OperatorWrap and WrappingAndBraces recipes and the two numbered cases shown in the issue. Compare the generated Kotlin with the expected and observed screenshots, then add a regression test for the discrepancy and verify the rewrite no longer produces the reported result.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.