Feuermagier / autograder

Automatic grading of student's Java code
MIT License
13 stars 7 forks source link

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

Open Luro02 opened 1 month ago

Luro02 commented 1 month ago

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>