Coding Conventions

Oracle has established coding standards that are generally considered reasonable, as evidenced by their widespread adoption by other Java-based development efforts. One of the goals is to make the Eclipse Platform blend in with the Java platform. This goal is furthered by our following suit.

Oracle's Code Conventions for the Java Programming Language[1]
covers filenames, file organization, indentation, comments, declarations, statements, white space, naming conventions, and programming practices. All code written for the Eclipse Platform should follow these conventions except as noted below. We deviate only in places where our needs differ from Oracle's; when we do deviate, we explain why. (The section numbers shown below are Oracle's.)

Section 3.1.1 Beginning Comments

The Eclipse project has specific guidelines for copyright notices to appear at the beginning of source files. See the Eclipse Project Charter for details.

Section 4 Indentation

We indent with tabs (4 spaces wide), since mixed indents are a mess.

Section 9 Naming Conventions

The Eclipse project has more specific naming conventions. See Eclipse Project Naming Conventions for details.

For Eclipse projects, there is no policy that requires a specific coding format or style, though the Eclipse style in the formatter and cleanup is preferred. Project teams typically determine their own styles and then commit the appropriate files. One way is to commit files on a per-project basis, the other is to have a central set of files that should be imported by each committer. See Eclipse Incubation Mailing List, 20-June-2016.