class AssertAll {
private AssertAll() {
/* no-op */
}
static void assertAll(Executable... executables) {
assertAll(null, executables);
}
static void assertAll(String heading, Executable... executables) {
Preconditions.notEmpty(executables, "executables array must not be null or empty");
Preconditions.containsNoNullElements(executables, "individual executables must not be null");
assertAll(heading, Arrays.stream(executables));
}
static void assertAll(Collection<Executable> executables) {
assertAll(null, executables);
}
static void assertAll(String heading, Collection<Executable> executables) {
Preconditions.notNull(executables, "executables collection must not be null");
Preconditions.containsNoNullElements(executables, "individual executables must not be null");
assertAll(heading, executables.stream());
}
static void assertAll(Stream<Executable> executables) {
assertAll(null, executables);
}
static void assertAll(String heading, Stream<Executable> executables) {
Preconditions.notNull(executables, "executables stream must not be null");
List<Throwable> failures = executables //
.map(executable -> {
Preconditions.notNull(executable, "individual executables must not be null");
try {
executable.execute();
return null;
}
catch (Throwable t) {
UnrecoverableExceptions.rethrowIfUnrecoverable(t);
return t;
}
}) //
.filter(Objects::nonNull) //
.collect(Collectors.toList());
if (!failures.isEmpty()) {
MultipleFailuresError multipleFailuresError = new MultipleFailuresError(heading, failures);
failures.forEach(multipleFailuresError::addSuppressed);
throw multipleFailuresError;
}
}
}
🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple
We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (1)
Found the answer.
assertAll(Executable... executables) is calling assertAll(null,Executable... executables)
assertAll(null,Executable... executables) is calling assertAll(String heading, Stream executables), which is the actual method that does the execution.
assertAll(null,Executable... executables) == assertAll(heading,Executable... executables)
pheww !!