Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: macker was replaced by checkstyle

We have two sets of coding standards.  First are the firm standards, which must be adhered by all code contributed to the system.  Second are the guidelines, which should generally be followed; however, we fully recognize that exceptions may occur.

Firm Standards

Modified lines should have trailing spaces stripped.

...

All conditionals should have brackets, even those which are a single line long.

Guidelines

A single line of whitespace between methods is all that is needed.

Avoid JavaDocs which add no explanation beyond what can be easily deduced from the code.

For the most part, classes should be laid out in the following order:

...

LOG

...

fields

...

constructors

...

overridden methods (public)

...

protected/private methods

...

getters and setters with logic

...

Organize classes in a meaningful order as recommending in Java Coding Standards#ClassStructure

Avoid Importing Unwanted Classes

Sometimes it can be easy to import the wrong version of a class, often because of maven transitive dependencies. For example, we have upgraded libraries such as commons-lang and commons-collections to newer versions with new packages, but the older versions are still coming into the project as transitive dependencies. We have also removed some dependencies, such as guava and jdom from Kuali Financials, but these too are pulled in as transitive dependencies. We have added a maven plugin to fail the build at the compile phase if there are classes imported incorrectly. However, it can also be helpful to avoid these imports during development with help from your IDE.

  • In Intellij, go to Preferences > Editor > General > Auto Import, Java and enter the list of packages to exclude under Exclude from Import and Completion. The list of what to exclude can be found in the checkstyle.xml file in the root of the financials project. You can also exclude classes directly from the Class picker dialog.