rewrite-static-analysis icon indicating copy to clipboard operation
rewrite-static-analysis copied to clipboard

MissingOverrideAnnotation adds wrong Override

Open Bananeweizen opened this issue 2 years ago • 0 comments

What version of OpenRewrite are you using?

I am using

  • Maven/Gradle plugin v5.7.1

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

public interface Reproducer extends Cloneable {
  Reproducer clone();
}

What did you expect to see?

No change. While Object has a clone method, the one above IS NOT the clone method of Object, but rather one defined in this interface only.

What did you see instead?

public interface Reproducer extends Cloneable {
  @Override
  Reproducer clone();
}

That doesn't compile anymore.

Are you interested in contributing a fix to OpenRewrite?

Not for this one. The necessary type compatibility checks are over my head probably.

Bananeweizen avatar Oct 01 '23 07:10 Bananeweizen