From cb15103be2ba9fed32b3e6b76b73e9965b94f5dc Mon Sep 17 00:00:00 2001 From: ghm Date: Thu, 14 Apr 2022 16:24:30 -0700 Subject: [PATCH] Hardcode AlwaysThrows:MatchUuidParse. PiperOrigin-RevId: 441882375 --- .../com/google/errorprone/bugpatterns/AlwaysThrows.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/AlwaysThrows.java b/core/src/main/java/com/google/errorprone/bugpatterns/AlwaysThrows.java index abfd2d05527..f1c30c268c6 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/AlwaysThrows.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/AlwaysThrows.java @@ -134,11 +134,9 @@ void validate(MethodInvocationTree tree, String argument) { } private final ConstantExpressions constantExpressions; - private final boolean matchUuidParse; public AlwaysThrows(ErrorProneFlags flags) { this.constantExpressions = ConstantExpressions.fromFlags(flags); - this.matchUuidParse = flags.getBoolean("AlwaysThrows:MatchUuidParse").orElse(true); } @Override @@ -170,11 +168,7 @@ public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState } } Api api = - stream(Api.values()) - .filter(a -> matchUuidParse || !a.equals(Api.UUID_PARSE)) - .filter(m -> m.matcher.matches(tree, state)) - .findAny() - .orElse(null); + stream(Api.values()).filter(m -> m.matcher.matches(tree, state)).findAny().orElse(null); if (api == null) { return NO_MATCH; }