Page History
...
Proposed DSpace Java Style Guide (work-in-progress - not yet approved)
Info |
---|
If you would like to comment on this proposal, please add your thoughts to this Pull Request: https://github.com/DSpace/DSpace/pull/1895 |
Bolded rules are a change from our current Style Guide.
- 4-space indents for Java, and 2-space indents for XML. NO TABS ALLOWED.
- Only exception is throws clause, which should be indented 8 spaces if on a new line
K&R style braces required. Braces required on all blocks.
Code Block if (code) { // code } else { // code }
- Do not use wildcard imports (e.g.
import java.util.*
). Duplicated or unused imports are also not allowed. - Write Javadocs for public methods and classes. Keep it short and to the point.
- (UNDER DISCUSSION) Javadoc
@author
tags are optional, but should refer to an individual's name or handle (e.g. GitHub username) when included?
- (UNDER DISCUSSION) Javadoc
Maximum length of lines is 120 characters.
UTF-8 encoding is required- No trailing spaces allowed (except in comments)
- Tokens should be surrounded by whitespace, e.g. http://checkstyle.sourceforge.net/config_whitespace.html#WhitespaceAround
Each source file must contain the required license header, e.g.
Code Block /** * The contents of this file are subject to the license and copyright * detailed in the LICENSE and NOTICE files at the root of the source * tree and available online at * * http://www.dspace.org/license/ */
...
Overview
Content Tools