Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

DSDP/MTJ/Developer Resources/Coding Standards

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.

Back to the top