http-client-branch: review comment - PublishingBodySubscriber should throw ISE when already subscribed
--- a/test/jdk/java/net/httpclient/ResponsePublisher.java Tue Apr 03 12:15:02 2018 +0100
+++ b/test/jdk/java/net/httpclient/ResponsePublisher.java Tue Apr 03 15:26:04 2018 +0100
@@ -153,11 +153,11 @@
response.body().subscribe(ofString2);
try {
ofString2.getBody().toCompletableFuture().join();
- throw new RuntimeException("Expected IOE not thrown");
+ throw new RuntimeException("Expected ISE not thrown");
} catch (CompletionException x) {
Throwable cause = x.getCause();
- if (cause instanceof IOException) {
- System.out.println("Got expected IOE: " + cause);
+ if (cause instanceof IllegalStateException) {
+ System.out.println("Got expected ISE: " + cause);
} else {
throw x;
}
@@ -296,7 +296,8 @@
@Override public void request(long n) { }
@Override public void cancel() { }
});
- subscriber.onError(new IOException("This publisher has already one subscriber"));
+ subscriber.onError(
+ new IllegalStateException("This publisher has already one subscriber"));
}
}