Skip to content

Commit

Permalink
Use immutable interface type for constant field declarations
Browse files Browse the repository at this point in the history
MOE_MIGRATED_REVID=149068579
  • Loading branch information
dorireuv authored and cushon committed Mar 8, 2017
1 parent 840bdbd commit 2928994
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -30,7 +30,6 @@
import com.google.common.collect.ImmutableTable;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Table;
import com.google.common.collect.Table.Cell;
import com.google.errorprone.BugPattern;
import com.google.errorprone.VisitorState;
Expand Down Expand Up @@ -78,7 +77,7 @@ private enum ExpressionType { LESS_THAN_EQUAL, GREATER_THAN_EQUAL, MISMATCH}

// Class name, whether it uses SIZE or LENGTH, whether or not the class has an appropriate
// isEmpty() method
private static final Table<String, MethodName, Boolean> CLASSES =
private static final ImmutableTable<String, MethodName, Boolean> CLASSES =
ImmutableTable.<String, MethodName, Boolean>builder()
.put("com.google.common.collect.FluentIterable", MethodName.SIZE, true)
.put("com.google.common.collect.Multimap", MethodName.SIZE, true)
Expand All @@ -91,9 +90,9 @@ private enum ExpressionType { LESS_THAN_EQUAL, GREATER_THAN_EQUAL, MISMATCH}
.put("java.lang.String", MethodName.LENGTH, true)
.put("java.lang.StringBuilder", MethodName.LENGTH, false)
.put("java.lang.StringBuffer", MethodName.LENGTH, false)
.build();
.build();

private static final Table<String, MethodName, Boolean> STATIC_CLASSES =
private static final ImmutableTable<String, MethodName, Boolean> STATIC_CLASSES =
ImmutableTable.<String, MethodName, Boolean>builder()
.put("com.google.common.collect.Iterables", MethodName.SIZE, true)
.build();
Expand Down

0 comments on commit 2928994

Please sign in to comment.