Skip to content

EmptyBlock adds unnecessary continue in empty while loops #570

Open
@greg-at-moderne

Description

@greg-at-moderne

What version of OpenRewrite are you using?

8.53.1

How are you running OpenRewrite?

Moderne

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

A few examples of OSS repro:

  while (replies.receive(10L) != null) {
+    continue;
  }

The recipe adds a continue statement to an empty while loop body. It's counterproductive. If anything, it should remove continue if it was the only statement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersin progressThe issue is already actively being worked on (analysis, PR, etc.)

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions