diff --git a/core/src/main/java/lucee/commons/cli/Command.java b/core/src/main/java/lucee/commons/cli/Command.java index 00a19fb87d..c05aaada41 100644 --- a/core/src/main/java/lucee/commons/cli/Command.java +++ b/core/src/main/java/lucee/commons/cli/Command.java @@ -166,7 +166,7 @@ private static void populateList(StringBuilder sb, ArrayList list) { String tmp = sb.toString(); tmp = tmp.trim(); - if (tmp.length() > 0) list.add(tmp); + if (!StringUtil.isEmpty(tmp)) list.add(tmp); sb.delete(0, sb.length()); } } diff --git a/core/src/main/java/lucee/commons/io/compress/CompressUtil.java b/core/src/main/java/lucee/commons/io/compress/CompressUtil.java index 1f0d68745b..6de99965aa 100644 --- a/core/src/main/java/lucee/commons/io/compress/CompressUtil.java +++ b/core/src/main/java/lucee/commons/io/compress/CompressUtil.java @@ -514,7 +514,7 @@ public static void compressZip(Resource[] sources, ZipOutputStream zos, Resource } private static void compressZip(String parent, Resource[] sources, ZipOutputStream zos, ResourceFilter filter) throws IOException { - if (parent.length() > 0) parent += "/"; + if (!StringUtil.isEmpty(parent)) parent += "/"; if (sources != null) { for (int i = 0; i < sources.length; i++) { compressZip(parent + sources[i].getName(), sources[i], zos, filter); @@ -581,7 +581,7 @@ public static void compressTar(Resource[] sources, OutputStream target, int mode public static void compressTar(String parent, Resource[] sources, TarArchiveOutputStream tos, int mode) throws IOException { - if (parent.length() > 0) parent += "/"; + if (!StringUtil.isEmpty(parent)) parent += "/"; if (sources != null) { for (int i = 0; i < sources.length; i++) { compressTar(parent + sources[i].getName(), sources[i], tos, mode); diff --git a/core/src/main/java/lucee/commons/io/compress/ZipUtil.java b/core/src/main/java/lucee/commons/io/compress/ZipUtil.java index ba7aa3bdb3..cd8608f72c 100644 --- a/core/src/main/java/lucee/commons/io/compress/ZipUtil.java +++ b/core/src/main/java/lucee/commons/io/compress/ZipUtil.java @@ -30,7 +30,7 @@ public final class ZipUtil { public static void unzip(Resource zip, Resource dir) throws IOException { - if (zip.length() > 0 && (dir.exists() || dir.mkdirs())) { + if (zip != null && zip.length() > 0 && (dir.exists() || dir.mkdirs())) { if ("Mac OS X".equalsIgnoreCase(System.getProperty("os.name"))) { try { // Command.execute("unzip "+zip+" -d "+dir); diff --git a/core/src/main/java/lucee/commons/lang/StringUtil.java b/core/src/main/java/lucee/commons/lang/StringUtil.java index b57935532c..fd1afc9a6e 100644 --- a/core/src/main/java/lucee/commons/lang/StringUtil.java +++ b/core/src/main/java/lucee/commons/lang/StringUtil.java @@ -904,11 +904,11 @@ public static int indexOfIgnoreCase(String haystack, String needle, int offset) * @return is first of given type */ public static boolean startsWith(String str, char prefix) { - return str != null && str.length() > 0 && str.charAt(0) == prefix; + return !StringUtil.isEmpty(str) && str.charAt(0) == prefix; } public static boolean startsWith(String str, char prefix1, char prefix2) { - return str != null && str.length() > 0 && (str.charAt(0) == prefix1 || str.charAt(0) == prefix2); + return !StringUtil.isEmpty(str) && (str.charAt(0) == prefix1 || str.charAt(0) == prefix2); } /** diff --git a/core/src/main/java/lucee/runtime/ComponentImpl.java b/core/src/main/java/lucee/runtime/ComponentImpl.java index 715f6159ae..d97db0e4ab 100755 --- a/core/src/main/java/lucee/runtime/ComponentImpl.java +++ b/core/src/main/java/lucee/runtime/ComponentImpl.java @@ -1032,7 +1032,7 @@ public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties if (top.properties.modifier != Member.MODIFIER_NONE) table.appendRow(1, new SimpleDumpData("Modifier"), new SimpleDumpData(ComponentUtil.toModifier(top.properties.modifier, ""))); - if (top.properties.hint.trim().length() > 0) table.appendRow(1, new SimpleDumpData("Hint"), new SimpleDumpData(top.properties.hint)); + if (!StringUtil.isEmpty(top.properties.hint, true)) table.appendRow(1, new SimpleDumpData("Hint"), new SimpleDumpData(top.properties.hint)); // this DumpTable thisScope = thisScope(top, pageContext, maxlevel, dp, access); diff --git a/core/src/main/java/lucee/runtime/ComponentPageImpl.java b/core/src/main/java/lucee/runtime/ComponentPageImpl.java index 0ec64d4788..7b3656c2cf 100755 --- a/core/src/main/java/lucee/runtime/ComponentPageImpl.java +++ b/core/src/main/java/lucee/runtime/ComponentPageImpl.java @@ -253,8 +253,7 @@ else if ((method = getURLorForm(pc, KeyConstants._method, null)) != null) { // DUMP if (!req.getServletPath().equalsIgnoreCase("/Web." + (lucee.runtime.config.Constants.getCFMLComponentExtension()))) { String cdf = pc.getConfig().getComponentDumpTemplate(); - - if (cdf != null && cdf.trim().length() > 0) { + if (!StringUtil.isEmpty(cdf, true)) { pc.variablesScope().set(KeyConstants._component, component); pc.doInclude(cdf, false); } diff --git a/core/src/main/java/lucee/runtime/InterfacePageImpl.java b/core/src/main/java/lucee/runtime/InterfacePageImpl.java index d3d2483625..3f693f28ed 100755 --- a/core/src/main/java/lucee/runtime/InterfacePageImpl.java +++ b/core/src/main/java/lucee/runtime/InterfacePageImpl.java @@ -18,6 +18,7 @@ package lucee.runtime; import lucee.commons.lang.ExceptionUtil; +import lucee.commons.lang.StringUtil; import lucee.runtime.dump.DumpUtil; import lucee.runtime.dump.DumpWriter; import lucee.runtime.exp.ApplicationException; @@ -31,10 +32,12 @@ */ public abstract class InterfacePageImpl extends InterfacePage implements PagePro { + @Override public int getHash() { return 0; } + @Override public long getSourceLength() { return 0; } @@ -76,7 +79,7 @@ else if (qs != null && qs.trim().equalsIgnoreCase("wsdl")) // DUMP // TODO component.setAccess(pc,Component.ACCESS_PUBLIC); String cdf = pc.getConfig().getComponentDumpTemplate(); - if (cdf != null && cdf.trim().length() > 0) { + if (!StringUtil.isEmpty(cdf)) { pc.variablesScope().set(KeyConstants._component, interf); pc.doInclude(cdf, false); } diff --git a/core/src/main/java/lucee/runtime/type/query/SimpleQuery.java b/core/src/main/java/lucee/runtime/type/query/SimpleQuery.java index 303f7bd24e..566437cd8f 100644 --- a/core/src/main/java/lucee/runtime/type/query/SimpleQuery.java +++ b/core/src/main/java/lucee/runtime/type/query/SimpleQuery.java @@ -647,7 +647,7 @@ public QueryColumn getColumn(String key, QueryColumn defaultValue) { @Override public QueryColumn getColumn(Key key, QueryColumn defaultValue) { - if (key.getString().length() > 0) { + if (!StringUtil.isEmpty(key.getString())) { char c = key.lowerCharAt(0); if (c == 'r') { if (key.equals(KeyConstants._RECORDCOUNT)) return new QueryColumnRef(this, key, Types.INTEGER); diff --git a/core/src/main/java/lucee/runtime/type/util/ArrayUtil.java b/core/src/main/java/lucee/runtime/type/util/ArrayUtil.java index 09b697729f..07a067ac8d 100755 --- a/core/src/main/java/lucee/runtime/type/util/ArrayUtil.java +++ b/core/src/main/java/lucee/runtime/type/util/ArrayUtil.java @@ -584,7 +584,7 @@ else if (o instanceof char[]) { char[] arr = ((char[]) o); if (arr.length > index) { String str = Caster.toString(value, null); - if (str != null && str.length() > 0) { + if (!StringUtil.isEmpty(str)) { char c = str.charAt(0); arr[index] = c; return str; diff --git a/core/src/main/java/lucee/runtime/type/util/ListUtil.java b/core/src/main/java/lucee/runtime/type/util/ListUtil.java index 3493ea7995..b6603b2f1a 100755 --- a/core/src/main/java/lucee/runtime/type/util/ListUtil.java +++ b/core/src/main/java/lucee/runtime/type/util/ListUtil.java @@ -378,7 +378,7 @@ public static Array listToArrayTrim(String list, String delimiter) { char c; // remove at start - outer: while (list.length() > 0) { + outer: while (!StringUtil.isEmpty(list)) { c = list.charAt(0); for (int i = 0; i < del.length; i++) { if (c == del[i]) { @@ -390,7 +390,7 @@ public static Array listToArrayTrim(String list, String delimiter) { } int len; - outer: while (list.length() > 0) { + outer: while (!StringUtil.isEmpty(list)) { c = list.charAt(list.length() - 1); for (int i = 0; i < del.length; i++) { if (c == del[i]) { @@ -420,7 +420,7 @@ public static Array listToArrayTrim(String list, String delimiter, int[] info) { char c; // remove at start - outer: while (list.length() > 0) { + outer: while (!StringUtil.isEmpty(list)) { c = list.charAt(0); for (int i = 0; i < del.length; i++) { if (c == del[i]) { @@ -433,7 +433,7 @@ public static Array listToArrayTrim(String list, String delimiter, int[] info) { } int len; - outer: while (list.length() > 0) { + outer: while (!StringUtil.isEmpty(list)) { c = list.charAt(list.length() - 1); for (int i = 0; i < del.length; i++) { if (c == del[i]) { @@ -543,7 +543,7 @@ public static String listInsertAt(String list, int pos, String value, String del // remove at start if (ignoreEmpty) { - outer: while (list.length() > 0) { + outer: while (!StringUtil.isEmpty(list)) { c = list.charAt(0); for (int i = 0; i < del.length; i++) { if (c == del[i]) { diff --git a/core/src/main/java/lucee/transformer/cfml/expression/AbstrCFMLExprTransformer.java b/core/src/main/java/lucee/transformer/cfml/expression/AbstrCFMLExprTransformer.java index 817b29ac86..ef7dc3d0c0 100755 --- a/core/src/main/java/lucee/transformer/cfml/expression/AbstrCFMLExprTransformer.java +++ b/core/src/main/java/lucee/transformer/cfml/expression/AbstrCFMLExprTransformer.java @@ -23,6 +23,7 @@ import java.util.List; import lucee.commons.lang.ExceptionUtil; +import lucee.commons.lang.StringUtil; import lucee.runtime.Component; import lucee.runtime.exp.PageException; import lucee.runtime.exp.PageRuntimeException; @@ -1126,7 +1127,7 @@ private LitNumber number(Data data) throws TemplateException { if (data.srcCode.forwardIfCurrent('.')) { rtn.append('.'); String rightSite = digit(data); - if (rightSite.length() > 0 && data.srcCode.forwardIfCurrent('e')) { + if (!StringUtil.isEmpty(rightSite) && data.srcCode.forwardIfCurrent('e')) { Boolean expOp = null; if (data.srcCode.forwardIfCurrent('+')) expOp = Boolean.TRUE; else if (data.srcCode.forwardIfCurrent('-')) expOp = Boolean.FALSE; diff --git a/core/src/main/java/lucee/transformer/cfml/tag/CFMLTransformer.java b/core/src/main/java/lucee/transformer/cfml/tag/CFMLTransformer.java index 56857ae946..93cd5c4246 100755 --- a/core/src/main/java/lucee/transformer/cfml/tag/CFMLTransformer.java +++ b/core/src/main/java/lucee/transformer/cfml/tag/CFMLTransformer.java @@ -1216,7 +1216,7 @@ public static Expression attributeValue(Data data, TagLibTag tag, String type, b } else expr = transfomer.transform(data); } - if (type.length() > 0) { + if (!StringUtil.isEmpty(type)) { expr = data.factory.toExpression(expr, type); } } diff --git a/loader/build.xml b/loader/build.xml index eb74068feb..0953412af3 100644 --- a/loader/build.xml +++ b/loader/build.xml @@ -2,7 +2,7 @@ - + diff --git a/loader/pom.xml b/loader/pom.xml index 0643fb522f..b553f088d4 100644 --- a/loader/pom.xml +++ b/loader/pom.xml @@ -3,7 +3,7 @@ org.lucee lucee - 6.1.0.74-SNAPSHOT + 6.1.0.75-SNAPSHOT jar Lucee Loader Build diff --git a/loader/src/main/java/coldfusion/cfc/CFCProxy.java b/loader/src/main/java/coldfusion/cfc/CFCProxy.java index 8e4cf178c0..4662534581 100644 --- a/loader/src/main/java/coldfusion/cfc/CFCProxy.java +++ b/loader/src/main/java/coldfusion/cfc/CFCProxy.java @@ -27,8 +27,8 @@ import java.util.Map; import java.util.Map.Entry; -import /* JAVJAK */ javax.servlet.http.HttpServletRequest; -import /* JAVJAK */ javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import lucee.loader.engine.CFMLEngine; import lucee.loader.engine.CFMLEngineFactory;