Versions Compared

Key

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

To maintain a level of quality in the codebase, the project maintains a set of coding and testing guidelines.

Table of Contents
maxLevel3

Indentation and spaces

  • Four spaces, notNOT tabs, are used for indentation.
  • Trailing whitespaces should be removed in both code and comments.
  • There should be a space between keywords (ifforcatch, etc.), parenthesis, and braces, as well as when casting:

    Code Block
    languagejava
    if (timer != null) {
        try {
            DeviceId did = (DeviceId) elementId;
            ...
        } catch (IOException e) {
    ...
  • There should be a space before the curly braces in method definitions. Arguments are not padded (neither in definition nor invocation):

    Code Block
    public Device getDevice(DeviceId deviceId) {
        return store.getDevice(deviceId);
    }

The project uses Checkstyle  to enforce some of the formatting mentioned above. Violations will stop prevent the build until fixedfrom succeeding.

Comments 

Javadocs are used to document the codebase itself. Interfaces are heavily documented with Javadocs so that implementing methods (annotated with @Override) inherit the commenting. 

...