Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

import java.util.Arrays;
import java.util.List;
import java.util.Objects;

public class AggregatedOperatorException extends OperatorException {

private final List<Exception> causes;

public AggregatedOperatorException(String message, Exception... exceptions) {
super(message, exceptions[0]);
super(message, Objects.requireNonNull(exceptions)[0]);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't help, actually, since this still will throw an NPE if exceptions isn't present. With varargs, it's a definite possibility, though, granted, creating an AggregatedOperatorException and not passing any exceptions is probably expected to fail…

this.causes = Arrays.asList(exceptions);
}

public AggregatedOperatorException(String message, List<Exception> exceptions) {
super(message, exceptions.get(0));
super(message, Objects.requireNonNull(exceptions).get(0));
this.causes = exceptions;
}

Expand Down