Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Four space indents for Java, and 2-space indents for XML. NO TABS
  2. K&R style braces

    Code Block
    if (code) {
      // code
    } else {
      // code
    }
    
  3. Do not use wildcard imports
  4. Write Javadocs for public methods and classes. Keep it short and to the point
  5. Avoid public instance variables; use accessors
  6. Use public methods sparingly; implementation details are not public
  7. Maximum length of lines is 120 characters.
  8. Create Javadocs for types of at least the following descriptivity

    Code Block
    /**
     * @author Joe Developer
     * @since MMM DD, YYYY
     */
    public class MyClass
  9. Each source file should contain a license header much like the following:

    Code Block
    languagejava
    /**
     * Copyright 20132015 DuraSpace, 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 License at
     *
     *     http://www.apache.org/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.
     */

    Use the maven-license-plugin to check for and add missing headers:

    Code Block
    languagebash
    titleCheck for missing headers
    mvn license:check
    Code Block
    languagebash
    titleAdd missing headers
    mvn license:format

...