From 82c2cc04db8946608dee0368aeedfc867f7c0a29 Mon Sep 17 00:00:00 2001 From: lukaseder Date: Tue, 10 Oct 2017 12:36:01 +0200 Subject: [PATCH] [#6666] Costly null check in CombinedCondition constructor --- .../src/main/java/org/jooq/impl/CombinedCondition.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/CombinedCondition.java b/jOOQ/src/main/java/org/jooq/impl/CombinedCondition.java index 4228f6f1cd..b5cc3c0633 100644 --- a/jOOQ/src/main/java/org/jooq/impl/CombinedCondition.java +++ b/jOOQ/src/main/java/org/jooq/impl/CombinedCondition.java @@ -69,11 +69,6 @@ final class CombinedCondition extends AbstractCondition { CombinedCondition(Operator operator, Collection conditions) { if (operator == null) throw new IllegalArgumentException("The argument 'operator' must not be null"); - if (conditions == null) - throw new IllegalArgumentException("The argument 'conditions' must not be null"); - for (Condition condition : conditions) - if (condition == null) - throw new IllegalArgumentException("The argument 'conditions' must not contain null"); this.operator = operator; this.conditions = new ArrayList(conditions.size()); @@ -91,9 +86,10 @@ final class CombinedCondition extends AbstractCondition { else this.conditions.add(condition); } - else { + else if (condition == null) + throw new IllegalArgumentException("The argument 'conditions' must not contain null"); + else this.conditions.add(condition); - } } }