We use Google's Java Style Guide with the following modifications.
- License Information (3.1)
- A license header is not included in individual source files.
- Import Order (3.3.3)
- Place java/javax imports in a separate block below other imports.
- Static Imports (3.3.4)
- Do not use static imports.
- Empty Blocks (4.1.3)
- Braces for empty blocks are on the same line. This includes an empty catch block.
- Block Indentation (4.2)
- Use
4spaces for blocks.
- Use
- Line Length (4.4)
- Code lines should not exceed
120characters. - Javadocs should not exceed
80characters.
- Code lines should not exceed
- Line Wrapping (4.5)
- Use
8spaces for continuation.
- Use
- Vertical Spacing (4.6.1)
- Include blank lines at the start and end of a class declaration.
- Horizontal Alignment (4.6.3)
- Do not align variables (or anything else) in this manner.
- Annotations (4.8.5)
- Method annotations are defined on separate lines.
- Field annotations are defined on the same line.
- Numeric Literals (4.8.8)
- Use uppercase letters for type suffixes and hexadecimal characters.
- Use lowercase letters for bases and exponents (
0xFF,1e9).
- Unused Exceptions (6.2)
- Exceptions which are unused should be named
ignored.
- Exceptions which are unused should be named