Skip to content

Commit fff0337

Browse files
mkanatronshapiro
authored andcommitted
Make google-java-format stop using "assert." Use Preconditions instead.
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=185773132
1 parent 3643f0a commit fff0337

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/main/java/com/google/googlejavaformat/java/ImportOrderer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import com.google.common.base.CharMatcher;
1919
import com.google.common.base.Optional;
20+
import com.google.common.base.Preconditions;
2021
import com.google.common.collect.ImmutableList;
2122
import com.google.common.collect.ImmutableSet;
2223
import com.google.common.collect.ImmutableSortedSet;
@@ -242,7 +243,7 @@ private ImportsAndIndex scanImports(int i) throws FormatterException {
242243

243244
// Produces the sorted output based on the imports we have scanned.
244245
private String reorderedImportsString(ImmutableSortedSet<Import> imports) {
245-
assert !imports.isEmpty();
246+
Preconditions.checkArgument(!imports.isEmpty(), "imports");
246247

247248
Import firstImport = imports.iterator().next();
248249

0 commit comments

Comments
 (0)