http-client-branch: review comment: remove duplicate message type from synchronous send
--- a/src/java.net.http/share/classes/jdk/internal/net/http/HttpClientImpl.java Tue Jun 12 15:21:11 2018 +0100
+++ b/src/java.net.http/share/classes/jdk/internal/net/http/HttpClientImpl.java Tue Jun 12 16:07:19 2018 +0100
@@ -528,20 +528,19 @@
cf.cancel(true);
throw ie;
} catch (ExecutionException e) {
- Throwable throwable = e.getCause();
+ final Throwable throwable = e.getCause();
+ final String msg = throwable.getMessage();
if (throwable instanceof IllegalArgumentException)
- throw new IllegalArgumentException(throwable);
+ throw new IllegalArgumentException(msg, throwable);
else if (throwable instanceof SecurityException)
- throw new SecurityException(throwable);
+ throw new SecurityException(msg, throwable);
else if (throwable instanceof HttpTimeoutException)
- throw new HttpTimeoutException(throwable.getMessage());
+ throw new HttpTimeoutException(msg);
else if (throwable instanceof IOException)
- throw new IOException(throwable);
- //else if (throwable instanceof UncheckedIOException)
- // throw new UncheckedIOException(((UncheckedIOException)throwable).getCause());
+ throw new IOException(msg, throwable);
else
- throw new IOException(throwable);
+ throw new IOException(msg, throwable);
}
}