8150953: j.l.i.MethodHandles: example section in whileLoop(...) provides example for doWhileLoop
Reviewed-by: psandoz
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java Wed Mar 02 14:10:40 2016 +0300
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java Wed Mar 02 14:15:15 2016 +0100
@@ -3528,7 +3528,7 @@
* return zip;
* }
* // assume MH_initZip, MH_zipPred, and MH_zipStep are handles to the above methods
- * MethodHandle loop = MethodHandles.doWhileLoop(MH_initZip, MH_zipStep, MH_zipPred);
+ * MethodHandle loop = MethodHandles.whileLoop(MH_initZip, MH_zipPred, MH_zipStep);
* List<String> a = Arrays.asList("a", "b", "c", "d");
* List<String> b = Arrays.asList("e", "f", "g", "h");
* List<String> zipped = Arrays.asList("a", "e", "b", "f", "c", "g", "d", "h");
--- a/jdk/test/java/lang/invoke/JavaDocExamplesTest.java Wed Mar 02 14:10:40 2016 +0300
+++ b/jdk/test/java/lang/invoke/JavaDocExamplesTest.java Wed Mar 02 14:15:15 2016 +0100
@@ -690,7 +690,7 @@
{{
{} /// JAVADOC
// implement the zip function for lists as a loop handle
-MethodHandle loop = MethodHandles.doWhileLoop(MH_initZip, MH_zipStep, MH_zipPred);
+MethodHandle loop = MethodHandles.whileLoop(MH_initZip, MH_zipPred, MH_zipStep);
List<String> a = Arrays.asList("a", "b", "c", "d");
List<String> b = Arrays.asList("e", "f", "g", "h");
List<String> zipped = Arrays.asList("a", "e", "b", "f", "c", "g", "d", "h");