Object readResolve() { final Map<String, String> fields; if (f == null) { fields = Collections.emptyMap(); } else { final int fl = f.length; if ((fl & 1) != 0) { throw CommonMessages.msg.invalidOddFields(); } else if (fl == 0) { fields = Collections.emptyMap(); } else if (fl == 2) { fields = Collections.singletonMap(f[0], f[1]); } else { final TreeMap<String, String> map = new TreeMap<>(); for (int i = 0; i < fl; i += 2) { map.put(f[i], f[i + 1]); } fields = Collections.unmodifiableMap(map); } } final RemoteExceptionCause ex = new RemoteExceptionCause(m, c, cn, fields, false); ex.setStackTrace(st); final RemoteExceptionCause[] suppressed = s; if (suppressed != null) for (RemoteExceptionCause c : suppressed) { ex.addSuppressed(c); } return ex; } }
private static RemoteExceptionCause of(Throwable t, IdentityHashMap<Throwable, RemoteExceptionCause> seen) { if (t == null) return null; if (t instanceof RemoteExceptionCause) { return (RemoteExceptionCause) t; } else { final RemoteExceptionCause existing = seen.get(t); if (existing != null) { return existing; } final RemoteExceptionCause e = new RemoteExceptionCause(t.getMessage(), t.getClass().getName(), fieldGetterValue.get(t.getClass()).apply(t)); e.setStackTrace(t.getStackTrace()); seen.put(t, e); final Throwable cause = t.getCause(); if (cause != null) e.initCause(of(cause, seen)); for (Throwable throwable : t.getSuppressed()) { e.addSuppressed(of(throwable, seen)); } return e; } }
result.addSuppressed(readObject(input, RemoteExceptionCause.class, cache, false));
Object readResolve() { final Map<String, String> fields; if (f == null) { fields = Collections.emptyMap(); } else { final int fl = f.length; if ((fl & 1) != 0) { throw CommonMessages.msg.invalidOddFields(); } else if (fl == 0) { fields = Collections.emptyMap(); } else if (fl == 2) { fields = Collections.singletonMap(f[0], f[1]); } else { final TreeMap<String, String> map = new TreeMap<>(); for (int i = 0; i < fl; i += 2) { map.put(f[i], f[i + 1]); } fields = Collections.unmodifiableMap(map); } } final RemoteExceptionCause ex = new RemoteExceptionCause(m, c, cn, fields, false); ex.setStackTrace(st); final RemoteExceptionCause[] suppressed = s; if (suppressed != null) for (RemoteExceptionCause c : suppressed) { ex.addSuppressed(c); } return ex; } }
Object readResolve() { final Map<String, String> fields; if (f == null) { fields = Collections.emptyMap(); } else { final int fl = f.length; if ((fl & 1) != 0) { throw CommonMessages.msg.invalidOddFields(); } else if (fl == 0) { fields = Collections.emptyMap(); } else if (fl == 2) { fields = Collections.singletonMap(f[0], f[1]); } else { final TreeMap<String, String> map = new TreeMap<>(); for (int i = 0; i < fl; i += 2) { map.put(f[i], f[i + 1]); } fields = Collections.unmodifiableMap(map); } } final RemoteExceptionCause ex = new RemoteExceptionCause(m, c, cn, fields, false); ex.setStackTrace(st); final RemoteExceptionCause[] suppressed = s; if (suppressed != null) for (RemoteExceptionCause c : suppressed) { ex.addSuppressed(c); } return ex; } }
private static RemoteExceptionCause of(Throwable t, IdentityHashMap<Throwable, RemoteExceptionCause> seen) { if (t == null) return null; if (t instanceof RemoteExceptionCause) { return (RemoteExceptionCause) t; } else { final RemoteExceptionCause existing = seen.get(t); if (existing != null) { return existing; } final RemoteExceptionCause e = new RemoteExceptionCause(t.getMessage(), t.getClass().getName(), fieldGetterValue.get(t.getClass()).apply(t)); e.setStackTrace(t.getStackTrace()); seen.put(t, e); final Throwable cause = t.getCause(); if (cause != null) e.initCause(of(cause, seen)); for (Throwable throwable : t.getSuppressed()) { e.addSuppressed(of(throwable, seen)); } return e; } }
private static RemoteExceptionCause of(Throwable t, IdentityHashMap<Throwable, RemoteExceptionCause> seen) { if (t == null) return null; if (t instanceof RemoteExceptionCause) { return (RemoteExceptionCause) t; } else { final RemoteExceptionCause existing = seen.get(t); if (existing != null) { return existing; } final RemoteExceptionCause e = new RemoteExceptionCause(t.getMessage(), t.getClass().getName(), fieldGetterValue.get(t.getClass()).apply(t)); e.setStackTrace(t.getStackTrace()); seen.put(t, e); final Throwable cause = t.getCause(); if (cause != null) e.initCause(of(cause, seen)); for (Throwable throwable : t.getSuppressed()) { e.addSuppressed(of(throwable, seen)); } return e; } }
result.addSuppressed(readObject(input, RemoteExceptionCause.class, cache, false));
result.addSuppressed(readObject(input, RemoteExceptionCause.class, cache, false));