Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Sep 8, 2023
1 parent bc4abe4 commit 64ad7a5
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 78 deletions.
7 changes: 0 additions & 7 deletions core/src/main/java/lucee/runtime/op/Decision.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import lucee.print;
import lucee.commons.date.DateTimeUtil;
import lucee.commons.i18n.FormatUtil;
import lucee.commons.lang.CFTypes;
Expand Down Expand Up @@ -156,12 +155,6 @@ else if (value instanceof CharSequence || value instanceof Character) {
else return false;
}

public static void main(String[] args) throws PageException {
print.e(isNumber("0."));
print.e(isNumber(".0"));
print.e(isNumber("."));
}

/**
* tests if String value is Numeric
*
Expand Down
20 changes: 0 additions & 20 deletions core/src/main/java/lucee/runtime/op/date/DateCaster.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Locale> 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
*
Expand Down
10 changes: 0 additions & 10 deletions core/src/main/java/lucee/runtime/security/CredentialImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,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());
* }
*/

}
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ else if (!inQuotes) {
continue;
}

if (++_qm > initialParamSize) throw new ApplicationException("there are more question marks in the SQL than params defined" , "SQL: " + sql + "");
if (++_qm > initialParamSize) throw new ApplicationException("there are more question marks in the SQL than params defined", "SQL: " + sql + "");
}
else if (c == ':') {

Expand Down Expand Up @@ -373,44 +373,4 @@ private T fillSQLItem(T item, Struct sct) throws PageException, DatabaseExceptio
return item;
}
}

/*
*
* public static void main(String[] args) throws PageException { List<SQLItem> one=new
* ArrayList<SQLItem>(); one.add(new SQLItemImpl("aaa",1)); one.add(new SQLItemImpl("bbb",1));
*
* List<NamedSQLItem> two=new ArrayList<NamedSQLItem>(); 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);
*
*
* }
*/

}

0 comments on commit 64ad7a5

Please sign in to comment.