Skip to content

Commit

Permalink
Migrate to the new ErrorProneFlags.getListOrEmpty outside core EP.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 568795552
  • Loading branch information
graememorgan authored and Error Prone Team committed Sep 27, 2023
1 parent e01ee72 commit 934383c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ public final class WellKnownMutability implements ThreadSafety.KnownTypes {

@Inject
WellKnownMutability(ErrorProneFlags flags) {
List<String> immutable = flags.getList("Immutable:KnownImmutable").orElse(ImmutableList.of());
ImmutableList<String> immutable = flags.getListOrEmpty("Immutable:KnownImmutable");
ImmutableList<String> mutable =
// Please use "KnownMutable", as it's a bit clearer what we mean. "KnownUnsafe" is kept
// for a while for backwards compatibility.
Stream.of("Immutable:KnownMutable", "Immutable:KnownUnsafe")
.flatMap(f -> flags.getList(f).orElse(ImmutableList.of()).stream())
.flatMap(f -> flags.getListOrEmpty(f).stream())
.collect(toImmutableList());
this.knownImmutableClasses = buildImmutableClasses(immutable);
this.knownMutableClasses = buildMutableClasses(mutable);
Expand Down

0 comments on commit 934383c

Please sign in to comment.