Skip to content

bump Scala version to 2.13.2 & enable -Werror #102

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 4 commits into from
May 20, 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.0
- 2.13.2

env:
- ADOPTOPENJDK=8
Expand Down
51 changes: 23 additions & 28 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,45 +1,40 @@
resolvers in ThisBuild += "scala-integration" at "https://scala-ci.typesafe.com/artifactory/scala-integration/"
Global / cancelable := true
publish / skip := true // in root

scalacOptions in ThisBuild ++= Seq("-deprecation", "-feature"/*, "-Xfatal-warnings"*/)

cancelable in Global := true

skip in publish := true // in root

lazy val commonSettings: Seq[Setting[_]] = Seq()

commonSettings // in root
lazy val commonSettings: Seq[Setting[_]] =
ScalaModulePlugin.scalaModuleSettings ++ Seq(
Compile / compile / scalacOptions += "-Werror"
)

lazy val core = project.in(file("core"))
.settings(ScalaModulePlugin.scalaModuleSettings)
.settings(commonSettings)
.settings(
name := "scala-parallel-collections"
)
name := "scala-parallel-collections"
)

lazy val junit = project.in(file("junit"))
.settings(commonSettings)
.settings(
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test,
// for javax.xml.bind.DatatypeConverter, used in SerializationStabilityTest
libraryDependencies += "javax.xml.bind" % "jaxb-api" % "2.3.1" % Test,
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v"),
fork in Test := true,
skip in publish := true
).dependsOn(testmacros, core)
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test,
// for javax.xml.bind.DatatypeConverter, used in SerializationStabilityTest
libraryDependencies += "javax.xml.bind" % "jaxb-api" % "2.3.1" % Test,
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v"),
Test / fork := true,
publish / skip := true
).dependsOn(testmacros, core)

lazy val scalacheck = project.in(file("scalacheck"))
.settings(commonSettings)
.settings(
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.14.3",
fork in Test := true,
testOptions in Test += Tests.Argument(TestFrameworks.ScalaCheck, "-workers", "1", "-minSize", "0", "-maxSize", "4000", "-minSuccessfulTests", "5"),
skip in publish := true
).dependsOn(core)
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.14.3",
Test / fork := true,
Test / testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-workers", "1", "-minSize", "0", "-maxSize", "4000", "-minSuccessfulTests", "5"),
publish / skip := true
).dependsOn(core)

lazy val testmacros = project.in(file("testmacros"))
.settings(commonSettings)
.settings(
libraryDependencies += scalaOrganization.value % "scala-compiler" % scalaVersion.value,
skip in publish := true
)
libraryDependencies += scalaOrganization.value % "scala-compiler" % scalaVersion.value,
publish / skip := true
)
3 changes: 0 additions & 3 deletions core/src/main/scala/scala/collection/Parallel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@ package scala
package collection

/** A marker trait for collections which have their operations parallelised.
*
* @since 2.9
* @author Aleksandar Prokopec
*/
trait Parallel
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import scala.collection.parallel._
* builder to be created.
* @tparam Elem the element type of the collection to be created.
* @tparam To the type of the collection to be created.
* @since 2.8
*/
trait CanCombineFrom[-From, -Elem, +To] extends Parallel {
def apply(from: From): Combiner[Elem, To]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package generic
import scala.collection.parallel.Combiner
import scala.collection.parallel.ParIterable
import scala.collection.parallel.ParMap
import scala.language.{higherKinds, implicitConversions}
import scala.language.implicitConversions

/** A template class for companion objects of parallel collection classes.
* They should be mixed in together with `GenericCompanion` type.
Expand Down Expand Up @@ -108,4 +108,4 @@ object GenericParMapCompanion {
def newBuilder: mutable.Builder[(K, V), CC[K, V]] = parFactory.newCombiner
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@ import scala.collection.parallel.ParIterable
import scala.collection.parallel.ParMap

import scala.annotation.unchecked.uncheckedVariance
import scala.language.higherKinds

/** A template trait for collections having a companion.
*
* @tparam A the element type of the collection
* @tparam CC the type constructor representing the collection class
* @author Aleksandar Prokopec
* @since 2.8
*/
trait GenericParTemplate[+A, +CC[X] <: ParIterable[X]]
extends GenericTraversableTemplate[A, CC]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

package scala.collection.generic

import scala.language.higherKinds
import scala.annotation.migration
import scala.annotation.unchecked.uncheckedVariance
import scala.collection.mutable.Builder
Expand All @@ -23,8 +22,6 @@ import scala.collection.parallel.ParIterable
*
* @tparam A The type of the collection elements.
* @tparam CC The type constructor representing the collection class.
* @author Martin Odersky
* @since 2.8
* @define coll collection
*/
// TODO inline in GenericParTemplate or ParIterable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ package generic

import scala.collection.parallel.Combiner

/**
* @since 2.8
*/
trait HasNewCombiner[+T, +Repr] {
protected[this] def newCombiner: Combiner[T, Repr]
}
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/scala/scala/collection/generic/ParFactory.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package collection
package generic

import scala.collection.parallel.ParIterable
import scala.language.higherKinds

/** A template class for companion objects of `ParIterable` and subclasses
* thereof. This class extends `TraversableFactory` and provides a set of
Expand All @@ -25,7 +24,6 @@ import scala.language.higherKinds
* This object provides a set of operations needed to create `$Coll` values.
* @define coll parallel collection
* @define Coll `ParIterable`
* @since 2.8
*/
abstract class ParFactory[CC[X] <: ParIterable[X] with GenericParTemplate[X, CC]]
extends GenericParCompanion[CC] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package generic
import scala.collection.parallel.ParMap
import scala.collection.parallel.ParMapLike
import scala.collection.parallel.Combiner
import scala.language.higherKinds

/** A template class for companion objects of `ParMap` and subclasses thereof.
* This class extends `TraversableFactory` and provides a set of operations
Expand All @@ -27,8 +26,6 @@ import scala.language.higherKinds
* @define Coll `ParMap`
* @define factoryInfo
* This object provides a set of operations needed to create `$Coll` values.
* @author Aleksandar Prokopec
* @since 2.8
*/
abstract class ParMapFactory[CC[X, Y] <: ParMap[X, Y] with ParMapLike[X, Y, CC, CC[X, Y], _]]
extends GenericParMapCompanion[CC] {
Expand Down Expand Up @@ -67,4 +64,4 @@ extends GenericParMapCompanion[CC] {
def apply() = newCombiner[K, V]
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ package generic
import scala.collection.parallel.Combiner
import scala.collection.parallel.ParSet
import scala.collection.parallel.ParSetLike
import scala.language.higherKinds

/**
* @define factoryInfo
* This object provides a set of operations needed to create `$Coll` values.
* @author Aleksandar Prokopec
* @since 2.8
*/
abstract class ParSetFactory[CC[X] <: ParSet[X] with ParSetLike[X, CC, CC[X], _] with GenericParTemplate[X, CC]]
extends GenericParCompanion[CC] {
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/scala/scala/collection/generic/Signalling.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ import java.util.concurrent.atomic.AtomicInteger
* signalling interface to inform worker threads that an element has
* been found and no further search is necessary.
*
* @author prokopec
*
* @define abortflag
* Abort flag being true means that a worker can abort and produce whatever result,
* since its result will not affect the final result of computation. An example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ import scala.collection.mutable.{Builder, ImmutableBuilder}
*
* @tparam K the type of the keys contained in this hash map.
* @tparam V the type of the values associated with the keys.
* @author Martin Odersky
* @author Tiark Rompf
* @since 2.3
* @see [[http://docs.scala-lang.org/overviews/collections/concrete-immutable-collection-classes.html#hash-tries "Scala's Collection Library overview"]]
* section on `Hash Tries` for more information.
* @define Coll `immutable.OldHashMap`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ import scala.annotation.tailrec
*
* @tparam A the type of the elements contained in this hash set.
*
* @author Martin Odersky
* @author Tiark Rompf
* @since 2.3
* @define Coll `immutable.OldHashSet`
* @define coll immutable hash set
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import scala.util.hashing.byteswap32
* hash table as an implementation.
*
* @define coll flat hash table
* @since 2.3
* @tparam A the type of the elements contained in the $coll.
*/
private[collection] trait FlatHashTable[A] extends FlatHashTable.HashUtils[A] {
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/scala/scala/collection/parallel/Combiner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ import scala.collection.generic.Sizing
*
* @tparam Elem the type of the elements added to the builder
* @tparam To the type of the collection the builder produces
*
* @author Aleksandar Prokopec
* @since 2.9
*/
trait Combiner[-Elem, +To] extends Builder[Elem, To] with Sizing with Parallel {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ import scala.collection.parallel.mutable.ParArrayCombiner
* $sideeffects
*
* @tparam T the element type of the collection
*
* @author Aleksandar Prokopec
* @since 2.9
*/
trait ParIterable[+T]
extends GenericParTemplate[T, ParIterable]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
package scala
package collection.parallel

import scala.language.{ higherKinds, implicitConversions }
import scala.language.implicitConversions
import scala.collection.mutable.Builder
import scala.collection.mutable.ArrayBuffer
import scala.collection.{CustomParallelizable, IterableOps, Parallel}
Expand Down Expand Up @@ -122,9 +122,6 @@ import scala.reflect.ClassTag
* Method `size` is implemented as a constant time operation for parallel collections, and parallel collection
* operations rely on this assumption.
*
* @author Aleksandar Prokopec
* @since 2.9
*
* @define sideeffects
* The higher-order functions passed to certain operations may contain side-effects. Since implementations
* of bulk operations may not be sequential, this means that side-effects may not be predictable and may
Expand Down Expand Up @@ -874,7 +871,7 @@ self =>
protected[this] def newSubtask(p: IterableSplitter[T]): Accessor[R, Tp]
def shouldSplitFurther = pit.shouldSplitFurther(self.repr, tasksupport.parallelismLevel)
def split = pit.splitWithSignalling.map(newSubtask(_)) // default split procedure
private[parallel] override def signalAbort = pit.abort()
private[parallel] override def signalAbort() = pit.abort()
override def toString = this.getClass.getSimpleName + "(" + pit.toString + ")(" + result + ")(supername: " + super.toString + ")"
}

Expand Down
3 changes: 0 additions & 3 deletions core/src/main/scala/scala/collection/parallel/ParMap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ import scala.collection.generic.CanCombineFrom
*
* @tparam K the key type of the map
* @tparam V the value type of the map
*
* @author Aleksandar Prokopec
* @since 2.9
*/
trait ParMap[K, +V]
extends GenericParMapTemplate[K, V, ParMap]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import scala.collection.{IterableOnce, MapOps}
import scala.collection.Map

import scala.annotation.unchecked.uncheckedVariance
import scala.language.higherKinds

/** A template trait for mutable parallel maps. This trait is to be mixed in
* with concrete parallel maps to override the representation type.
Expand All @@ -29,9 +28,6 @@ import scala.language.higherKinds
* @tparam V the value type of the map
* @define Coll `ParMap`
* @define coll parallel map
*
* @author Aleksandar Prokopec
* @since 2.9
*/
trait ParMapLike[K,
+V,
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/scala/scala/collection/parallel/ParSeq.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import scala.collection.parallel.mutable.ParArrayCombiner
* $sideeffects
*
* @tparam T the type of the elements in this parallel sequence
*
* @author Aleksandar Prokopec
*/
trait ParSeq[+T] extends ParIterable[T]
with GenericParTemplate[T, ParSeq]
Expand Down
Loading