Skip to content
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

org.openrewrite.staticanalysis.AvoidBoxedBooleanExpressions does not understand @NonNull annotations #349

Open
blipper opened this issue Oct 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@blipper
Copy link
Contributor

blipper commented Oct 2, 2024

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

import lombok.@NonNull

class A {
    void foo(@NonNull Boolean b) {
        if(b) {
        }
}

What did you expect to see?

import lombok.@NonNull

class A {
    void foo(@NonNull Boolean b) {
        if(b) {
        }
}

What did you see instead?

import lombok.@NonNull

class A {
    void foo(@NonNull Boolean b) {
        if(Boolean.TRUE.equals(b)) {
        }
}

What is the full stack trace of any errors you encountered?

stacktrace output here

Are you interested in contributing a fix to OpenRewrite?

@blipper blipper added the bug Something isn't working label Oct 2, 2024
@timtebeek timtebeek moved this to Backlog in OpenRewrite Oct 6, 2024
@timtebeek
Copy link
Contributor

Thanks @blipper ; indeed seems reasonable not to make any changes to variables annotated as non-nullable. Another case where having nullability included in the type system would help:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants