These are the The code style conventions used in the project are based on the style-guide defined of Fedora-3. They should prevent commits cluttered with format changes, we hope..
Formatting Rules
Here are the major rules:
- Four space indents for Java, and 2-space indents for XML. NO TABS
K&R style braces
Code Block if (code) { // code } else { // code }
- Do not use wildcard imports
- Write Javadocs for public methods and classes. Keep it short and to the point
- Avoid public instance variables; use accessors
- Use public methods sparingly; implementation details are not public
- Maximum length of lines is 80 characters.
@Author
Code Block /** * @author Joe Developer */ public class MyClass
IDE Setups
IDE settings can be found in fcrepo4/etc in the project source.
- Eclipse settings are here: fcrepo4/etc/eclipse-prefs
- Intellij settings TBD
Your Name
In your class or type template, make sure the comment includes an author tag with your full name:
/**
* @author Joe Developer
*/
public class MyClass
Tabs?
All Indents are 4 spaces, – no tabs –
Blocks and Conditions
Conditions are their expressions are separated by a space:
if (myVar != null) {
return;
}
Line Length
Maximum length of lines is 80 characters.
...