Closed
Description
The following example throws a NPE
public class Test {
public static class CustomException extends Throwable {
public synchronized Throwable initCause(Throwable cause) {
throw new UnsupportedOperationException();
}
}
public static void main(String ... args) {
new CompositeException(Arrays.asList(
new CustomException(),
new UnsupportedOperationException(),
new IllegalStateException())).getCause();
}
}
The stacktrace is the following:
Exception in thread "main" java.lang.NullPointerException
at rx.exceptions.CompositeException.getCause(CompositeException.java:126)
at Test.main(Test.java:18)