Skip to content

Commit

Permalink
Join: Use Precondition#checkNotNull everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalSchumacher committed May 31, 2018
1 parent 9047023 commit 2a53faa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/assertj/core/condition/Join.java
Expand Up @@ -42,7 +42,7 @@ public abstract class Join<T> extends Condition<T> {
*/
@SafeVarargs
protected Join(Condition<? super T>... conditions) {
if (conditions == null) throw conditionsIsNull();
checkNotNull(conditions, conditionsIsNull());
this.conditions = Arrays.stream(conditions).map(Join::notNull).collect(toList());
}

Expand All @@ -53,14 +53,14 @@ protected Join(Condition<? super T>... conditions) {
* @throws NullPointerException if any of the elements in the given iterable is {@code null}.
*/
protected Join(Iterable<? extends Condition<? super T>> conditions) {
if (conditions == null) throw conditionsIsNull();
checkNotNull(conditions, conditionsIsNull());
this.conditions = new ArrayList<>();
for (Condition<? super T> condition : conditions)
this.conditions.add(notNull(condition));
}

private static NullPointerException conditionsIsNull() {
return new NullPointerException("The given conditions should not be null");
private static String conditionsIsNull() {
return "The given conditions should not be null";
}

private static <T> Condition<T> notNull(Condition<T> condition) {
Expand Down

0 comments on commit 2a53faa

Please sign in to comment.