-
Notifications
You must be signed in to change notification settings - Fork 910
Closed
Description
No matter which SortImports option I set (ONLY, ALSO or NO), the imports are never sorted and it always returns the same result. Am I missing something here?
public static void main(String[] args) throws FormatterException {
JavaFormatterOptions options = new JavaFormatterOptions(JavadocFormatter.NONE, Style.GOOGLE, SortImports.ONLY);
Formatter formatter = new Formatter(options);
String result = formatter.formatSource("package com.google.example;\n" +
"\n" +
"import com.google.common.base.Preconditions;\n" +
"\n" +
"import org.junit.runner.RunWith;\n" +
"import org.junit.runners.JUnit4;\n" +
"\n" +
"import java.util.List;\n" +
"\n" +
"import javax.annotations.Nullable;\n" +
"\n" +
"import static org.junit.Assert.fail;\n" +
"import static com.google.truth.Truth.assertThat;\n" +
"\n" +
"@RunWith( JUnit4.class ) public class SomeTest {}");
System.out.println(result);
}
Metadata
Metadata
Assignees
Labels
No labels