changeset 13805:3016faa53222

8151140: Replace use of lambda/method ref in jdk.Version constructor Reviewed-by: psandoz
author chegar
date Thu, 03 Mar 2016 12:07:45 +0000
parents 9a83d6009bd3
children e941d983c8e4
files src/java.base/share/classes/jdk/Version.java
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/jdk/Version.java	Thu Mar 03 12:07:13 2016 +0000
+++ b/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));