Skip to content

Commit

Permalink
Apply suggestions from Javi's code review
Browse files Browse the repository at this point in the history
Co-authored-by: Francisco Javier Tirado Sarti <[email protected]>
  • Loading branch information
ricardozanini and fjtirado authored May 28, 2024
1 parent 500c31b commit cbb8ab0
Showing 1 changed file with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,7 @@ public WorkflowValidator reset() {
private boolean isMissingFunctionDefinition(
String functionName, List<FunctionDefinition> functions) {
if (functions != null) {
return functions.stream()
.filter(f -> f.getName().equals(functionName))
.findFirst()
.orElse(null)
== null;
return !functions.stream().anyMatch(f -> f.getName().equals(functionName));
} else {
return true;
}
Expand All @@ -377,23 +373,15 @@ private boolean isMissingEventsDefinition(String eventName, List<EventDefinition
return false;
}
if (events != null) {
return events.stream().filter(e -> e.getName().equals(eventName)).findFirst().orElse(null)
== null;
return !events.stream().anyMatch(e -> e.getName().equals(eventName));
} else {
return true;
}
}

private boolean isMissingRetryDefinition(String retryName, List<RetryDefinition> retries) {
if (retries != null) {
return retries.stream()
.filter(f -> f.getName() != null && f.getName().equals(retryName))
.findFirst()
.orElse(null)
== null;
} else {
return true;
}
return retries == null || ! retries.stream()
.anyMatch(f -> f.getName() != null && f.getName().equals(retryName));
}

private static final Set<String> skipMessages =
Expand Down

0 comments on commit cbb8ab0

Please sign in to comment.