From 934383cac20f427e076f4e0fa41671ee70291c38 Mon Sep 17 00:00:00 2001 From: ghm Date: Wed, 27 Sep 2023 03:05:27 -0700 Subject: [PATCH] Migrate to the new ErrorProneFlags.getListOrEmpty outside core EP. PiperOrigin-RevId: 568795552 --- .../bugpatterns/threadsafety/WellKnownMutability.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java b/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java index 8488c4ea95b..15d135620db 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/WellKnownMutability.java @@ -46,12 +46,12 @@ public final class WellKnownMutability implements ThreadSafety.KnownTypes { @Inject WellKnownMutability(ErrorProneFlags flags) { - List immutable = flags.getList("Immutable:KnownImmutable").orElse(ImmutableList.of()); + ImmutableList immutable = flags.getListOrEmpty("Immutable:KnownImmutable"); ImmutableList 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);