...
- 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 96 characters.
Create Javadocs for types of at least the following descriptivity
Code Block /** * @author Joe Developer * @date MMM DD, YYYY */ public class MyClass
Include the following license statement as a header for every file (using appropriate commenting syntax):Each source file should contain a license header. The following is an example, but the actual license header should be inserted as part of build.
Code Block language java /** * TheCopyright contents2013 of this file are subject to the license and copyright terms * detailed in the license directory at the rootDuraSpace, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the sourceLicense treeat (also* * available online at http://fedora-commonswww.apache.org/license/). */licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
To check for missing headers
Code Block language bash mvn license:check
To add missing headers
Code Block language bash mvn license:format
IDE Setups
IDE settings can be found in fcrepo4/etc in the project source.
...