Warning: session_start(): open(/var/lib/php/sessions/sess_en6g6sopdjvpeqidv8bk35qpbc, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
static O quickExport(O o, O dest) {
ret quickExport_impl(o, dest, new IdentityHashMap, new HashMap);
}
static O quickExport(O o, O dest, int expectedNumberOfObjects) {
ret quickExport_impl(o, dest, new IdentityHashMap(expectedNumberOfObjects), new HashMap);
}
sclass quickExport_info {
Class destClass;
Field[] fields; // source and dest field, interleaving
}
static O quickExport_impl(O o, O dest, IdentityHashMap seen, HashMap classMap) ctex {
if (o == null || o instanceof String || o instanceof Number) return o;
O oo = seen.get(o);
if (oo != null) ret oo;
if (o instanceof O[]) {
O[] l = (O[]) o;
O[] destO = new O[l.length];
seen.put(o, destO);
for (int i = 0; i < l.length; i++)
destO[i] = quickExport_impl(l[i], dest, seen, classMap);
ret destO;
}
if (o instanceof List) {
List l = cast o;
List destO = new ArrayList(l.size());
seen.put(o, destO);
for (int i = 0; i < l.size(); i++)
destO.add(quickExport_impl(l.get(i), dest, seen, classMap));
return destO;
}
if (o instanceof Map) {
Map m = cast o;
Map destO = new HashMap();
seen.put(o, destO);
for (Object e : ((Map) o).entrySet())
destO.put(
quickExport_impl(((Map.Entry) e).getKey(), dest, seen, classMap),
quickExport_impl(((Map.Entry) e).getValue(), dest, seen, classMap));
return destO;
}
Class c = o.getClass();
S className = c.getName();
if (className.startsWith("main$")) {
quickExport_info info = classMap.get(c);
if (info == null)
classMap.put(c, info = quickExport_makeInfo(c, className, dest));
if (info.destClass == null) ret o; // Class not found in target realm, keep object as is
// actually make a new object, copy fields
O destO = nuObjectWithoutArguments(info.destClass);
seen.put(o, destO);
Field[] fields = info.fields;
int n = l(fields);
for (int i = 0; i < n; i += 2)
fields[i+1].set(destO,
quickExport_impl(fields[i].get(o), dest, seen, classMap));
ret destO;
}
// assume it's a shared library object
ret o;
}
static quickExport_info quickExport_makeInfo(Class c, S className, O dest) {
new quickExport_info info;
if (!isAnonymousClassName(className))
info.destClass = getClass_vmName(dest, className);
if (c == info.destClass) info.destClass = null; // no export necessary
if (info.destClass != null) {
Map destFields = nonStaticFieldsMap(info.destClass);
new L l;
while (c != O.class) {
Field[] fields = c.getDeclaredFields();
for (Field field : fields) {
if ((field.getModifiers() & Modifier.STATIC) != 0) continue;
Field destField = destFields.get(field.getName());
if (destField != null) {
field.setAccessible(true);
destField.setAccessible(true);
l.add(field);
l.add(destField);
}
}
c = c.getSuperclass();
}
info.fields = l.toArray(new Field[l(l)]);
}
ret info;
}