Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
student:checkstyle:common-defects [2018/09/06 17:29] – bernstdh | student:checkstyle:common-defects [2018/09/07 11:27] – bernstdh | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== Common Checkstyle Defects ===== | ===== Common Checkstyle Defects ===== | ||
- | | + | **Incorrect indentation level M, expected N. [Indentation]**\\ |
+ | The statement is currently indented M spaces when it should be indented N spaces. | ||
+ | |||
+ | **Missing | ||
+ | Make sure your code has all of the necessary block comments and that each block comment has all of the necessary elements. See the Javadoc Help Page for more information. | ||
+ | |||
+ | **' | ||
+ | Move the opening curly-bracket to the end of the previous | ||
+ | |||
+ | **Line is longer than 80 characters (found XXX). [LineLength]**\\ | ||
+ | Split the statement, which is currently XXX cgharacters long, into multiple lines. Be careful to indent subsequent lines appropriately and to split the statement so that subsequent lines begin with an operator. | ||
+ | |||
+ | **Name | ||
+ | Variable/ | ||
+ | |||
+ | **Name ' | ||
+ | " | ||
+ | |||
+ | **File does not end with a newline. [NewlineAtEndOfFile]**\\ | ||
+ | There must be a newline character at the end of every file. Move the cursor to the last character in the file and press Enter. Then, make sure that there are no other characters on the last line - the absolute last character must be a newline. | ||
+ | |||
+ | **'X' | ||
+ | This is usually becase a long line was split and the operator, denoted by 'X', is at the end of a line rather than the beginning of the next one. | ||
+ | |||
+ | **Unnecessary parentheses around assignment right-hand side. [UnnecessaryParentheses]**\\ | ||
+ | The expression on the right-hand side of an assignment operator has unnecessary parentheses that must be removed. For example, x = (x + 1); must be x = x + 1;. | ||
+ | |||
+ | **'X' | ||
+ | There must be a space before the operator (where | ||
+ | |||
+ | **' | ||
+ | There must be a space after the operator (where ' |