Skip to content

Commit

Permalink
Merge pull request #143 from lrytz/2.13.x-rc2
Browse files Browse the repository at this point in the history
adapt to changes for 2.13.0-RC2
  • Loading branch information
lrytz authored May 20, 2019
2 parents 23bb43e + 164a5f4 commit 4b88c2b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jdk:
- openjdk11

scala:
- 2.13.0-RC1
- 2.13.0-RC2

env:
global:
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ScalaModulePlugin._

crossScalaVersions in ThisBuild := List("2.13.0-RC1")
crossScalaVersions in ThisBuild := List("2.13.0-RC2")

val disableDocs =
sys.props("nodocs") == "true" ||
Expand Down
26 changes: 13 additions & 13 deletions src/main/java/scala/compat/java8/ScalaStreamSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.util.stream.*;

import scala.collection.*;
import scala.jdk.StreamConverters;
import scala.jdk.javaapi.StreamConverters;

/**
* This class contains static utility methods for creating Java Streams from Scala Collections, similar
Expand Down Expand Up @@ -142,7 +142,7 @@ public static <V> Stream<V> streamAccumulatedValues(Map<?, V> coll) {
* @return A DoubleStream view of the collection which, by default, executes sequentially.
*/
public static DoubleStream doubleStream(IterableOnce<Double> coll) {
return StreamConverters.asJavaSeqDoubleStream((IterableOnce<Object>)(Object)coll);
return StreamConverters.asJavaSeqDoubleStream(coll);
}

/**
Expand Down Expand Up @@ -183,7 +183,7 @@ public static DoubleStream doubleStreamValues(Map<?, Double> coll) {
* @return A DoubleStream view of the collection which, by default, executes sequentially.
*/
public static DoubleStream doubleStreamAccumulated(IterableOnce<Double> coll) {
return StreamConverters.asJavaSeqDoubleStream(scala.jdk.DoubleAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll));
return StreamConverters.asJavaSeqDoubleStream((IterableOnce<Double>)(Object)scala.jdk.DoubleAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll));
}

/**
Expand All @@ -196,7 +196,7 @@ public static DoubleStream doubleStreamAccumulated(IterableOnce<Double> coll) {
* @return A DoubleStream view of the collection which, by default, executes sequentially.
*/
public static DoubleStream doubleStreamAccumulatedKeys(Map<Double, ?> coll) {
return StreamConverters.asJavaSeqDoubleStream(scala.jdk.DoubleAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll.keysIterator()));
return StreamConverters.asJavaSeqDoubleStream((IterableOnce<Double>)(Object)scala.jdk.DoubleAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll.keysIterator()));
}

/**
Expand All @@ -209,7 +209,7 @@ public static DoubleStream doubleStreamAccumulatedKeys(Map<Double, ?> coll) {
* @return A DoubleStream view of the collection which, by default, executes sequentially.
*/
public static DoubleStream doubleStreamAccumulatedValues(Map<?, Double> coll) {
return StreamConverters.asJavaSeqDoubleStream(scala.jdk.DoubleAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll.valuesIterator()));
return StreamConverters.asJavaSeqDoubleStream((IterableOnce<Double>)(Object)scala.jdk.DoubleAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll.valuesIterator()));
}

/////////////////
Expand All @@ -227,7 +227,7 @@ public static DoubleStream doubleStreamAccumulatedValues(Map<?, Double> coll) {
* @return A IntStream view of the collection which, by default, executes sequentially.
*/
public static IntStream intStream(IterableOnce<Integer> coll) {
return StreamConverters.asJavaSeqIntStream((IterableOnce<Object>)(Object)coll);
return StreamConverters.asJavaSeqIntStream(coll);
}

/**
Expand Down Expand Up @@ -268,7 +268,7 @@ public static IntStream intStreamValues(Map<?, Integer> coll) {
* @return A IntStream view of the collection which, by default, executes sequentially.
*/
public static IntStream intStreamAccumulated(IterableOnce<Integer> coll) {
return StreamConverters.asJavaSeqIntStream(scala.jdk.IntAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll));
return StreamConverters.asJavaSeqIntStream((IterableOnce<Integer>)(Object)scala.jdk.IntAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll));
}

/**
Expand All @@ -281,7 +281,7 @@ public static IntStream intStreamAccumulated(IterableOnce<Integer> coll) {
* @return A IntStream view of the collection which, by default, executes sequentially.
*/
public static IntStream intStreamAccumulatedKeys(Map<Integer, ?> coll) {
return StreamConverters.asJavaSeqIntStream(scala.jdk.IntAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll.keysIterator()));
return StreamConverters.asJavaSeqIntStream((IterableOnce<Integer>)(Object)scala.jdk.IntAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll.keysIterator()));
}

/**
Expand All @@ -294,7 +294,7 @@ public static IntStream intStreamAccumulatedKeys(Map<Integer, ?> coll) {
* @return A IntStream view of the collection which, by default, executes sequentially.
*/
public static IntStream intStreamAccumulatedValues(Map<?, Integer> coll) {
return StreamConverters.asJavaSeqIntStream(scala.jdk.IntAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll.valuesIterator()));
return StreamConverters.asJavaSeqIntStream((IterableOnce<Integer>)(Object)scala.jdk.IntAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll.valuesIterator()));
}

//////////////////
Expand All @@ -312,7 +312,7 @@ public static IntStream intStreamAccumulatedValues(Map<?, Integer> coll) {
* @return A LongStream view of the collection which, by default, executes sequentially.
*/
public static LongStream longStream(IterableOnce<Long> coll) {
return StreamConverters.asJavaSeqLongStream((IterableOnce<Object>)(Object)coll);
return StreamConverters.asJavaSeqLongStream(coll);
}

/**
Expand Down Expand Up @@ -353,7 +353,7 @@ public static LongStream longStreamValues(Map<?, Long> coll) {
* @return A LongStream view of the collection which, by default, executes sequentially.
*/
public static LongStream longStreamAccumulated(IterableOnce<Long> coll) {
return StreamConverters.asJavaSeqLongStream(scala.jdk.LongAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll));
return StreamConverters.asJavaSeqLongStream((IterableOnce<Long>)(Object)scala.jdk.LongAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll));
}

/**
Expand All @@ -366,7 +366,7 @@ public static LongStream longStreamAccumulated(IterableOnce<Long> coll) {
* @return A LongStream view of the collection which, by default, executes sequentially.
*/
public static LongStream longStreamAccumulatedKeys(Map<Long, ?> coll) {
return StreamConverters.asJavaSeqLongStream(scala.jdk.LongAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll.keysIterator()));
return StreamConverters.asJavaSeqLongStream((IterableOnce<Long>)(Object)scala.jdk.LongAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll.keysIterator()));
}

/**
Expand All @@ -379,6 +379,6 @@ public static LongStream longStreamAccumulatedKeys(Map<Long, ?> coll) {
* @return A LongStream view of the collection which, by default, executes sequentially.
*/
public static LongStream longStreamAccumulatedValues(Map<?, Long> coll) {
return StreamConverters.asJavaSeqLongStream(scala.jdk.LongAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll.valuesIterator()));
return StreamConverters.asJavaSeqLongStream((IterableOnce<Long>)(Object)scala.jdk.LongAccumulator$.MODULE$.fromSpecific((IterableOnce<Object>)(Object)coll.valuesIterator()));
}
}
4 changes: 2 additions & 2 deletions src/main/scala/scala/compat/java8/StreamConverters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import scala.collection.{IterableOnce, Stepper, StepperShape}
import scala.compat.java8.converterImpl._
import scala.jdk._
import scala.language.higherKinds
import scala.jdk.CollectionConverters.Ops._
import scala.jdk.CollectionConverters._


/** Defines extension methods to create Java Streams for Scala collections, available through
* [[scala.jdk.StreamConverters.Ops]].
* [[scala.compat.java8.StreamConverters]].
*/
trait StreamExtensions {
implicit def richStepper[A](s: Stepper[A]): StepperExtensions[A] = new StepperExtensions[A](s)
Expand Down
4 changes: 2 additions & 2 deletions src/test/scala/scala/compat/java8/StepperTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class MappingStepper[@specialized (Double, Int, Long) A, @specialized(Double, In

override def estimateSize: Long = underlying.estimateSize

override def javaIterator: util.Iterator[_] = new util.Iterator[B] {
override def javaIterator[C >: B]: util.Iterator[_] = new util.Iterator[B] {
override def hasNext: Boolean = underlying.hasStep
override def next(): B = mapping(underlying.nextStep())
}
Expand All @@ -74,7 +74,7 @@ class MappingStepper[@specialized (Double, Int, Long) A, @specialized(Double, In
if (undersub == null) null
else new MappingStepper(undersub, mapping)
}
def spliterator: Spliterator[_] = new MappingSpliterator[A, B](underlying.spliterator.asInstanceOf[Spliterator[A]], mapping)
def spliterator[C >: B]: Spliterator[_] = new MappingSpliterator[A, B](underlying.spliterator.asInstanceOf[Spliterator[A]], mapping)
}

class MappingSpliterator[A, B](private val underlying: Spliterator[A], mapping: A => B) extends Spliterator[B] {
Expand Down

0 comments on commit 4b88c2b

Please sign in to comment.