Legal
Internally created source code
All source code created by Terracotta employees or external contributors needs to contain the following copyright information at the top of the file:
Copyright (c) 2003-2007 Terracotta, Inc. All rights reserved.
This includes any source files created by Terracotta employees and external contributors, including any scripts/demos/build files/etc. Please make sure you add the correct ending year, in case this is not updated right at the beginning of a new year.
External source code
For any third party components in the Terracotta source tree (e.g., Doug Lea's utilities, any JDK/JRE files, etc.), make sure you retain any original copyright information from the original developer(s), and do not add the above Terracotta copyright. If you have any questions or are unclear about what to do with any given source, please contact the Terracotta legal department.
Formatting
The adopted standard for formatting java source code at Terracotta is a slight modification of the Sun standard. The modifications are described below in terms of Eclipse, but hopefully it should translate reasonably for people using other environments.
Eclipse code formatter instructions
Start with the "Java Conventions" code formatter profile, and modify as follows:
- Indentation tab
- "General settings" section
- "Tab policy" changed from "Mixed" to "Spaces only"
- "Indentation size": 2
- "Tab size": 4
- "Alignment of fields in class declarations" section
- "Align fields in columns" checked
- "Indent" section
- "Statements within 'switch' body" checked
- "Blank lines" tab
- "Blank lines within class declarations"
- "Before field declarations": 0
- "New Lines" tab
- "Insert new line" section
- "in empty anonymous class body" unchecked
- "Control Statements" tab
- "'if else'" section
- "Keep 'then' statement on same line" checked
- "Keep 'else' statement on same line" checked
- "Keep 'return' or 'throw' clause on one line" checked
- "Line Wrapping" tab
- "Line width and indentation levels" section
- "Maximum line width": 120
- Comments tab
- "General settings" section
- "Enable header comment formatting" checked
- "Javadoc comment settings" section
- "Indent description after @param" unchecked
- "New line after @param tags" unchecked
- "Remove blank lines" checked
- "Line width" section
- "Maximum line width for comments": 120