openrewrite / rewrite-static-analysis

OpenRewrite recipes for identifying and fixing static analysis issues.
Apache License 2.0
32 stars 54 forks source link

RemoveUnusedPrivateMethods should remove unused imports #347

Closed blipper closed 1 month ago

blipper commented 1 month ago

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

import toy.MyClass;
class A {
    private void foo() {
        new MyClass();
    }
}

What did you expect to see?

class A {
}

What did you see instead?

import toy.MyClass;
class A {
}