X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=lib%2Fjetty%2Forg%2Feclipse%2Fjetty%2Futil%2FMultiException.java;h=7653ca6636385b769c4721f66f475c713aa78390;hp=2e71f3c58ccc26ff9b0d671799806e980455ed41;hb=d23d7a6fa9dc38c6193fea70017e0bff11257be5;hpb=73ef54a38e3930a1a789cdc6b5fa23cdd4c9d086 diff --git a/lib/jetty/org/eclipse/jetty/util/MultiException.java b/lib/jetty/org/eclipse/jetty/util/MultiException.java index 2e71f3c5..7653ca66 100644 --- a/lib/jetty/org/eclipse/jetty/util/MultiException.java +++ b/lib/jetty/org/eclipse/jetty/util/MultiException.java @@ -1,6 +1,6 @@ // // ======================================================================== -// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd. +// Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd. // ------------------------------------------------------------------------ // All rights reserved. This program and the accompanying materials // are made available under the terms of the Eclipse Public License v1.0 @@ -18,8 +18,6 @@ package org.eclipse.jetty.util; -import java.io.PrintStream; -import java.io.PrintWriter; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -43,10 +41,16 @@ public class MultiException extends Exception /* ------------------------------------------------------------ */ public void add(Throwable e) { + if (e==null) + throw new IllegalArgumentException(); + if(nested == null) { + initCause(e); nested = new ArrayList<>(); } + else + addSuppressed(e); if (e instanceof MultiException) { @@ -66,9 +70,8 @@ public class MultiException extends Exception /* ------------------------------------------------------------ */ public List getThrowables() { - if(nested == null) { + if(nested == null) return Collections.emptyList(); - } return nested; } @@ -168,47 +171,4 @@ public class MultiException extends Exception return str.toString(); } - /* ------------------------------------------------------------ */ - @Override - public void printStackTrace() - { - super.printStackTrace(); - if(nested != null) { - for(Throwable t: nested) { - t.printStackTrace(); - } - } - } - - - /* ------------------------------------------------------------------------------- */ - /** - * @see java.lang.Throwable#printStackTrace(java.io.PrintStream) - */ - @Override - public void printStackTrace(PrintStream out) - { - super.printStackTrace(out); - if(nested != null) { - for(Throwable t: nested) { - t.printStackTrace(out); - } - } - } - - /* ------------------------------------------------------------------------------- */ - /** - * @see java.lang.Throwable#printStackTrace(java.io.PrintWriter) - */ - @Override - public void printStackTrace(PrintWriter out) - { - super.printStackTrace(out); - if(nested != null) { - for(Throwable t: nested) { - t.printStackTrace(out); - } - } - } - }