Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

OpenJPA adheres to Sun's Code Conventions for the Java Programming Language, which is available at http://java.sun.com/docs/codeconv/

  1. Maximum line length is 120 characters (this is a deviation from the Java standards).
  2. Use spaces instead of tabs.
  3. Indendation size is 4 spaces.
  4. Do not insert a new line before opening brace. Insert a new line before closing brace.
  5. Use fully qualified import statements, i.e. do not use asterisks.

Eclipse Users

Formatter Profile

The profile can be downloaded from here - OpenJPA-formatting-preferences.xml
Updated 2009-06-29 (Eclipse Galileo) OpenJPA-eclipse-galileo-formatting.xml

  1. Window -> Preferences
  2. Java -> Code Style -> Formatter
  3. Click on import and select the OpenJPA-formatting-preferences.xml file downloaded above.
  4. Press OK after importing

...

Note: You may also use Eclipse to create a patch (Team -> Create Patch...), but this may require committers to modify the patch to match their project layout (workspace per branch or all branches in one workspace) and some committers may not be using Eclipse/Subclipse.

TestCases

When we make a change it's generally a good idea to include a jUnit testcase which demonstrates the desired behavior. Changes that only affect a specific database or only operate in a certain environment (ie DB2 on Z/OS, or only when used with SunOne) are exceptions to the rule.

The testcase should be self validating via jUnit asserts. Writing messages to system.err or system.out is discouraged - they lead to the impression that some manual interpretation of the results must be done. Messages like these are useful when developing the tests or when diagnosing problems but should not be committed.