Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. 4-space indents. NO TABS ALLOWED.
  2. One true brace style. Braces are required on all blocks.

    Code Block
    if (code) {
      // code
    } else {
      // code
    }


  3. Do not use wildcard imports (e.g. import java.util.*). Duplicated or unused imports are not allowed.
  4. Maximum length of lines is 100 120 characters (except for long URLs, packages or imports)

  5. No trailing spaces allowed (except in comments)
  6. 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" }


  7. 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 = "";


  8. 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
     */


...