1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

Refactor: Clean up Type_ classes

This commit is contained in:
gnosygnu
2017-10-08 18:24:59 -04:00
parent 209601744e
commit d270cce881
67 changed files with 364 additions and 334 deletions

View File

@@ -66,9 +66,9 @@ public class Xot_invk_mock implements Xot_invk {
String kv_key_str = kv.Key();
Object kv_key_obj = kv.Key_as_obj();
Arg_nde_tkn_mock nde_tkn = null;
if (Type_adp_.Eq_typeSafe(kv_key_obj, Int_.Cls_ref_type)) // key is int; EX: 1 => val
if (Type_.Eq_by_obj(kv_key_obj, Int_.Cls_ref_type)) // key is int; EX: 1 => val
nde_tkn = new Arg_nde_tkn_mock(null, kv.Val_to_str_or_empty()); // add w/o key
else if (Type_adp_.Eq_typeSafe(kv.Val(), Bool_.Cls_ref_type)) { // val is boolean; EX: key => true || key => false
else if (Type_.Eq_by_obj(kv.Val(), Bool_.Cls_ref_type)) { // val is boolean; EX: key => true || key => false
boolean kv_val_bool = Bool_.Cast(kv.Val());
if (kv_val_bool)
nde_tkn = new Arg_nde_tkn_mock(kv_key_str, "1"); // true => 1 (PHP behavior)

View File

@@ -97,7 +97,7 @@ public class Xot_tmpl_wtr {
tkn.Tmpl_evaluate(ctx, src, frame, rslt_bfr);
}
catch (Exception e) {
String err_string = String_.new_u8(src, tkn.Src_bgn(), tkn.Src_end()) + "|" + Type_adp_.NameOf_obj(e) + "|" + Err_.Cast_or_make(e).To_str__log();
String err_string = String_.new_u8(src, tkn.Src_bgn(), tkn.Src_end()) + "|" + Type_.Name_by_obj(e) + "|" + Err_.Cast_or_make(e).To_str__log();
if (Env_.Mode_testing())
throw Err_.new_exc(e, "xo", err_string);
else