Skip to content

bump Scala version to 2.13.3 #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import: scala/scala-dev:travis/default.yml
language: scala

scala:
- 2.13.2
- 2.13.3

env:
- ADOPTOPENJDK=8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ trait GenericTraversableTemplate[+A, +CC[X] <: ParIterable[X]] extends HasNewBui
fail
}
val bb = genericBuilder[CC[B]]
for (b <- bs) bb += b.result
for (b <- bs) bb += b.result()
bb.result()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ trait ParIterable[+T]
object ParIterable extends ParFactory[ParIterable] {
implicit def canBuildFrom[T]: CanCombineFrom[ParIterable[_], T, ParIterable[T]] = new GenericCanCombineFrom[T]

def newBuilder[T]: Combiner[T, ParIterable[T]] = ParArrayCombiner[T]
def newBuilder[T]: Combiner[T, ParIterable[T]] = ParArrayCombiner[T]()

def newCombiner[T]: Combiner[T, ParIterable[T]] = ParArrayCombiner[T]
def newCombiner[T]: Combiner[T, ParIterable[T]] = ParArrayCombiner[T]()
}

Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ self =>
val it = splitter
var left = n
while (left > 0) {
cb += it.next
cb += it.next()
left -= 1
}
cb.resultWithTaskSupport
Expand All @@ -642,7 +642,7 @@ self =>
val it = splitter drop n
val cb = newCombiner
cb.sizeHint(size - n)
while (it.hasNext) cb += it.next
while (it.hasNext) cb += it.next()
cb.resultWithTaskSupport
}

Expand All @@ -658,7 +658,7 @@ self =>
var left = until - from
val it = splitter drop from
while (left > 0) {
cb += it.next
cb += it.next()
left -= 1
}
cb.resultWithTaskSupport
Expand Down Expand Up @@ -1291,7 +1291,7 @@ self =>
@volatile var result: Result = null
def leaf(prev: Option[Combiner[U, That]]): Unit = {
result = cbf()
while (pit.hasNext) result += pit.next
while (pit.hasNext) result += pit.next()
}
protected[this] def newSubtask(p: IterableSplitter[T]) = new ToParCollection[U, That](cbf, p)
override def merge(that: ToParCollection[U, That]) = result = result combine that.result
Expand All @@ -1302,7 +1302,7 @@ self =>
@volatile var result: Result = null
def leaf(prev: Option[Combiner[(K, V), That]]): Unit = {
result = cbf()
while (pit.hasNext) result += pit.next
while (pit.hasNext) result += pit.next()
}
protected[this] def newSubtask(p: IterableSplitter[T]) = new ToParMap[K, V, That](cbf, p)(ev)
override def merge(that: ToParMap[K, V, That]) = result = result combine that.result
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/scala/collection/parallel/ParSeq.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ trait ParSeq[+T] extends ParIterable[T]
object ParSeq extends ParFactory[ParSeq] {
implicit def canBuildFrom[T]: CanCombineFrom[ParSeq[_], T, ParSeq[T]] = new GenericCanCombineFrom[T]

def newBuilder[T]: Combiner[T, ParSeq[T]] = ParArrayCombiner[T]
def newCombiner[T]: Combiner[T, ParSeq[T]] = ParArrayCombiner[T]
def newBuilder[T]: Combiner[T, ParSeq[T]] = ParArrayCombiner[T]()
def newCombiner[T]: Combiner[T, ParSeq[T]] = ParArrayCombiner[T]()
}
22 changes: 11 additions & 11 deletions core/src/main/scala/scala/collection/parallel/RemainsIterator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private[collection] trait AugmentedIterableIterator[+T] extends RemainsIterator[

def copy2builder[U >: T, Coll, Bld <: Builder[U, Coll]](b: Bld): Bld = {
if (isRemainingCheap) b.sizeHint(remaining)
while (hasNext) b += next
while (hasNext) b += next()
b
}

Expand Down Expand Up @@ -159,7 +159,7 @@ private[collection] trait AugmentedIterableIterator[+T] extends RemainsIterator[
cb.sizeHint(n)
var left = n
while (left > 0) {
cb += next
cb += next()
left -= 1
}
cb
Expand All @@ -168,7 +168,7 @@ private[collection] trait AugmentedIterableIterator[+T] extends RemainsIterator[
def drop2combiner[U >: T, This](n: Int, cb: Combiner[U, This]): Combiner[U, This] = {
drop(n)
if (isRemainingCheap) cb.sizeHint(remaining)
while (hasNext) cb += next
while (hasNext) cb += next()
cb
}

Expand All @@ -177,7 +177,7 @@ private[collection] trait AugmentedIterableIterator[+T] extends RemainsIterator[
var left = scala.math.max(until - from, 0)
cb.sizeHint(left)
while (left > 0) {
cb += next
cb += next()
left -= 1
}
cb
Expand All @@ -188,10 +188,10 @@ private[collection] trait AugmentedIterableIterator[+T] extends RemainsIterator[
if (isRemainingCheap) after.sizeHint(remaining - at)
var left = at
while (left > 0) {
before += next
before += next()
left -= 1
}
while (hasNext) after += next
while (hasNext) after += next()
(before, after)
}

Expand All @@ -216,7 +216,7 @@ private[collection] trait AugmentedIterableIterator[+T] extends RemainsIterator[
isBefore = false
}
}
while (hasNext) after += next
while (hasNext) after += next()
(before, after)
}

Expand Down Expand Up @@ -320,7 +320,7 @@ private[collection] trait AugmentedSeqIterator[+T] extends AugmentedIterableIter
def reverse2combiner[U >: T, This](cb: Combiner[U, This]): Combiner[U, This] = {
if (isRemainingCheap) cb.sizeHint(remaining)
var lst = List[T]()
while (hasNext) lst ::= next
while (hasNext) lst ::= next()
while (lst != Nil) {
cb += lst.head
lst = lst.tail
Expand Down Expand Up @@ -348,7 +348,7 @@ private[collection] trait AugmentedSeqIterator[+T] extends AugmentedIterableIter
if (j == index) {
cb += elem
next()
} else cb += next
} else cb += next()
j += 1
}
cb
Expand Down Expand Up @@ -439,7 +439,7 @@ self =>
private[collection] def newSliceInternal[U <: Taken](it: U, from1: Int): U = {
var count = from1
while (count > 0 && it.hasNext) {
it.next
it.next()
count -= 1
}
it
Expand Down Expand Up @@ -656,7 +656,7 @@ self =>
(pits(0).appendParSeq[U, SeqSplitter[U]](patch)) appendParSeq pits(2)
}
def hasNext = trio.hasNext
def next() = trio.next
def next() = trio.next()
def remaining = trio.remaining
def dup = self.dup.patchParSeq(from, patch, replaced)
def split = trio.split
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,10 @@ extends scala.collection.parallel.BucketCombiner[(K, V), ParHashMap[K, V], (K, V
}
private def evaluateCombiners(trie: OldHashMap[K, Combiner[V, Repr]]): OldHashMap[K, Repr] = trie match {
case hm1: OldHashMap.OldHashMap1[_, _] =>
val evaledvalue = hm1.value.result
val evaledvalue = hm1.value.result()
new OldHashMap.OldHashMap1[K, Repr](hm1.key, hm1.hash, evaledvalue, null)
case hmc: OldHashMap.OldHashMapCollision1[_, _] =>
val evaledkvs = hmc.kvs map { p => (p._1, p._2.result) }
val evaledkvs = hmc.kvs map { p => (p._1, p._2.result()) }
new OldHashMap.OldHashMapCollision1[K, Repr](hmc.hash, evaledkvs)
case htm: OldHashMap.HashTrieMap[k, v] =>
var i = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ self =>

override def map2combiner[S, That](f: Int => S, cb: Combiner[S, That]): Combiner[S, That] = {
while (hasNext) {
cb += f(next)
cb += f(next())
}
cb
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ private[immutable] class LazyParVectorCombiner[T] extends Combiner[T, ParVector[
def result(): ParVector[T] = {
val rvb = new VectorBuilder[T]
for (vb <- vectors) {
rvb ++= vb.result
rvb ++= vb.result()
}
new ParVector(rvb.result)
new ParVector(rvb.result())
}

def combine[U <: T, NewTo >: ParVector[T]](other: Combiner[U, NewTo]) = if (other eq this) this else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ self =>
var same = true
val thatIt = that.iterator
while (i < until && thatIt.hasNext) {
if (arr(i) != thatIt.next) {
if (arr(i) != thatIt.next()) {
i = until
same = false
}
Expand Down Expand Up @@ -693,7 +693,7 @@ self =>
object ParArray extends ParFactory[ParArray] {
implicit def canBuildFrom[T]: CanCombineFrom[ParArray[_], T, ParArray[T]] = new GenericCanCombineFrom[T]
def newBuilder[T]: Combiner[T, ParArray[T]] = newCombiner
def newCombiner[T]: Combiner[T, ParArray[T]] = ParArrayCombiner[T]
def newCombiner[T]: Combiner[T, ParArray[T]] = ParArrayCombiner[T]()

/** Creates a new parallel array by wrapping the specified array.
*/
Expand All @@ -720,7 +720,7 @@ object ParArray extends ParFactory[ParArray] {
for (xs <- xss) {
cb ++= xs
}
cb.result
cb.result()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ trait ParIterable[T] extends scala.collection.parallel.ParIterable[T]
object ParIterable extends ParFactory[ParIterable] {
implicit def canBuildFrom[T]: CanCombineFrom[ParIterable[_], T, ParIterable[T]] = new GenericCanCombineFrom[T]

def newBuilder[T]: Combiner[T, ParIterable[T]] = ParArrayCombiner[T]
def newCombiner[T]: Combiner[T, ParIterable[T]] = ParArrayCombiner[T]
def newBuilder[T]: Combiner[T, ParIterable[T]] = ParArrayCombiner[T]()
def newCombiner[T]: Combiner[T, ParIterable[T]] = ParArrayCombiner[T]()
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ self =>
object ParSeq extends ParFactory[ParSeq] {
implicit def canBuildFrom[T]: CanCombineFrom[ParSeq[_], T, ParSeq[T]] = new GenericCanCombineFrom[T]

def newBuilder[T]: Combiner[T, ParSeq[T]] = ParArrayCombiner[T]
def newBuilder[T]: Combiner[T, ParSeq[T]] = ParArrayCombiner[T]()

def newCombiner[T]: Combiner[T, ParSeq[T]] = ParArrayCombiner[T]
def newCombiner[T]: Combiner[T, ParSeq[T]] = ParArrayCombiner[T]()
}
6 changes: 3 additions & 3 deletions junit/src/test/scala/scala/SerializationStabilityTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object SerializationStability extends App {
}

def amend(file: File)(f: String => String): Unit = {
file.writeAll(f(file.slurp))
file.writeAll(f(file.slurp()))
}
def quote(s: String) = List("\"", s, "\"").mkString

Expand All @@ -44,7 +44,7 @@ object SerializationStability extends App {
content =>
content.linesIterator.toList.zipWithIndex.map {
case (content, i) if i == line - 1 =>
val newContent = content.replaceAllLiterally(quote(prevResult), quote(result))
val newContent = content.replace(quote(prevResult), quote(result))
if (newContent != content)
println(s"- $content\n+ $newContent\n")
newContent
Expand Down Expand Up @@ -113,4 +113,4 @@ object SerializationStability extends App {
class SerializationStabilityTest {
@Test
def testAll: Unit = SerializationStability.main(new Array[String](0))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class IteratorSpec extends Spec {
val it = ct.iterator

it.hasNext shouldEqual (false)
evaluating { it.next() }.shouldProduce [NoSuchElementException]
evaluating { it.next() }.shouldProduce[NoSuchElementException]()
}

def nonEmptyIteratorCheck(sz: Int): Unit = {
Expand All @@ -36,11 +36,11 @@ class IteratorSpec extends Spec {
val tracker = mutable.Map[Wrap, Int]()
for (i <- 0 until sz) {
assert(it.hasNext == true)
tracker += it.next
tracker += it.next()
}

it.hasNext shouldEqual (false)
evaluating { it.next() }.shouldProduce [NoSuchElementException]
evaluating { it.next() }.shouldProduce[NoSuchElementException]()
tracker.size shouldEqual (sz)
tracker shouldEqual (ct)
}
Expand Down Expand Up @@ -101,11 +101,11 @@ class IteratorSpec extends Spec {
val tracker = mutable.Map[DumbHash, Int]()
for (i <- 0 until sz) {
assert(it.hasNext == true)
tracker += it.next
tracker += it.next()
}

it.hasNext shouldEqual (false)
evaluating { it.next() }.shouldProduce [NoSuchElementException]
evaluating { it.next() }.shouldProduce[NoSuchElementException]()
tracker.size shouldEqual (sz)
tracker shouldEqual (ct)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class IteratorSpec extends Spec {
val it = ct.iterator

it.hasNext shouldEqual (false)
evaluating { it.next() }.shouldProduce [NoSuchElementException]
evaluating { it.next() }.shouldProduce[NoSuchElementException]()
}

def nonEmptyIteratorCheck(sz: Int): Unit = {
Expand All @@ -37,11 +37,11 @@ class IteratorSpec extends Spec {
val tracker = mutable.Map[Wrap, Int]()
for (i <- 0 until sz) {
assert(it.hasNext == true)
tracker += it.next
tracker += it.next()
}

it.hasNext shouldEqual (false)
evaluating { it.next() }.shouldProduce [NoSuchElementException]
evaluating { it.next() }.shouldProduce[NoSuchElementException]()
tracker.size shouldEqual (sz)
tracker shouldEqual (ct)
}
Expand Down Expand Up @@ -102,11 +102,11 @@ class IteratorSpec extends Spec {
val tracker = mutable.Map[DumbHash, Int]()
for (i <- 0 until sz) {
assert(it.hasNext == true)
tracker += it.next
tracker += it.next()
}

it.hasNext shouldEqual (false)
evaluating { it.next() }.shouldProduce [NoSuchElementException]
evaluating { it.next() }.shouldProduce[NoSuchElementException]()
tracker.size shouldEqual (sz)
tracker shouldEqual (ct)
}
Expand Down
4 changes: 2 additions & 2 deletions scalacheck/src/test/scala/ParallelHashTrieCheck.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ with PairValues[Int, Int]

override def printDataStructureDebugInfo(ds: AnyRef) = ds match {
case pm: ParHashMap[k, v] =>
pm.printDebugInfo
pm.printDebugInfo()
case _ =>
println("could not match data structure type: " + ds.getClass)
}
Expand Down Expand Up @@ -124,7 +124,7 @@ with IntValues

override def printDataStructureDebugInfo(ds: AnyRef) = ds match {
case pm: ParHashMap[k, v] =>
pm.printDebugInfo
pm.printDebugInfo()
case _ =>
println("could not match data structure type: " + ds.getClass)
}
Expand Down
Loading