Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: [Original edit by ham1] Added JavaDoc guidance

...

  • "Hard" maximum line length of 120 characters
    • Except for imports or other places where breaking the line wouldn't aid readability

Spacing

  • Spacing between elements on a line e.g.
    • if (x | y) {
    • while (true) {
    • methodCall(arg1, arg2) {
    • String s = "con" + "cat";
  • Braces are always used with if, else, for, do and while statements, even if the body is empty or only a single statement

JavaDoc

  • Parameter descriptions are aligned and not on new lines.
  • No invalid tags
  • No tags without a description
  • Blank line after main description but not after any tags

Other

  • Import order
    • TBC
  • Import spacing
    • TBC
  • No wildcard (.*) imports
  • Method line length (soft limit of 50)
  • Class line length (soft limit of 500)

...

  • Use of Optional
    • Return types where null is possible (which aren't performance critical)
  • Default/static methods on Interfaces
  • Utilise lambdas where possible (max ~5 lines)
    • If the lambda is >4-5 lines >3 line then consider making this a separate method

...