Skip to content

Commit

Permalink
Hardcode AlwaysThrows:MatchUuidParse.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 441882375
  • Loading branch information
graememorgan authored and Error Prone Team committed Apr 14, 2022
1 parent 2d20166 commit cb15103
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit cb15103

Please sign in to comment.