From f3fd409c12021d523152c6f92b13a7a4dc42f506 Mon Sep 17 00:00:00 2001 From: michaeloffner Date: Fri, 8 Sep 2023 11:24:17 +0200 Subject: [PATCH] clean up --- .../java/lucee/commons/lang/StringUtil.java | 13 ------ .../lucee/runtime/op/date/DateCaster.java | 20 ---------- .../runtime/security/CredentialImpl.java | 10 ----- .../runtime/tag/util/QueryParamConverter.java | 40 ------------------- 4 files changed, 83 deletions(-) diff --git a/core/src/main/java/lucee/commons/lang/StringUtil.java b/core/src/main/java/lucee/commons/lang/StringUtil.java index 8cd414cfbb..b2ca724b4a 100644 --- a/core/src/main/java/lucee/commons/lang/StringUtil.java +++ b/core/src/main/java/lucee/commons/lang/StringUtil.java @@ -1393,19 +1393,6 @@ private static String placeholder(String str) { return new String(carr); } - /* - * public static void main(String[] args) throws PageException { Map map = new - * HashMap<>(); map.put("target", "!target!"); map.put("replace", "er"); map.put("susi", "Susanne"); - * print.e( - * replaceMap("I want replace replace to add 1 underscore with struct-replace... 'target' replace", - * map, false)); - * - * map = new HashMap<>(); map.put("Susi", "Sorglos"); map.put("Sorglos", "Susi"); - * print.e(replaceMap("Susi Sorglos foehnte ihr Haar", map, false)); - * - * } - */ - public static String unwrap(String str) { if (StringUtil.isEmpty(str)) return ""; str = str.trim(); diff --git a/core/src/main/java/lucee/runtime/op/date/DateCaster.java b/core/src/main/java/lucee/runtime/op/date/DateCaster.java index b119ceba54..87611cb14e 100755 --- a/core/src/main/java/lucee/runtime/op/date/DateCaster.java +++ b/core/src/main/java/lucee/runtime/op/date/DateCaster.java @@ -197,26 +197,6 @@ public static DateTime toDateTime(Locale locale, String str, TimeZone tz, boolea return dt; } - /* - * public static void main(String[] args) throws PageException { - * - * Locale[] locales = Locale.getAvailableLocales(); Iterator it = - * LocaleFactory.getLocales().values().iterator(); - * - * //print.e(toDateTime(new Locale("de","CH"), "06.02.2008 01:02:01 MEZ", - * TimeZone.getDefault(),null, false)); String str="dimanche, 6. avril 2008 01:02:03"; - * str="06.02.2008, 01:02:01 MEZ"; str="01.02. h CEST"; str="6-apr-2008"; - * str="Sunday, April 6, 2008 1:02:03 AM CEST"; str="Sunday, April 6, 2008 1:02:03 AM CEST"; - * str="01:02:03 o'clock CEST"; str="1:02 Uhr MEZ"; Locale l=new Locale("fr","CH"); l=new - * Locale("it","CH"); l=new Locale("en","US"); l=new Locale("en","UK"); l=new Locale("de","CH"); - * //l=new Locale("es","ES"); //l=LocaleConstant.PORTUGUESE_BRASIL; - * //l=LocaleConstant.DUTCH_NETHERLANDS; //l=LocaleConstant.ARABIC_ALGERIA; //l=Locale.CHINA; - * print.e(str); print.e(toDateTime(l, str, TimeZone.getDefault(),null, false)); - * - * - * } - */ - /** * parse a string to a Datetime Object, returns null if can't convert * diff --git a/core/src/main/java/lucee/runtime/security/CredentialImpl.java b/core/src/main/java/lucee/runtime/security/CredentialImpl.java index 080232f7b6..bc81e1fd34 100644 --- a/core/src/main/java/lucee/runtime/security/CredentialImpl.java +++ b/core/src/main/java/lucee/runtime/security/CredentialImpl.java @@ -306,14 +306,4 @@ public static Credential decode(Object encoded, Resource rolesDir, String privat public String toString() { return "username:" + username + ";password:" + password + ";roles:" + roles; } - - /* - * public static void main(String[] args) throws PageException { int i = 20; Resource rolesDir = - * ResourcesImpl.getFileResourceProvider().getResource("/Users/mic/Temp/"); String key = - * "vhvzglmjknkvug"; String salt = "dbjvzvhvnbubvuh"; CredentialImpl c = new CredentialImpl("susi", - * "sorglos", new String[] { "qqq" }, rolesDir, key, salt, i); String enc = c.encode(); Credential - * res = CredentialImpl.decode(enc, rolesDir, key, "df", i); print.e(enc); print.e(res.toString()); - * } - */ - } \ No newline at end of file diff --git a/core/src/main/java/lucee/runtime/tag/util/QueryParamConverter.java b/core/src/main/java/lucee/runtime/tag/util/QueryParamConverter.java index 493156137d..5b6229d8c6 100644 --- a/core/src/main/java/lucee/runtime/tag/util/QueryParamConverter.java +++ b/core/src/main/java/lucee/runtime/tag/util/QueryParamConverter.java @@ -374,44 +374,4 @@ private T fillSQLItem(T item, Struct sct) throws PageException, DatabaseExceptio return item; } } - - /* - * - * public static void main(String[] args) throws PageException { List one=new - * ArrayList(); one.add(new SQLItemImpl("aaa",1)); one.add(new SQLItemImpl("bbb",1)); - * - * List two=new ArrayList(); two.add(new - * NamedSQLItem("susi","sorglos",1)); two.add(new NamedSQLItem("peter","Petrus",1)); - * - * SQL sql = convert( - * "select ? as x, 'aa:a' as x from test where a=:susi and b=:peter and c=? and d=:susi", one, two); - * - * print.e(sql); - * - * // array with simple values Array arr=new ArrayImpl(); arr.appendEL("aaa"); arr.appendEL("bbb"); - * sql = convert( "select * from test where a=? and b=?", arr); print.e(sql); - * - * // array with complex values arr=new ArrayImpl(); Struct val1=new StructImpl(); val1.set("value", - * "Susi Sorglos"); Struct val2=new StructImpl(); val2.set("value", "123"); val2.set("type", - * "integer"); arr.append(val1); arr.append(val2); sql = convert( - * "select * from test where a=? and b=?", arr); print.e(sql); - * - * // array with mixed values arr.appendEL("ccc"); arr.appendEL("ddd"); sql = convert( - * "select * from test where a=? and b=? and c=? and d=?", arr); print.e(sql); - * - * // array mixed with named values Struct val3=new StructImpl(); val3.set("value", "456"); - * val3.set("type", "integer"); val3.set("name", "susi"); arr.append(val3); sql = convert( - * "select :susi as name from test where a=? and b=? and c=? and d=?", arr); print.e(sql); - * - * - * // struct with simple values Struct sct=new StructImpl(); sct.set("abc", "Sorglos"); sql = - * convert( "select * from test where a=:abc", sct); print.e(sql); - * - * // struct with mixed values sct.set("peter", val1); sct.set("susi", val3); sql = convert( - * "select :peter as p, :susi as s from test where a=:abc", sct); print.e(sql); - * - * - * } - */ - }