X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altoslib%2FAltosJson.java;h=67f3a00ad3fdc2502e7921cc962ad98b5a8e5bb1;hb=c8775ef66d793502de07cca0080366739a4c2970;hp=80d83e48c94c89cb9621d327a04b56dcff543910;hpb=a46df4f69984e3ef0064c2b211438c8d8ffaab68;p=fw%2Faltos diff --git a/altoslib/AltosJson.java b/altoslib/AltosJson.java index 80d83e48..67f3a00a 100644 --- a/altoslib/AltosJson.java +++ b/altoslib/AltosJson.java @@ -1063,7 +1063,7 @@ public class AltosJson extends JsonUtil { } else { object = c.newInstance(); } - for (; c != null; c = c.getSuperclass()) { + for (; c != Object.class; c = c.getSuperclass()) { for (Field field : c.getDeclaredFields()) { String fieldName = field.getName(); Class fieldClass = field.getType(); @@ -1080,17 +1080,27 @@ public class AltosJson extends JsonUtil { field.set(object, val); } } catch (IllegalAccessException ie) { + System.out.printf("%s:%s %s\n", + c.getName(), fieldName, ie.toString()); } } } ret = object; } catch (InvocationTargetException ie) { + System.out.printf("%s: %s\n", + c.getName(), ie.toString()); ret = null; } catch (NoSuchMethodException ie) { + System.out.printf("%s: %s\n", + c.getName(), ie.toString()); ret = null; } catch (InstantiationException ie) { + System.out.printf("%s: %s\n", + c.getName(), ie.toString()); ret = null; } catch (IllegalAccessException ie) { + System.out.printf("%s: %s\n", + c.getName(), ie.toString()); ret = null; } } @@ -1198,7 +1208,7 @@ public class AltosJson extends JsonUtil { } } else { assert_hash(true); - for (Class c = object.getClass(); c != null; c = c.getSuperclass()) { + for (Class c = object.getClass(); c != Object.class; c = c.getSuperclass()) { for (Field field : c.getDeclaredFields()) { String fieldName = field.getName(); @@ -1223,6 +1233,8 @@ public class AltosJson extends JsonUtil { put(fieldName, json); } } catch (IllegalAccessException ie) { + System.out.printf("%s:%s %s\n", + c.getName(), fieldName, ie.toString()); } } }