From 89abebfeb092c2bb938bc9fc5e36e1d18b15ed33 Mon Sep 17 00:00:00 2001 From: Alanscut Date: Sun, 5 Jan 2020 16:46:24 +0800 Subject: [PATCH] merge if statement --- .../src/main/java/com/jayway/jsonpath/internal/Utils.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/Utils.java b/json-path/src/main/java/com/jayway/jsonpath/internal/Utils.java index ad7900fa..20663bb7 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/Utils.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/Utils.java @@ -379,10 +379,7 @@ public final class Utils { * @throws IllegalArgumentException if the character sequence is empty */ public static T notEmpty(T chars, String message, Object... values) { - if (chars == null) { - throw new IllegalArgumentException(String.format(message, values)); - } - if (chars.length() == 0) { + if (chars == null || chars.length() == 0) { throw new IllegalArgumentException(String.format(message, values)); } return chars;