google-java-format icon indicating copy to clipboard operation
google-java-format copied to clipboard

Formatter fails with Javadoc on import

Open carl-mastrangelo opened this issue 6 years ago • 1 comments

The annotation is wrong for the Java file, but this is a compiling, small reproducing case. The following file complains about syntax errors:

package foo;

import groovy.transform.CompileStatic;

/**
 * Created.
 */
import java.util.ArrayList;

/**
 * Created.
 */
@CompileStatic
public class Broken {
    ArrayList<?> list;
}

carl-mastrangelo avatar Dec 16 '19 19:12 carl-mastrangelo

For posterity:

google-java-format T.java
T.java:error: Imports not contiguous (perhaps a comment separates them?)

i.e. https://github.com/google/google-java-format/blob/64242e17f5478eb07a2ca7e409382271765f2524/core/src/main/java/com/google/googlejavaformat/java/ImportOrderer.java#L81

cushon avatar Dec 19 '19 01:12 cushon