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

FP: TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK: LazySequence #163

Closed
shevek opened this issue Jul 26, 2017 · 1 comment
Closed

FP: TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK: LazySequence #163

shevek opened this issue Jul 26, 2017 · 1 comment

Comments

@shevek
Copy link

shevek commented Jul 26, 2017

LazySequence.java:28, TQ_MAYBE_SOURCE_VALUE_REACHES_ALWAYS_SINK, Priority: Normal

public class LazySequence {

    private final AtomicInteger sequence = new AtomicInteger();
    public static final int NONE = -1;

    @Nonnegative
    public int next() {
        return sequence.getAndIncrement();
    }

    @Nonnegative
    public int next(@CheckForSigned int current) {
        if (current >= 0)
            return current;
        return next();
    }
}

Standard Gradle findbugs plugin:
\--- com.google.code.findbugs:findbugs:3.0.1

I'm fairly sure, from the line number, that it's complaining about the fact that current reaches the sink, despite the check.

@iloveeclipse
Copy link
Member

This project continues development in a new home: https://github.com/spotbugs/spotbugs/

Please do not open new issues here anymore!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants