Skip to content

Commit

Permalink
Add more Guava types to ModifiedButNotUsed.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 576139694
  • Loading branch information
graememorgan authored and Error Prone Team committed Oct 26, 2023
1 parent c57fd56 commit bfd7cf1
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,24 @@
public class ModifiedButNotUsed extends BugChecker
implements ExpressionStatementTreeMatcher, VariableTreeMatcher {

// Note: we're only using the Builders of these, and there's a subtype relationship, so, for
// example, ImmutableSet.Builder (extends ImmutableCollection.Builder) doesn't need to be
// specified.
private static final ImmutableSet<String> GUAVA_IMMUTABLES =
ImmutableSet.of(
// keep-sorted start
"com.google.common.collect.ImmutableClassToInstanceMap",
"com.google.common.collect.ImmutableCollection",
"com.google.common.collect.ImmutableMap",
"com.google.common.collect.ImmutableMultimap");
"com.google.common.collect.ImmutableMultimap",
"com.google.common.collect.ImmutableMultiset",
"com.google.common.collect.ImmutableRangeMap",
"com.google.common.collect.ImmutableRangeSet",
"com.google.common.collect.ImmutableSortedMap",
"com.google.common.collect.ImmutableSortedSet",
"com.google.common.collect.ImmutableTable"
// keep-sorted end
);

private static final ImmutableSet<String> COLLECTIONS =
concat(
Expand Down

0 comments on commit bfd7cf1

Please sign in to comment.