Skip to content

Commit 72fb53d

Browse files
committed
Fixed up tests after disallowing implicit Accumulator creation.
1 parent ace87d4 commit 72fb53d

File tree

3 files changed

+160
-151
lines changed

3 files changed

+160
-151
lines changed

src/main/scala/scala/compat/java8/collectionImpl/Stepper.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ trait StepperLike[@specialized(Double, Int, Long) A, +CC] { self =>
161161
}
162162
}
163163

164+
164165
/** This trait indicates that a `Stepper` will implement `tryStep` in terms of `hasNext` and `nextStep`. */
165166
trait NextStepper[@specialized(Double, Int, Long) A] extends Stepper[A] with StepperLike[A, NextStepper[A]] {
166167
def tryStep(f: A => Unit) = if (hasStep) { f(nextStep()); true } else false
@@ -224,6 +225,8 @@ trait AnyStepper[A] extends Stepper[A] with java.util.Iterator[A] with Spliterat
224225
def trySplit() = substep.typedPrecisely
225226
final def typedPrecisely: AnyStepper[A] = this
226227
override def spliterator: Spliterator[A] = this
228+
def seqStream: java.util.stream.Stream[A] = java.util.stream.StreamSupport.stream(this, false)
229+
def parStream: java.util.stream.Stream[A] = java.util.stream.StreamSupport.stream(this, true)
227230
}
228231

229232
/** A `DoubleStepper` combines the functionality of a Java `PrimitiveIterator`, a Java `Spliterator`, and a `Stepper`, all specialized for `Double` values. */
@@ -239,6 +242,8 @@ trait DoubleStepper extends Stepper[Double] with java.util.PrimitiveIterator.OfD
239242
def trySplit() = substep.typedPrecisely
240243
final def typedPrecisely: DoubleStepper = this
241244
override def spliterator: Spliterator[Double] = this.asInstanceOf[Spliterator[Double]] // Scala and Java disagree about whether it's java.lang.Double or double
245+
def seqStream: java.util.stream.DoubleStream = java.util.stream.StreamSupport.doubleStream(this, false)
246+
def parStream: java.util.stream.DoubleStream = java.util.stream.StreamSupport.doubleStream(this, true)
242247
}
243248

244249
/** An `IntStepper` combines the functionality of a Java `PrimitiveIterator`, a Java `Spliterator`, and a `Stepper`, all specialized for `Int` values. */
@@ -254,6 +259,8 @@ trait IntStepper extends Stepper[Int] with java.util.PrimitiveIterator.OfInt wit
254259
def trySplit() = substep.typedPrecisely
255260
final def typedPrecisely = this
256261
override def spliterator: Spliterator[Int] = this.asInstanceOf[Spliterator[Int]] // Scala and Java disagree about whether it's java.lang.Integer or int
262+
def seqStream: java.util.stream.IntStream = java.util.stream.StreamSupport.intStream(this, false)
263+
def parStream: java.util.stream.IntStream = java.util.stream.StreamSupport.intStream(this, true)
257264
}
258265

259266
/** A `LongStepper` combines the functionality of a Java `PrimitiveIterator`, a Java `Spliterator`, and a `Stepper`, all specialized for `Long` values. */
@@ -269,6 +276,8 @@ trait LongStepper extends Stepper[Long] with java.util.PrimitiveIterator.OfLong
269276
def trySplit() = substep.typedPrecisely
270277
final def typedPrecisely = this
271278
override def spliterator: Spliterator[Long] = this.asInstanceOf[Spliterator[Long]] // Scala and Java disagree about whether it's java.lang.Long or long
279+
def seqStream: java.util.stream.LongStream = java.util.stream.StreamSupport.longStream(this, false)
280+
def parStream: java.util.stream.LongStream = java.util.stream.StreamSupport.longStream(this, true)
272281
}
273282

274283

0 commit comments

Comments
 (0)