Jump to: navigation, search

Difference between revisions of "DSDP/MTJ/Developer Resources/Coding Standards"

(Formatter)
 
(No difference)

Latest revision as of 09:35, 30 January 2009

In order to unify the code conventions used in MTJ, there are two template files that must be used in the Clean Up and Format actions within Eclipse

Clean Up Template

Formatter Template

  • If you are a MTJ committer make sure you clean up and format every java file before checking in to SVN.
  • If you are contributing to MTJ, a committer will make sure your code is correctly formated and cleaned up before cheking it in. However to make committers life easier, you should clean up and format you code before submitting a patch.


Clean Up

Configuration:

  1. Go to eclipse preferences (menu Window > Preferences);
  2. Go to the Clean Up page(Java > Code Style > Clean Up);
  3. Import the MTJ Clean Up Template

Usage:

  1. Open the java file to be cleaned up;
  2. Select Source > Clean Up... and follow the wizard steps. Make sure you use the MTJ profile.


Formatter

Configuration:

  1. Go to eclipse preferences (menu Window > Preferences);
  2. Go to the Formatter page(Java > Code Style > Formatter);
  3. Import the MTJ Formatter Template
  4. Make sure 'Java Conventions - MTJ' is the active profile

Usage:

  1. Open the java file to be cleaned up;
  2. Select Source > Format or press Ctrl + Shift + F.