diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/StringUtils.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/StringUtils.java index 838931105..9b701b22d 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/StringUtils.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/StringUtils.java @@ -11,7 +11,8 @@ public class StringUtils { } public static String quote(String s) { - return s.isEmpty() ? "" : '"' + s + '"'; + boolean b = s.isEmpty(); + return isEmpty(s) ? "" : '"' + s + '"'; } public static String join(List list, boolean quote, String glue) { @@ -41,5 +42,9 @@ public class StringUtils { public static String quotedList(List list, String glue) { return join(list, true, glue); - } + } + + public static boolean isEmpty(String s) { + return s == null || s.length() <= 0; + } }