changeset 6409:5cdf42e26646

change Stream.mapToInt to Stream.map
author psandoz
date Thu, 15 Nov 2012 17:35:31 +0100
parents 4cae7924b7ef
children e80b94da6538
files src/share/classes/java/util/streams/ReferencePipeline.java src/share/classes/java/util/streams/Stream.java test-ng/tests/org/openjdk/tests/java/util/streams/ops/InfiniteStreamWithLimitOpTest.java test-ng/tests/org/openjdk/tests/java/util/streams/ops/MapOpTest.java test-ng/tests/org/openjdk/tests/java/util/streams/ops/PrimitiveOpsTests.java
diffstat 5 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/streams/ReferencePipeline.java	Thu Nov 15 16:34:18 2012 +0100
+++ b/src/share/classes/java/util/streams/ReferencePipeline.java	Thu Nov 15 17:35:31 2012 +0100
@@ -62,7 +62,7 @@
     }
 
     @Override
-    public IntStream mapToInt(IntMapper<? super U> mapper) {
+    public IntStream map(IntMapper<? super U> mapper) {
         return pipeline(new RefToIntMapOp<U>(mapper));
     }
 
--- a/src/share/classes/java/util/streams/Stream.java	Thu Nov 15 16:34:18 2012 +0100
+++ b/src/share/classes/java/util/streams/Stream.java	Thu Nov 15 17:35:31 2012 +0100
@@ -44,7 +44,7 @@
 
     <R> Stream<R> map(Mapper<? extends R, ? super T> mapper);
 
-    IntStream mapToInt(IntMapper<? super T> mapper);
+    IntStream map(IntMapper<? super T> mapper);
 
     <R> Stream<R> flatMap(FlatMapper<? extends R, ? super T> mapper);
 
--- a/test-ng/tests/org/openjdk/tests/java/util/streams/ops/InfiniteStreamWithLimitOpTest.java	Thu Nov 15 16:34:18 2012 +0100
+++ b/test-ng/tests/org/openjdk/tests/java/util/streams/ops/InfiniteStreamWithLimitOpTest.java	Thu Nov 15 17:35:31 2012 +0100
@@ -60,7 +60,7 @@
     public void testIterateFibLimit() {
         Stream<Integer> fib = Streams.
                 iterate(new int[]{0, 1}, pair -> new int[]{pair[1], pair[0] + pair[1]}).
-                map(pair -> pair[0]);
+                map(pair -> (Integer) pair[0]);
 
         assertContents(
                 fib.limit(10).iterator(),
--- a/test-ng/tests/org/openjdk/tests/java/util/streams/ops/MapOpTest.java	Thu Nov 15 16:34:18 2012 +0100
+++ b/test-ng/tests/org/openjdk/tests/java/util/streams/ops/MapOpTest.java	Thu Nov 15 17:35:31 2012 +0100
@@ -63,7 +63,7 @@
 
         assertStreamContents(countTo(0), s -> s.map(e -> e), countTo(0));
         assertStreamContents(countTo(1000), s -> s.map(e -> e), countTo(1000));
-        assertStreamContents(countTo(1000), s -> s.map(e -> 1000+e), range(1001, 2000));
+        assertStreamContents(countTo(1000), s -> s.map(e -> (Integer) (1000+e)), range(1001, 2000));
     }
 
     @Test(dataProvider = "opArrays", dataProviderClass = StreamTestDataProvider.class)
--- a/test-ng/tests/org/openjdk/tests/java/util/streams/ops/PrimitiveOpsTests.java	Thu Nov 15 16:34:18 2012 +0100
+++ b/test-ng/tests/org/openjdk/tests/java/util/streams/ops/PrimitiveOpsTests.java	Thu Nov 15 17:35:31 2012 +0100
@@ -86,7 +86,7 @@
     }
 
     public void testUnBox() {
-       int sum = Arrays.asList(1, 2, 3, 4, 5).stream().mapToInt(i -> i).sum();
+       int sum = Arrays.asList(1, 2, 3, 4, 5).stream().map(i -> (int) i).sum();
         Assert.assertEquals(sum, 15);
     }