Re: Throwable support for cloning: was Re: RFR: jsr166 jdk9 integration wave 2

2015-11-23 Thread Peter Levart
Even more backwards-compatible. It keeps current behavior for Throwable.clone() method if subclasses use it. Just one static method and implemented interface need to be added: public class Throwable implements Serializable, Cloneable { /** * Clones given {@code exception} and returns

Throwable support for cloning: was Re: RFR: jsr166 jdk9 integration wave 2

2015-11-23 Thread Peter Levart
Hi, Until Throwable.addSuppressed() was added in JDK7 to support try-with-resources statement, Throwable has been a more-or-less immutable from the outside (except for initCause which is a one-of method meant to be called right after construction and before throwing and can't be called multip