Transpiled version (3857L) is out of date.
// o is either a map already (string->object) or an arbitrary object, // in which case its fields are converted into a map. static Map<S, O> objectToMap(O o) ctex { if (o instanceof Map) ret (Map) o; if (o == null) null; new TreeMap<S, O> map; Class c = o.getClass(); while (c != Object.class) { Field[] fields = c.getDeclaredFields(); for (final Field field : fields) { if ((field.getModifiers() & Modifier.STATIC) != 0) continue; field.setAccessible(true); final Object value = field.get(o); if (value != null) map.put(field.getName(), value); } c = c.getSuperclass(); } // XXX NEW - hopefully this doesn't break anything if (o instanceof DynamicObject) putAll(map, o/DynamicObject.fieldValues); ret map; } // same for a collection (convert each element) static L<Map<S, O>> objectToMap(Iterable l) { if (l == null) null; new L x; for (O o : l) x.add(objectToMap(o)); ret x; }
download show line numbers debug dex old transpilations
Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv
No comments. add comment