-
Notifications
You must be signed in to change notification settings - Fork 89
MissingOverrideAnnotation: removeFalsyOverrideAnnotation #684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MissingOverrideAnnotation: removeFalsyOverrideAnnotation #684
Conversation
is this any good? @timtebeek fell free to tune and complete @iddeepak |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions could not be made:
- src/main/java/org/openrewrite/staticanalysis/MissingOverrideAnnotation.java
- lines 33-33
import lombok.var; | ||
import org.jspecify.annotations.Nullable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import lombok.var; | |
import org.jspecify.annotations.Nullable; | |
import org.jspecify.annotations.Nullable; |
public void doesNotOverrideAnything() { | ||
} | ||
} | ||
""") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
""") | |
""" | |
) |
public void method2() { | ||
} | ||
} | ||
""") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
""") | |
""" | |
) |
\s | ||
public void invalidMethod() {} | ||
} | ||
""") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
""") | |
""" | |
) |
""") | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
""") | |
); | |
""" | |
) | |
@Test |
public void documentedMethod() { | ||
} | ||
} | ||
""") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
""") | |
""" | |
) |
public void annotatedMethod() { | ||
} | ||
} | ||
""") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
""") | |
""" | |
) |
What about changing the scope to check for corrupt (missing/falsy) override annotations. We could create a new one like As if not, gonna have to copy potentially every recipe 1 times to check for false negative as well. |
As indicated above, a misplaced Override annotation already does not compile on my machine; have you seen any number of example of that in the wild at all that warrant an automated remediation? If there's a convincing case we can reopen, but for now I just don't see it. |
this was my intention: |
What's changed?
It seems the rules does not cover false positives as well. Should this be included?
What's your motivation?
are those annotations really necessary
Anything in particular you'd like reviewers to focus on?
Anyone you would like to review specifically?
Have you considered any alternatives or workarounds?
Any additional context
Checklist