diff --git a/javaguide.html b/javaguide.html index 3ce36e556..5ef0dc8dc 100644 --- a/javaguide.html +++ b/javaguide.html @@ -186,37 +186,21 @@

3.3.2 No line-wrapping

3.3.3 Ordering and spacing

- - -

Import statements are divided into the following groups, in this order, with each group -separated by a single blank line:

+

Imports are ordered as follows:

    -
  1. All static imports in a single group - -
  2. - -
  3. com.google imports - (only if this source file is in the com.google package - space)
  4. +
  5. All static imports in a single block.
  6. +
  7. All non-static imports in a single block.
  8. +
-
  • Third-party imports, one group per top-level package, in ASCII sort order - -
  • +

    If there are both static and non-static imports, a single blank line separates the two +blocks. There are no other blank lines between import statements.

    -
  • java imports
  • +

    Within each block the imported names appear in ASCII sort order. (Note: +this is not the same as the import statements being in ASCII sort order, since '.' +sorts before ';'.)

    -
  • javax imports
  • - -

    Within a group there are no blank lines, and the imported names appear in ASCII sort -order. (Note: this is not the same as the import statements being in -ASCII sort order; the presence of semicolons warps the result.)

    3.4 Class declaration

    @@ -284,9 +268,15 @@

    4.1.2 Nonempty blocks: K & R style

    else or a comma. -

    Example:

    +

    Examples:

    + +
    return () -> {
    +  while (condition()) {
    +    method();
    +  }
    +};
     
    -
    return new MyClass() {
    +return new MyClass() {
       @Override public void method() {
         if (condition()) {
           try {
    @@ -381,7 +371,8 @@ 

    4.5.1 Where to break

    such as C++ and JavaScript.) + but not + + @@ -690,7 +693,8 @@

    4.8.5 Annotations

    @Partial @Mock DataLoader loader;
     
    -

    There are no specific rules for formatting parameter and local variable annotations.

    +

    There are no specific rules for formatting annotations on parameters, local variables, or types. +

    4.8.6 Comments

    @@ -729,7 +733,7 @@

    4.8.7 Modifiers

    recommended by the Java Language Specification:

    -
    public protected private abstract static final transient volatile synchronized native strictfp
    +
    public protected private abstract default static final transient volatile synchronized native strictfp
     

    4.8.8 Numeric Literals