Code Conventions for the Platform UI Team
Eclipse idea banner

The main Eclipse coding conventions can be found here.

The Platform UI team separates the issue of coding conventions into two components: formatting, and compiler warnings and errors.

For formatting, all of our code is formatted using the built-in "Java Conventions" formatter provided by JDT. All of imports should be organized using the default settings. We discourage the use of the "Sort Memebers" functionality; however, if you are creating new files, feel free to use it if you wish. Do not use "Sort Members" on existing code.

For compiler settings, we recommend changing the following items from "Ignore" to "Warning". As a note, it is required that all Platform UI code (excluding code in "org.eclipse.ui.tests") does not contain non-externalized strings.

  • Style
    • Indirect access to a static member
    • Possible accidental boolean assignment
    • Undocumented empty block
  • Advanced
    • Local variable declaration hides another field or variable
    • Field declaration hides another field or variable
    • Usage of non-externalized strings
  • Unused Code
    • Local variable is never read
    • Unused or unread private members
    • Usage of deprecated API
    • Unnecessary semicolon
    • Unnecessary cast or 'instanceof' operation

These settings can be imported from this file.