Make JavaFormatterOptions' constructor private
MOE_MIGRATED_REVID=124791866
diff --git a/core/src/main/java/com/google/googlejavaformat/java/JavaFormatterOptions.java b/core/src/main/java/com/google/googlejavaformat/java/JavaFormatterOptions.java
index 8f74bac..a86b4ad 100644
--- a/core/src/main/java/com/google/googlejavaformat/java/JavaFormatterOptions.java
+++ b/core/src/main/java/com/google/googlejavaformat/java/JavaFormatterOptions.java
@@ -87,9 +87,7 @@
private final JavadocFormatter javadocFormatter;
private final Style style;
- /** @deprecated use {@link #builder()} instead of constructing instances directly. */
- @Deprecated // TODO(cushon): migrate to builder and make private
- public JavaFormatterOptions(JavadocFormatter javadocFormatter, Style style) {
+ private JavaFormatterOptions(JavadocFormatter javadocFormatter, Style style) {
this.javadocFormatter = javadocFormatter;
this.style = style;
}
diff --git a/core/src/main/java/com/google/googlejavaformat/java/RemoveUnusedImports.java b/core/src/main/java/com/google/googlejavaformat/java/RemoveUnusedImports.java
index 41bc91b..8c74fe8 100644
--- a/core/src/main/java/com/google/googlejavaformat/java/RemoveUnusedImports.java
+++ b/core/src/main/java/com/google/googlejavaformat/java/RemoveUnusedImports.java
@@ -25,7 +25,6 @@
import com.google.common.collect.TreeRangeMap;
import com.google.common.collect.TreeRangeSet;
import com.google.googlejavaformat.java.JavaFormatterOptions.JavadocFormatter;
-import com.google.googlejavaformat.java.JavaFormatterOptions.Style;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.dom.AST;
@@ -215,7 +214,10 @@
if (!fixedRanges.isEmpty()) {
try {
result =
- new Formatter(new JavaFormatterOptions(JavadocFormatter.GOOGLE, Style.GOOGLE))
+ new Formatter(
+ JavaFormatterOptions.builder()
+ .javadocFormatter(JavadocFormatter.GOOGLE)
+ .build())
.formatSource(result, fixedRanges.asRanges());
} catch (FormatterException e) {
// javadoc reformatting is best-effort