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

Refactor: Clean up Int_ classes

This commit is contained in:
gnosygnu
2017-10-22 08:07:00 -04:00
parent d270cce881
commit 3157551d1d
154 changed files with 609 additions and 577 deletions

View File

@@ -55,7 +55,7 @@ public class Xocfg_mgr implements Gfo_invk {
}
public int Get_int_app_or(String key, int or) {
String rv = cache_mgr.Get_or(Ctx__app, key, null);
return rv == null ? or : Int_.parse_or(rv, or);
return rv == null ? or : Int_.Parse_or(rv, or);
}
public long Get_long_app_or(String key, long or) {
String rv = cache_mgr.Get_or(Ctx__app, key, null);
@@ -83,7 +83,7 @@ public class Xocfg_mgr implements Gfo_invk {
}
public int Get_int_wiki_or(Xow_wiki wiki, String key, int or) {
String rv = Get_str(wiki.Domain_itm().Abrv_xo_str(), key);
try {return Int_.parse(rv);}
try {return Int_.Parse(rv);}
catch (Exception exc) {
Err_.Noop(exc);
Gfo_usr_dlg_.Instance.Warn_many("", "", "cfg:failed to parse int; key=~{0} val=~{1}", key, rv);
@@ -92,7 +92,7 @@ public class Xocfg_mgr implements Gfo_invk {
}
public int Get_int_or(String ctx, String key, int or) {
String rv = cache_mgr.Get(ctx, key);
try {return Int_.parse(rv);}
try {return Int_.Parse(rv);}
catch (Exception exc) {
Err_.Noop(exc);
Gfo_usr_dlg_.Instance.Warn_many("", "", "cfg:failed to parse int; key=~{0} val=~{1}", key, rv);

View File

@@ -51,7 +51,7 @@ public class Xocfg_map_tbl implements Db_tbl {
try {
if (!rdr.Move_next()) return 0;
Object max = rdr.Read_obj(fld__map_sort);
return max == null ? 0 : Int_.cast(max) + 10;
return max == null ? 0 : Int_.Cast(max) + 10;
}
finally {rdr.Rls();}
}

View File

@@ -30,7 +30,7 @@ class Xocfg_maint_parser {
private Xocfg_maint_nde Parse_nde(GfoMsg msg) {
Ordered_hash hash = To_atr_hash(msg);
// get common atrs
int id = Int_.parse(Get_atr_as_str_or_fail(hash, "id_"));
int id = Int_.Parse(Get_atr_as_str_or_fail(hash, "id_"));
String owner = Get_atr_as_str_or_fail(hash, "owner_");
String key = Get_atr_as_str_or_fail(hash, "key_");
String name = Get_atr_as_str_or_fail(hash, "name_");