--- a/test/jdk/java/net/httpclient/HandshakeFailureTest.java Mon Jun 11 15:48:55 2018 +0100
+++ b/test/jdk/java/net/httpclient/HandshakeFailureTest.java Tue Jun 12 10:38:31 2018 +0100
@@ -166,14 +166,15 @@
}
static void checkExceptionOrCause(Class<? extends Throwable> clazz, Throwable t) {
+ final Throwable original = t;
do {
if (clazz.isInstance(t)) {
System.out.println("Found expected exception/cause: " + t);
return; // found
}
} while ((t = t.getCause()) != null);
- t.printStackTrace(System.out);
- throw new RuntimeException("Expected " + clazz + "in " + t);
+ original.printStackTrace(System.out);
+ throw new RuntimeException("Expected " + clazz + "in " + original);
}
/** Common supertype for PlainServer and SSLServer. */
--- a/test/jdk/java/net/httpclient/InvalidSSLContextTest.java Mon Jun 11 15:48:55 2018 +0100
+++ b/test/jdk/java/net/httpclient/InvalidSSLContextTest.java Tue Jun 12 10:38:31 2018 +0100
@@ -134,13 +134,14 @@
if (t == null) {
Assert.fail("Expected " + clazz + ", caught nothing");
}
+ final Throwable original = t;
do {
if (clazz.isInstance(t)) {
return; // found
}
} while ((t = t.getCause()) != null);
- t.printStackTrace(System.out);
- Assert.fail("Expected " + clazz + "in " + t);
+ original.printStackTrace(System.out);
+ Assert.fail("Expected " + clazz + "in " + original);
}
@BeforeTest
--- a/test/jdk/java/net/httpclient/ssltest/CertificateTest.java Mon Jun 11 15:48:55 2018 +0100
+++ b/test/jdk/java/net/httpclient/ssltest/CertificateTest.java Tue Jun 12 10:38:31 2018 +0100
@@ -144,13 +144,14 @@
}
static void checkExceptionOrCause(Class<? extends Throwable> clazz, Throwable t) {
+ final Throwable original = t;
do {
if (clazz.isInstance(t)) {
System.out.println("Found expected exception/cause: " + t);
return; // found
}
} while ((t = t.getCause()) != null);
- t.printStackTrace(System.out);
- throw new RuntimeException("Expected " + clazz + "in " + t);
+ original.printStackTrace(System.out);
+ throw new RuntimeException("Expected " + clazz + "in " + original);
}
}