dev.languagetool.org

Java Code Style

These are our basic style rules for new Java code in LanguageTool. For IntelliJ IDEA, you might want to use these inspection settings.

Examples for proper use of whitespace:

    if (var == 2) {
      statements;
    }
    
    if (var != 3) {
      statements;
    } else {
      statements;
    }
    
    if (var == 1 && foo == 5) {
      statements;
    } else if (condition) {
      statements;
    } else if (condition) {
      statements;
    }
    
    try {
      statement;
    } catch (Exception e) {
      statement;
    } finally {
      statement;
    }