http-client-branch: review comments on WS spec http-client-branch
authorchegar
Tue, 21 Nov 2017 20:38:12 +0000
branchhttp-client-branch
changeset 55849 ad404eb1c8c1
parent 55848 5c13ff6e444b
child 55850 1e2fa7c503c1
http-client-branch: review comments on WS spec
src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/WebSocket.java
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/WebSocket.java	Tue Nov 21 16:39:20 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/WebSocket.java	Tue Nov 21 20:38:12 2017 +0000
@@ -37,22 +37,22 @@
  * {@Incubating}
  *
  * <p> To create a {@code WebSocket} use the {@link HttpClient#newWebSocketBuilder}
- * method. To close a {@code WebSocket} use {@code sendClose} or {@code abort}
- * methods.
+ * method. To close a {@code WebSocket} use one of the {@code sendClose} or
+ * {@code abort} methods.
  *
  * <p> WebSocket messages are sent through a {@code WebSocket} and received
- * through this {@code WebSocket}'s {@code Listener}. Messages can be sent until
- * the output is closed and received until the input is closed.
+ * through the {@code WebSocket}'s {@code Listener}. Messages can be sent until
+ * the output is closed, and received until the input is closed.
  * A {@code WebSocket} whose output and input are both closed may be considered
- * closed. To check these states use {@link #isOutputClosed()} and
+ * itself closed. To check these states use {@link #isOutputClosed()} and
  * {@link #isInputClosed()}.
  *
- * <p> Methods that send messages return {@code CompletableFuture} which will
- * complete normally if the message is sent or will complete exceptionally if an
+ * <p> Methods that send messages return {@code CompletableFuture} which
+ * completes normally if the message is sent or completes exceptionally if an
  * error occurs.
  *
- * <p> To receive a message, request it first. If {@code n} messages are
- * requested, the listener will receive up to {@code n} more invocations of
+ * <p> To receive a message, first request it. If {@code n} messages are
+ * requested, the listener will receive up to {@code n} more invocations of the
  * designated methods from the {@code WebSocket}. To request messages use
  * {@link #request(long)}. Request is an additive operation, that is
  * {@code request(n)} followed by {@code request(m)} is equivalent to
@@ -69,9 +69,9 @@
  *
  * @implSpec Methods of {@code WebSocket} are failure-atomic in respect to
  * {@code NullPointerException}, {@code IllegalArgumentException} and
- * {@code IllegalStateException}. That is, if a method throws said exception or
- * a {@code CompletableFuture} returned from a method completes exceptionally
- * with it, the {@code WebSocket} will behave as if the method has not been
+ * {@code IllegalStateException}. That is, if a method throws said exception, or
+ * a returned {@code CompletableFuture} completes exceptionally with said
+ * exception, the {@code WebSocket} will behave as if the method has not been
  * invoked at all.
  *
  * <p> A {@code WebSocket} invokes methods of its listener in a thread-safe