...
- 4-space indents. NO TABS ALLOWED.
One true brace style. Braces are required on all blocks.
Code Block if (code) { // code } else { // code }
- Do not use wildcard imports (e.g.
import java.util.*
). Duplicated or unused imports are not allowed. Maximum length of lines is 100 120 characters (except for long URLs, packages or imports)
- No trailing spaces allowed (except in comments)
Tokens should be surrounded by whitespace, e.g. http://checkstyle.sourceforge.net/config_whitespace.html#WhitespaceAround
Code Block // This is NOT valid. Whitespace around tokens is missing String []={"one","two","three"} // This is valid. Whitespace exists around all tokens String [] = { "one", "two", "three" }
Each line of code can only include one statement. This also means each variable declaration must be on its own line, e.g.
Code Block // This is NOT valid. Three variables are declared on one line String first = "", second = "", third = ""; // This is valid. Each statement is on its own line String first = ""; String second = ""; String third = "";
Each source file must contain the required VIVO/Vitro license header, e.g.
Code Block /* * This file is distributed under the terms of the license in LICENSE */
...