8151140: Replace use of lambda/method ref in jdk.Version constructor
authorchegar
Thu, 03 Mar 2016 12:07:45 +0000
changeset 36226 37fb5281509b
parent 36225 6ae0eebc46e9
child 36227 0149fa1848eb
8151140: Replace use of lambda/method ref in jdk.Version constructor Reviewed-by: psandoz
jdk/src/java.base/share/classes/jdk/Version.java
--- a/jdk/src/java.base/share/classes/jdk/Version.java	Thu Mar 03 12:07:13 2016 +0000
+++ b/jdk/src/java.base/share/classes/jdk/Version.java	Thu Mar 03 12:07:45 2016 +0000
@@ -28,10 +28,10 @@
 import java.math.BigInteger;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.util.ArrayList;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
@@ -208,11 +208,10 @@
                                                + s + "'");
 
         // $VNUM is a dot-separated list of integers of arbitrary length
-        version
-            = Collections.unmodifiableList(
-                  Arrays.stream(m.group(VNUM_GROUP).split("\\."))
-                  .map(Integer::parseInt)
-                  .collect(Collectors.toList()));
+        List<Integer> list = new ArrayList<>();
+        for (String i : m.group(VNUM_GROUP).split("\\."))
+            list.add(Integer.parseInt(i));
+        version = Collections.unmodifiableList(list);
 
         pre = Optional.ofNullable(m.group(PRE_GROUP));