http-client-branch: fix doc examples for BodyHandler::fromLineSubscriber (tahe II) http-client-branch
authordfuchs
Tue, 13 Feb 2018 14:42:41 +0000
branchhttp-client-branch
changeset 56120 5db317238575
parent 56119 33436f5e3b9d
child 56121 dca5d4a9f4e3
http-client-branch: fix doc examples for BodyHandler::fromLineSubscriber (tahe II)
src/java.net.http/share/classes/java/net/http/HttpResponse.java
test/jdk/java/net/httpclient/examples/JavadocExamples.java
--- a/src/java.net.http/share/classes/java/net/http/HttpResponse.java	Tue Feb 13 14:34:00 2018 +0000
+++ b/src/java.net.http/share/classes/java/net/http/HttpResponse.java	Tue Feb 13 14:42:41 2018 +0000
@@ -373,8 +373,8 @@
          *  // and accumulates lines that match a particular pattern
          *  Pattern pattern = ...;
          *  LineParserSubscriber subscriber = new LineParserSubscriber(pattern);
-         *  HttpResponse<List<String>> response = client.sendAsync(request,
-         *      BodyHandler.fromLineSubscriber(subscriber, (s) -> s.getMatchingLines(), "\n")).join();
+         *  HttpResponse<List<String>> response = client.send(request,
+         *      BodyHandler.fromLineSubscriber(subscriber, s -> s.getMatchingLines(), "\n"));
          *  if (response.statusCode() != 200) {
          *      System.err.printf("ERROR: %d status received%n", response.statusCode());
          *  } }</pre>
--- a/test/jdk/java/net/httpclient/examples/JavadocExamples.java	Tue Feb 13 14:34:00 2018 +0000
+++ b/test/jdk/java/net/httpclient/examples/JavadocExamples.java	Tue Feb 13 14:42:41 2018 +0000
@@ -86,7 +86,7 @@
      *  Pattern pattern = ...;
      *  LineParserSubscriber subscriber = new LineParserSubscriber(pattern);
      *  HttpResponse<List<String>> response = client.send(request,
-     *  BodyHandler.fromLineSubscriber(subscriber, s -> s.getMatchingLines(), "\n"));
+     *      BodyHandler.fromLineSubscriber(subscriber, s -> s.getMatchingLines(), "\n"));
      *  if (response.statusCode() != 200) {
      *      System.err.printf("ERROR: %d status received%n", response.statusCode());
      *  } }</pre>