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

Closed
Luro02 opened this issue Jun 1, 2024 · 0 comments · Fixed by #597
Closed

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

Luro02 opened this issue Jun 1, 2024 · 0 comments · Fixed by #597
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
Luro02 added a commit to Luro02/autograder that referenced this issue Sep 18, 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

Successfully merging a pull request may close this issue.

1 participant