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

Loop should be for not detected with the following code #539

Open
Luro02 opened this issue Jun 1, 2024 · 0 comments
Open

Loop should be for not detected with the following code #539

Luro02 opened this issue Jun 1, 2024 · 0 comments
Labels
bug Something isn't working false-negative A lint should trigger on code that is wrong. high-priority Issues that should be solved as soon as possible

Comments

@Luro02
Copy link
Collaborator

Luro02 commented Jun 1, 2024

Summary

        int c = 0;
        boolean spaceBefore = true;
        String word = "";
        while (c < sentence.length()) {
            if (Character.isWhitespace(sentence.charAt(c))) {
                spaceBefore = true;
            } else if (spaceBefore) {
                word += sentence.charAt(c);
                spaceBefore = false;
            }
            c++;
        }
        return word;

Lint Name

No response

Reproducer

<code>
@Luro02 Luro02 added bug Something isn't working false-negative A lint should trigger on code that is wrong. labels Jun 1, 2024
@Luro02 Luro02 added the high-priority Issues that should be solved as soon as possible label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working false-negative A lint should trigger on code that is wrong. high-priority Issues that should be solved as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant