Guidelines for LiveTribe committers

This section describes various guidelines used by the LiveTribe project.

These guidelines include coding standards, development and release procedures, etc.

Java Coding Standards

  • Indentation of Java source code at 4 spaces.
  • No tabs present in Java source files.
  • Braces on next lines for:
    • Type declaration
      public class Foo
      {
      }
    • Method declaration
      public class Foo
      {
          public void bar()
          {
          }
      }
    • Statements
      public class Foo
      {
          public boolean bar()
          {
              if (true)
              {
                  while (false)
                  {
                      for (int i = 0; i < 1; ++i)
                      {
                          switch (i)
                          {
                              case 0:
                                  break;
                              default:
                                  throw new AssertionError();
                          }
                      }
                  }
              }
              else
              {
                  try
                  {
                      return true;
                  }
                  catch (Exception x)
                  {
                      x.printStackTrace();
                  }
                  finally
                  {
                      return false;
                  }
              }
          }
      }

IntelliJ IDEA 4.5+

Download LiveTribe-intellij.xml and copy it to ~/.IntelliJIDEA/config/codestyles then restart IDEA. On Windows, try C:\Documents and Settings\username\.IntelliJIDEA\config\codestyles.

After this, restart IDEA and open the settings to select the new code style.

Eclipse 3.x

Download [^LiveTribe-eclipse.xml].

After this, select Window -> Preferences, and open up the configuration for Java -> Code Style -> Code Formatter. Click on the button labeled Import... and select the file you downloaded. Give the style a name, and click OK.