diff --git a/.travis.yml b/.travis.yml index 535f36db..3b9388af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ import: scala/scala-dev:travis/default.yml language: scala scala: - - 2.13.0 + - 2.13.2 env: - ADOPTOPENJDK=8 diff --git a/build.sbt b/build.sbt index 555b1536..11c68e25 100644 --- a/build.sbt +++ b/build.sbt @@ -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 + ) diff --git a/core/src/main/scala/scala/collection/Parallel.scala b/core/src/main/scala/scala/collection/Parallel.scala index cdfb5d99..8b2ff4aa 100644 --- a/core/src/main/scala/scala/collection/Parallel.scala +++ b/core/src/main/scala/scala/collection/Parallel.scala @@ -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 diff --git a/core/src/main/scala/scala/collection/generic/CanCombineFrom.scala b/core/src/main/scala/scala/collection/generic/CanCombineFrom.scala index 08a10824..16367d0b 100644 --- a/core/src/main/scala/scala/collection/generic/CanCombineFrom.scala +++ b/core/src/main/scala/scala/collection/generic/CanCombineFrom.scala @@ -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] diff --git a/core/src/main/scala/scala/collection/generic/GenericParCompanion.scala b/core/src/main/scala/scala/collection/generic/GenericParCompanion.scala index c9a05bd5..ab79b60b 100644 --- a/core/src/main/scala/scala/collection/generic/GenericParCompanion.scala +++ b/core/src/main/scala/scala/collection/generic/GenericParCompanion.scala @@ -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. @@ -108,4 +108,4 @@ object GenericParMapCompanion { def newBuilder: mutable.Builder[(K, V), CC[K, V]] = parFactory.newCombiner } -} \ No newline at end of file +} diff --git a/core/src/main/scala/scala/collection/generic/GenericParTemplate.scala b/core/src/main/scala/scala/collection/generic/GenericParTemplate.scala index 86792a5b..04d1ac4c 100644 --- a/core/src/main/scala/scala/collection/generic/GenericParTemplate.scala +++ b/core/src/main/scala/scala/collection/generic/GenericParTemplate.scala @@ -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] diff --git a/core/src/main/scala/scala/collection/generic/GenericTraversableTemplate.scala b/core/src/main/scala/scala/collection/generic/GenericTraversableTemplate.scala index 310cf520..b78e83d8 100644 --- a/core/src/main/scala/scala/collection/generic/GenericTraversableTemplate.scala +++ b/core/src/main/scala/scala/collection/generic/GenericTraversableTemplate.scala @@ -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 @@ -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 diff --git a/core/src/main/scala/scala/collection/generic/HasNewCombiner.scala b/core/src/main/scala/scala/collection/generic/HasNewCombiner.scala index e5a8c3de..f2059975 100644 --- a/core/src/main/scala/scala/collection/generic/HasNewCombiner.scala +++ b/core/src/main/scala/scala/collection/generic/HasNewCombiner.scala @@ -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] } diff --git a/core/src/main/scala/scala/collection/generic/ParFactory.scala b/core/src/main/scala/scala/collection/generic/ParFactory.scala index 7ba1459c..df657e4f 100644 --- a/core/src/main/scala/scala/collection/generic/ParFactory.scala +++ b/core/src/main/scala/scala/collection/generic/ParFactory.scala @@ -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 @@ -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] { diff --git a/core/src/main/scala/scala/collection/generic/ParMapFactory.scala b/core/src/main/scala/scala/collection/generic/ParMapFactory.scala index 80c46898..8822de53 100644 --- a/core/src/main/scala/scala/collection/generic/ParMapFactory.scala +++ b/core/src/main/scala/scala/collection/generic/ParMapFactory.scala @@ -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 @@ -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] { @@ -67,4 +64,4 @@ extends GenericParMapCompanion[CC] { def apply() = newCombiner[K, V] } -} \ No newline at end of file +} diff --git a/core/src/main/scala/scala/collection/generic/ParSetFactory.scala b/core/src/main/scala/scala/collection/generic/ParSetFactory.scala index d5b44274..ed7707ca 100644 --- a/core/src/main/scala/scala/collection/generic/ParSetFactory.scala +++ b/core/src/main/scala/scala/collection/generic/ParSetFactory.scala @@ -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] { diff --git a/core/src/main/scala/scala/collection/generic/Signalling.scala b/core/src/main/scala/scala/collection/generic/Signalling.scala index a14dff1c..d6f67345 100644 --- a/core/src/main/scala/scala/collection/generic/Signalling.scala +++ b/core/src/main/scala/scala/collection/generic/Signalling.scala @@ -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 diff --git a/core/src/main/scala/scala/collection/immutable/OldHashMap.scala b/core/src/main/scala/scala/collection/immutable/OldHashMap.scala index a0f4fb16..ebe37d95 100644 --- a/core/src/main/scala/scala/collection/immutable/OldHashMap.scala +++ b/core/src/main/scala/scala/collection/immutable/OldHashMap.scala @@ -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` diff --git a/core/src/main/scala/scala/collection/immutable/OldHashSet.scala b/core/src/main/scala/scala/collection/immutable/OldHashSet.scala index d9a9bb96..f91a8641 100644 --- a/core/src/main/scala/scala/collection/immutable/OldHashSet.scala +++ b/core/src/main/scala/scala/collection/immutable/OldHashSet.scala @@ -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 */ diff --git a/core/src/main/scala/scala/collection/mutable/FlatHashTable.scala b/core/src/main/scala/scala/collection/mutable/FlatHashTable.scala index 49ed47e0..ee726431 100644 --- a/core/src/main/scala/scala/collection/mutable/FlatHashTable.scala +++ b/core/src/main/scala/scala/collection/mutable/FlatHashTable.scala @@ -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] { diff --git a/core/src/main/scala/scala/collection/parallel/Combiner.scala b/core/src/main/scala/scala/collection/parallel/Combiner.scala index 9215eb9d..271c610f 100644 --- a/core/src/main/scala/scala/collection/parallel/Combiner.scala +++ b/core/src/main/scala/scala/collection/parallel/Combiner.scala @@ -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 { diff --git a/core/src/main/scala/scala/collection/parallel/ParIterable.scala b/core/src/main/scala/scala/collection/parallel/ParIterable.scala index 09796799..8686d5cc 100644 --- a/core/src/main/scala/scala/collection/parallel/ParIterable.scala +++ b/core/src/main/scala/scala/collection/parallel/ParIterable.scala @@ -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] diff --git a/core/src/main/scala/scala/collection/parallel/ParIterableLike.scala b/core/src/main/scala/scala/collection/parallel/ParIterableLike.scala index 2111eb52..4d739537 100644 --- a/core/src/main/scala/scala/collection/parallel/ParIterableLike.scala +++ b/core/src/main/scala/scala/collection/parallel/ParIterableLike.scala @@ -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} @@ -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 @@ -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 + ")" } diff --git a/core/src/main/scala/scala/collection/parallel/ParMap.scala b/core/src/main/scala/scala/collection/parallel/ParMap.scala index 52268c28..856da36c 100644 --- a/core/src/main/scala/scala/collection/parallel/ParMap.scala +++ b/core/src/main/scala/scala/collection/parallel/ParMap.scala @@ -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] diff --git a/core/src/main/scala/scala/collection/parallel/ParMapLike.scala b/core/src/main/scala/scala/collection/parallel/ParMapLike.scala index 401f3fc7..93b8ea0d 100644 --- a/core/src/main/scala/scala/collection/parallel/ParMapLike.scala +++ b/core/src/main/scala/scala/collection/parallel/ParMapLike.scala @@ -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. @@ -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, diff --git a/core/src/main/scala/scala/collection/parallel/ParSeq.scala b/core/src/main/scala/scala/collection/parallel/ParSeq.scala index 0c28bdde..bdd9f456 100644 --- a/core/src/main/scala/scala/collection/parallel/ParSeq.scala +++ b/core/src/main/scala/scala/collection/parallel/ParSeq.scala @@ -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] diff --git a/core/src/main/scala/scala/collection/parallel/ParSeqLike.scala b/core/src/main/scala/scala/collection/parallel/ParSeqLike.scala index 9cf8c663..1f38a485 100644 --- a/core/src/main/scala/scala/collection/parallel/ParSeqLike.scala +++ b/core/src/main/scala/scala/collection/parallel/ParSeqLike.scala @@ -13,8 +13,6 @@ package scala package collection.parallel -import scala.language.higherKinds - import scala.collection.{AnyConstr, BufferedIterator, Iterator, SeqOps} import scala.collection.generic.DefaultSignalling import scala.collection.generic.AtomicIndexFlag @@ -46,9 +44,6 @@ import scala.collection.parallel.ParallelCollectionImplicits._ * * This trait defines a new, more general `split` operation and reimplements the `split` * operation of `ParallelIterable` trait using the new `split` operation. - * - * @author Aleksandar Prokopec - * @since 2.9 */ trait ParSeqLike[+T, +CC[X] <: ParSeq[X], +Repr <: ParSeq[T], +Sequential <: scala.collection.Seq[T] with SeqOps[T, AnyConstr, Sequential]] extends ParIterableLike[T, CC, Repr, Sequential] @@ -401,7 +396,7 @@ self => that match { case thatseq: ParSeq[S] => tasksupport.executeAndWaitResult( - new Zip(length min thatseq.length, combinerFactory(() => companion.newCombiner[(U, S)]), splitter, thatseq.splitter) mapResult { + new ParSeqLikeZip(length min thatseq.length, combinerFactory(() => companion.newCombiner[(U, S)]), splitter, thatseq.splitter) mapResult { _.resultWithTaskSupport } ) @@ -474,14 +469,14 @@ self => protected[this] def down(p: IterableSplitter[_]) = p.asInstanceOf[SeqSplitter[T]] - protected trait Accessor[R, Tp] extends super.Accessor[R, Tp] { + protected trait ParSeqLikeAccessor[R, Tp] extends Accessor[R, Tp] { protected[this] val pit: SeqSplitter[T] } - protected trait Transformer[R, Tp] extends Accessor[R, Tp] with super.Transformer[R, Tp] + protected trait ParSeqLikeTransformer[R, Tp] extends ParSeqLikeAccessor[R, Tp] with Transformer[R, Tp] protected[this] class SegmentLength(pred: T => Boolean, from: Int, protected[this] val pit: SeqSplitter[T]) - extends Accessor[(Int, Boolean), SegmentLength] { + extends ParSeqLikeAccessor[(Int, Boolean), SegmentLength] { @volatile var result: (Int, Boolean) = null def leaf(prev: Option[(Int, Boolean)]) = if (from < pit.indexFlag) { val itsize = pit.remaining @@ -499,7 +494,7 @@ self => } protected[this] class IndexWhere(pred: T => Boolean, from: Int, protected[this] val pit: SeqSplitter[T]) - extends Accessor[Int, IndexWhere] { + extends ParSeqLikeAccessor[Int, IndexWhere] { @volatile var result: Int = -1 def leaf(prev: Option[Int]) = if (from < pit.indexFlag) { val r = pit.indexWhere(pred) @@ -520,7 +515,7 @@ self => } protected[this] class LastIndexWhere(pred: T => Boolean, pos: Int, protected[this] val pit: SeqSplitter[T]) - extends Accessor[Int, LastIndexWhere] { + extends ParSeqLikeAccessor[Int, LastIndexWhere] { @volatile var result: Int = -1 def leaf(prev: Option[Int]) = if (pos > pit.indexFlag) { val r = pit.lastIndexWhere(pred) @@ -541,7 +536,7 @@ self => } protected[this] class Reverse[U >: T, This >: Repr](cbf: () => Combiner[U, This], protected[this] val pit: SeqSplitter[T]) - extends Transformer[Combiner[U, This], Reverse[U, This]] { + extends ParSeqLikeTransformer[Combiner[U, This], Reverse[U, This]] { @volatile var result: Combiner[U, This] = null def leaf(prev: Option[Combiner[U, This]]) = result = pit.reverse2combiner(reuse(prev, cbf())) protected[this] def newSubtask(p: SuperParIterator) = new Reverse(cbf, down(p)) @@ -549,7 +544,7 @@ self => } protected[this] class ReverseMap[S, That](f: T => S, pbf: () => Combiner[S, That], protected[this] val pit: SeqSplitter[T]) - extends Transformer[Combiner[S, That], ReverseMap[S, That]] { + extends ParSeqLikeTransformer[Combiner[S, That], ReverseMap[S, That]] { @volatile var result: Combiner[S, That] = null def leaf(prev: Option[Combiner[S, That]]) = result = pit.reverseMap2combiner(f, pbf()) protected[this] def newSubtask(p: SuperParIterator) = new ReverseMap(f, pbf, down(p)) @@ -557,7 +552,7 @@ self => } protected[this] class SameElements[U >: T](protected[this] val pit: SeqSplitter[T], val otherpit: SeqSplitter[U]) - extends Accessor[Boolean, SameElements[U]] { + extends ParSeqLikeAccessor[Boolean, SameElements[U]] { @volatile var result: Boolean = true def leaf(prev: Option[Boolean]) = if (!pit.isAborted) { result = pit.sameElements(otherpit) @@ -574,7 +569,7 @@ self => } protected[this] class Updated[U >: T, That](pos: Int, elem: U, pbf: CombinerFactory[U, That], protected[this] val pit: SeqSplitter[T]) - extends Transformer[Combiner[U, That], Updated[U, That]] { + extends ParSeqLikeTransformer[Combiner[U, That], Updated[U, That]] { @volatile var result: Combiner[U, That] = null def leaf(prev: Option[Combiner[U, That]]) = result = pit.updated2combiner(pos, elem, pbf()) protected[this] def newSubtask(p: SuperParIterator) = throw new UnsupportedOperationException @@ -586,8 +581,8 @@ self => override def requiresStrictSplitters = true } - protected[this] class Zip[U >: T, S, That](len: Int, cf: CombinerFactory[(U, S), That], protected[this] val pit: SeqSplitter[T], val otherpit: SeqSplitter[S]) - extends Transformer[Combiner[(U, S), That], Zip[U, S, That]] { + protected[this] class ParSeqLikeZip[U >: T, S, That](len: Int, cf: CombinerFactory[(U, S), That], protected[this] val pit: SeqSplitter[T], val otherpit: SeqSplitter[S]) + extends ParSeqLikeTransformer[Combiner[(U, S), That], ParSeqLikeZip[U, S, That]] { @volatile var result: Result = null def leaf(prev: Option[Result]) = result = pit.zip2combiner[U, S, That](otherpit, cf()) protected[this] def newSubtask(p: SuperParIterator) = throw new UnsupportedOperationException @@ -597,15 +592,15 @@ self => val pits = pit.psplitWithSignalling(fp, sp) val opits = otherpit.psplitWithSignalling(fp, sp) Seq( - new Zip(fp, cf, pits(0), opits(0)), - new Zip(sp, cf, pits(1), opits(1)) + new ParSeqLikeZip(fp, cf, pits(0), opits(0)), + new ParSeqLikeZip(sp, cf, pits(1), opits(1)) ) } - override def merge(that: Zip[U, S, That]) = result = result combine that.result + override def merge(that: ParSeqLikeZip[U, S, That]) = result = result combine that.result } protected[this] class Corresponds[S](corr: (T, S) => Boolean, protected[this] val pit: SeqSplitter[T], val otherpit: SeqSplitter[S]) - extends Accessor[Boolean, Corresponds[S]] { + extends ParSeqLikeAccessor[Boolean, Corresponds[S]] { @volatile var result: Boolean = true def leaf(prev: Option[Boolean]) = if (!pit.isAborted) { result = pit.corresponds(corr)(otherpit) diff --git a/core/src/main/scala/scala/collection/parallel/ParSet.scala b/core/src/main/scala/scala/collection/parallel/ParSet.scala index 246c1d24..f20a0532 100644 --- a/core/src/main/scala/scala/collection/parallel/ParSet.scala +++ b/core/src/main/scala/scala/collection/parallel/ParSet.scala @@ -21,9 +21,6 @@ import scala.collection.generic._ * $sideeffects * * @tparam T the element type of the set - * - * @author Aleksandar Prokopec - * @since 2.9 */ trait ParSet[T] extends GenericParTemplate[T, ParSet] diff --git a/core/src/main/scala/scala/collection/parallel/ParSetLike.scala b/core/src/main/scala/scala/collection/parallel/ParSetLike.scala index ace489a9..72069d00 100644 --- a/core/src/main/scala/scala/collection/parallel/ParSetLike.scala +++ b/core/src/main/scala/scala/collection/parallel/ParSetLike.scala @@ -14,7 +14,6 @@ package scala package collection.parallel import scala.collection.{Set, SetOps} -import scala.language.higherKinds /** A template trait for parallel sets. This trait is mixed in with concrete * parallel sets to override the representation type. @@ -24,9 +23,6 @@ import scala.language.higherKinds * @tparam T the element type of the set * @define Coll `ParSet` * @define coll parallel set - * - * @author Aleksandar Prokopec - * @since 2.9 */ trait ParSetLike[T, +CC[X] <: ParIterable[X], diff --git a/core/src/main/scala/scala/collection/parallel/PreciseSplitter.scala b/core/src/main/scala/scala/collection/parallel/PreciseSplitter.scala index b87389f2..17b00773 100644 --- a/core/src/main/scala/scala/collection/parallel/PreciseSplitter.scala +++ b/core/src/main/scala/scala/collection/parallel/PreciseSplitter.scala @@ -21,9 +21,6 @@ import scala.collection.Seq * Implementors might want to override the parameterless `split` method for efficiency. * * @tparam T type of the elements this splitter traverses - * - * @since 2.9 - * @author Aleksandar Prokopec */ trait PreciseSplitter[+T] extends Splitter[T] { diff --git a/core/src/main/scala/scala/collection/parallel/RemainsIterator.scala b/core/src/main/scala/scala/collection/parallel/RemainsIterator.scala index 727e6111..2a45d708 100644 --- a/core/src/main/scala/scala/collection/parallel/RemainsIterator.scala +++ b/core/src/main/scala/scala/collection/parallel/RemainsIterator.scala @@ -422,7 +422,7 @@ self => class Taken(taken: Int) extends IterableSplitter[T] { var remaining = taken min self.remaining def hasNext = remaining > 0 - def next = { remaining -= 1; self.next() } + def next() = { remaining -= 1; self.next() } def dup: IterableSplitter[T] = self.dup.take(taken) def split: Seq[IterableSplitter[T]] = takeSeq(self.split) { (p, n) => p.take(n) } protected[this] def takeSeq[PI <: IterableSplitter[T]](sq: Seq[PI])(taker: (PI, Int) => PI) = { @@ -459,7 +459,7 @@ self => class Mapped[S](f: T => S) extends IterableSplitter[S] { signalDelegate = self.signalDelegate def hasNext = self.hasNext - def next = f(self.next()) + def next() = f(self.next()) def remaining = self.remaining def dup: IterableSplitter[S] = self.dup map f def split: Seq[IterableSplitter[S]] = self.split.map { _ map f } @@ -474,7 +474,7 @@ self => curr = that curr.hasNext } else false - def next = if (curr eq self) { + def next() = if (curr eq self) { hasNext curr.next() } else curr.next() @@ -489,7 +489,7 @@ self => class Zipped[S](protected val that: SeqSplitter[S]) extends IterableSplitter[(T, S)] { signalDelegate = self.signalDelegate def hasNext = self.hasNext && that.hasNext - def next = (self.next(), that.next()) + def next() = (self.next(), that.next()) def remaining = self.remaining min that.remaining def dup: IterableSplitter[(T, S)] = self.dup.zipParSeq(that) def split: Seq[IterableSplitter[(T, S)]] = { @@ -506,7 +506,7 @@ self => extends IterableSplitter[(U, S)] { signalDelegate = self.signalDelegate def hasNext = self.hasNext || that.hasNext - def next = if (self.hasNext) { + def next() = if (self.hasNext) { if (that.hasNext) (self.next(), that.next()) else (self.next(), thatelem) } else (thiselem, that.next()) @@ -563,24 +563,24 @@ self => /* iterator transformers */ - class Taken(tk: Int) extends super.Taken(tk) with SeqSplitter[T] { + class RemainsIteratorTaken(tk: Int) extends Taken(tk) with SeqSplitter[T] { override def dup = super.dup.asInstanceOf[SeqSplitter[T]] override def split: Seq[SeqSplitter[T]] = super.split.asInstanceOf[Seq[SeqSplitter[T]]] def psplit(sizes: Int*): Seq[SeqSplitter[T]] = takeSeq(self.psplit(sizes: _*)) { (p, n) => p.take(n) } } - override private[collection] def newTaken(until: Int): Taken = new Taken(until) + override private[collection] def newTaken(until: Int): RemainsIteratorTaken = new RemainsIteratorTaken(until) override def take(n: Int): SeqSplitter[T] = newTaken(n) override def slice(from1: Int, until1: Int): SeqSplitter[T] = newSliceInternal(newTaken(until1), from1) - class Mapped[S](f: T => S) extends super.Mapped[S](f) with SeqSplitter[S] { + class RemainsIteratorMapped[S](f: T => S) extends Mapped[S](f) with SeqSplitter[S] { override def dup = super.dup.asInstanceOf[SeqSplitter[S]] override def split: Seq[SeqSplitter[S]] = super.split.asInstanceOf[Seq[SeqSplitter[S]]] def psplit(sizes: Int*): Seq[SeqSplitter[S]] = self.psplit(sizes: _*).map { _ map f } } - override def map[S](f: T => S) = new Mapped(f) + override def map[S](f: T => S) = new RemainsIteratorMapped(f) - class Appended[U >: T, PI <: SeqSplitter[U]](it: PI) extends super.Appended[U, PI](it) with SeqSplitter[U] { + class RemainsIteratorAppended[U >: T, PI <: SeqSplitter[U]](it: PI) extends Appended[U, PI](it) with SeqSplitter[U] { override def dup = super.dup.asInstanceOf[SeqSplitter[U]] override def split: Seq[SeqSplitter[U]] = super.split.asInstanceOf[Seq[SeqSplitter[U]]] def psplit(sizes: Int*): Seq[SeqSplitter[U]] = if (firstNonEmpty) { @@ -609,17 +609,17 @@ self => } else curr.asInstanceOf[SeqSplitter[U]].psplit(sizes: _*) } - def appendParSeq[U >: T, PI <: SeqSplitter[U]](that: PI) = new Appended[U, PI](that) + def appendParSeq[U >: T, PI <: SeqSplitter[U]](that: PI) = new RemainsIteratorAppended[U, PI](that) - class Zipped[S](ti: SeqSplitter[S]) extends super.Zipped[S](ti) with SeqSplitter[(T, S)] { + class RemainsIteratorZipped[S](ti: SeqSplitter[S]) extends Zipped[S](ti) with SeqSplitter[(T, S)] { override def dup = super.dup.asInstanceOf[SeqSplitter[(T, S)]] override def split: Seq[SeqSplitter[(T, S)]] = super.split.asInstanceOf[Seq[SeqSplitter[(T, S)]]] def psplit(szs: Int*) = (self.psplit(szs: _*) zip that.psplit(szs: _*)) map { p => p._1 zipParSeq p._2 } } - override def zipParSeq[S](that: SeqSplitter[S]) = new Zipped(that) + override def zipParSeq[S](that: SeqSplitter[S]) = new RemainsIteratorZipped(that) - class ZippedAll[U >: T, S](ti: SeqSplitter[S], thise: U, thate: S) extends super.ZippedAll[U, S](ti, thise, thate) with SeqSplitter[(U, S)] { + class RemainsIteratorZippedAll[U >: T, S](ti: SeqSplitter[S], thise: U, thate: S) extends ZippedAll[U, S](ti, thise, thate) with SeqSplitter[(U, S)] { override def dup = super.dup.asInstanceOf[SeqSplitter[(U, S)]] private def patchem = { val selfrem = self.remaining @@ -640,7 +640,7 @@ self => } } - override def zipAllParSeq[S, U >: T, R >: S](that: SeqSplitter[S], thisElem: U, thatElem: R) = new ZippedAll[U, R](that, thisElem, thatElem) + override def zipAllParSeq[S, U >: T, R >: S](that: SeqSplitter[S], thisElem: U, thatElem: R) = new RemainsIteratorZippedAll[U, R](that, thisElem, thatElem) def reverse: SeqSplitter[T] = { val pa = mutable.ParArray.fromIterables(self).reverse @@ -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 diff --git a/core/src/main/scala/scala/collection/parallel/Splitter.scala b/core/src/main/scala/scala/collection/parallel/Splitter.scala index 28e3e524..de334816 100644 --- a/core/src/main/scala/scala/collection/parallel/Splitter.scala +++ b/core/src/main/scala/scala/collection/parallel/Splitter.scala @@ -19,9 +19,6 @@ import scala.collection.{ Seq, Iterator } * disjoint subsets of elements. * * @tparam T type of the elements this splitter traverses - * - * @since 2.9 - * @author Aleksandar Prokopec */ trait Splitter[+T] extends Iterator[T] { @@ -57,7 +54,7 @@ trait Splitter[+T] extends Iterator[T] { object Splitter { def empty[T]: Splitter[T] = new Splitter[T] { def hasNext = false - def next = Iterator.empty.next() + def next() = Iterator.empty.next() def split = Seq(this) } } diff --git a/core/src/main/scala/scala/collection/parallel/Tasks.scala b/core/src/main/scala/scala/collection/parallel/Tasks.scala index 4d923e40..24aae15f 100644 --- a/core/src/main/scala/scala/collection/parallel/Tasks.scala +++ b/core/src/main/scala/scala/collection/parallel/Tasks.scala @@ -139,11 +139,11 @@ trait Tasks { */ trait AdaptiveWorkStealingTasks extends Tasks { - trait WrappedTask[R, Tp] extends super.WrappedTask[R, Tp] { - @volatile var next: WrappedTask[R, Tp] = null + trait AWSTWrappedTask[R, Tp] extends WrappedTask[R, Tp] { + @volatile var next: AWSTWrappedTask[R, Tp] = null @volatile var shouldWaitFor = true - def split: Seq[WrappedTask[R, Tp]] + def split: Seq[AWSTWrappedTask[R, Tp]] def compute() = if (body.shouldSplitFurther) { internal() @@ -178,8 +178,8 @@ trait AdaptiveWorkStealingTasks extends Tasks { } def spawnSubtasks() = { - var last: WrappedTask[R, Tp] = null - var head: WrappedTask[R, Tp] = this + var last: AWSTWrappedTask[R, Tp] = null + var head: AWSTWrappedTask[R, Tp] = this do { val subtasks = head.split head = subtasks.head @@ -237,14 +237,14 @@ trait HavingForkJoinPool { */ trait ForkJoinTasks extends Tasks with HavingForkJoinPool { - trait WrappedTask[R, +Tp] extends RecursiveAction with super.WrappedTask[R, Tp] { + trait FJTWrappedTask[R, +Tp] extends RecursiveAction with WrappedTask[R, Tp] { def start() = fork def sync() = join - def tryCancel = tryUnfork + def tryCancel() = tryUnfork } // specialize ctor - protected def newWrappedTask[R, Tp](b: Task[R, Tp]): WrappedTask[R, Tp] + protected def newWrappedTask[R, Tp](b: Task[R, Tp]): FJTWrappedTask[R, Tp] /** The fork/join pool of this collection. */ @@ -300,12 +300,12 @@ object ForkJoinTasks { */ trait AdaptiveWorkStealingForkJoinTasks extends ForkJoinTasks with AdaptiveWorkStealingTasks { - class WrappedTask[R, Tp](val body: Task[R, Tp]) - extends super[ForkJoinTasks].WrappedTask[R, Tp] with super[AdaptiveWorkStealingTasks].WrappedTask[R, Tp] { + class AWSFJTWrappedTask[R, Tp](val body: Task[R, Tp]) + extends FJTWrappedTask[R, Tp] with AWSTWrappedTask[R, Tp] { def split = body.split.map(b => newWrappedTask(b)) } - def newWrappedTask[R, Tp](b: Task[R, Tp]) = new WrappedTask[R, Tp](b) + def newWrappedTask[R, Tp](b: Task[R, Tp]) = new AWSFJTWrappedTask[R, Tp](b) } /** An implementation of the `Tasks` that uses Scala `Future`s to compute diff --git a/core/src/main/scala/scala/collection/parallel/immutable/ParHashMap.scala b/core/src/main/scala/scala/collection/parallel/immutable/ParHashMap.scala index f1430740..3316051e 100644 --- a/core/src/main/scala/scala/collection/parallel/immutable/ParHashMap.scala +++ b/core/src/main/scala/scala/collection/parallel/immutable/ParHashMap.scala @@ -33,8 +33,6 @@ import scala.collection.Hashing * @tparam K the key type of the map * @tparam V the value type of the map * - * @author Aleksandar Prokopec - * @since 2.9 * @see [[http://docs.scala-lang.org/overviews/parallel-collections/concrete-parallel-collections.html#parallel_hash_tries Scala's Parallel Collections Library overview]] * section on Parallel Hash Tries for more information. * @@ -175,7 +173,7 @@ extends scala.collection.parallel.BucketCombiner[(K, V), ParHashMap[K, V], (K, V this } - def result = { + def result() = { val bucks = buckets.filter(_ != null).map(_.headPtr) val root = new Array[OldHashMap[K, V]](bucks.length) diff --git a/core/src/main/scala/scala/collection/parallel/immutable/ParHashSet.scala b/core/src/main/scala/scala/collection/parallel/immutable/ParHashSet.scala index bf791849..570ed1a0 100644 --- a/core/src/main/scala/scala/collection/parallel/immutable/ParHashSet.scala +++ b/core/src/main/scala/scala/collection/parallel/immutable/ParHashSet.scala @@ -35,8 +35,6 @@ import scala.collection.parallel.Task * * @tparam T the element type of the set * - * @author Aleksandar Prokopec - * @since 2.9 * @see [[http://docs.scala-lang.org/overviews/parallel-collections/concrete-parallel-collections.html#parallel_hash_tries Scala's Parallel Collections Library overview]] * section on Parallel Hash Tries for more information. * diff --git a/core/src/main/scala/scala/collection/parallel/immutable/ParIterable.scala b/core/src/main/scala/scala/collection/parallel/immutable/ParIterable.scala index d39a7f3e..32572675 100644 --- a/core/src/main/scala/scala/collection/parallel/immutable/ParIterable.scala +++ b/core/src/main/scala/scala/collection/parallel/immutable/ParIterable.scala @@ -25,9 +25,6 @@ import scala.collection.parallel.Combiner * $sideeffects * * @tparam T the element type of the collection - * - * @author Aleksandar Prokopec - * @since 2.9 */ trait ParIterable[+T] extends scala.collection.parallel.ParIterable[T] diff --git a/core/src/main/scala/scala/collection/parallel/immutable/ParMap.scala b/core/src/main/scala/scala/collection/parallel/immutable/ParMap.scala index 18a17fac..b4a71287 100644 --- a/core/src/main/scala/scala/collection/parallel/immutable/ParMap.scala +++ b/core/src/main/scala/scala/collection/parallel/immutable/ParMap.scala @@ -20,8 +20,6 @@ import scala.collection.generic.GenericParMapCompanion import scala.collection.generic.CanCombineFrom import scala.collection.parallel.Combiner -import scala.language.higherKinds - /** A template trait for immutable parallel maps. * * $sideeffects @@ -29,8 +27,6 @@ import scala.language.higherKinds * @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] diff --git a/core/src/main/scala/scala/collection/parallel/immutable/ParRange.scala b/core/src/main/scala/scala/collection/parallel/immutable/ParRange.scala index 2520771b..38445be8 100644 --- a/core/src/main/scala/scala/collection/parallel/immutable/ParRange.scala +++ b/core/src/main/scala/scala/collection/parallel/immutable/ParRange.scala @@ -26,8 +26,6 @@ import scala.collection.Iterator * * @param range the sequential range this parallel range was obtained from * - * @author Aleksandar Prokopec - * @since 2.9 * @see [[http://docs.scala-lang.org/overviews/parallel-collections/concrete-parallel-collections.html#parallel_range Scala's Parallel Collections Library overview]] * section on `ParRange` for more information. * @@ -60,7 +58,7 @@ self => final def hasNext = ind < len - final def next = if (hasNext) { + final def next() = if (hasNext) { val r = range.apply(ind) ind += 1 r diff --git a/core/src/main/scala/scala/collection/parallel/immutable/ParVector.scala b/core/src/main/scala/scala/collection/parallel/immutable/ParVector.scala index 9ab9c613..bed7e7ac 100644 --- a/core/src/main/scala/scala/collection/parallel/immutable/ParVector.scala +++ b/core/src/main/scala/scala/collection/parallel/immutable/ParVector.scala @@ -31,8 +31,6 @@ import immutable.VectorIterator * * @tparam T the element type of the vector * - * @author Aleksandar Prokopec - * @since 2.9 * @see [[http://docs.scala-lang.org/overviews/parallel-collections/concrete-parallel-collections.html#parallel_vector Scala's Parallel Collections Library overview]] * section on `ParVector` for more information. * @@ -121,7 +119,7 @@ private[immutable] class LazyParVectorCombiner[T] extends Combiner[T, ParVector[ sz = 0 } - def result: ParVector[T] = { + def result(): ParVector[T] = { val rvb = new VectorBuilder[T] for (vb <- vectors) { rvb ++= vb.result diff --git a/core/src/main/scala/scala/collection/parallel/immutable/package.scala b/core/src/main/scala/scala/collection/parallel/immutable/package.scala index 2bc095c5..43a5d119 100644 --- a/core/src/main/scala/scala/collection/parallel/immutable/package.scala +++ b/core/src/main/scala/scala/collection/parallel/immutable/package.scala @@ -39,7 +39,7 @@ package immutable { class ParIterator(var i: Int = 0, val until: Int = length, elem: T = self.elem) extends SeqSplitter[T] { def remaining = until - i def hasNext = i < until - def next = { i += 1; elem } + def next() = { i += 1; elem } def dup = new ParIterator(i, until, elem) def psplit(sizes: Int*) = { val incr = sizes.scanLeft(0)(_ + _) diff --git a/core/src/main/scala/scala/collection/parallel/mutable/LazyCombiner.scala b/core/src/main/scala/scala/collection/parallel/mutable/LazyCombiner.scala index 1f63c7fb..ad5869a4 100644 --- a/core/src/main/scala/scala/collection/parallel/mutable/LazyCombiner.scala +++ b/core/src/main/scala/scala/collection/parallel/mutable/LazyCombiner.scala @@ -31,7 +31,7 @@ trait LazyCombiner[Elem, +To, Buff <: Growable[Elem] with Sizing] extends Combin val chain: ArrayBuffer[Buff] val lastbuff = chain.last def addOne(elem: Elem) = { lastbuff += elem; this } - def result: To = allocateAndCopy + def result(): To = allocateAndCopy def clear() = { chain.clear() } def combine[N <: Elem, NewTo >: To](other: Combiner[N, NewTo]): Combiner[N, NewTo] = if (this ne other) { if (other.isInstanceOf[LazyCombiner[_, _, _]]) { diff --git a/core/src/main/scala/scala/collection/parallel/mutable/ParArray.scala b/core/src/main/scala/scala/collection/parallel/mutable/ParArray.scala index a6d023d7..5df6da66 100644 --- a/core/src/main/scala/scala/collection/parallel/mutable/ParArray.scala +++ b/core/src/main/scala/scala/collection/parallel/mutable/ParArray.scala @@ -42,8 +42,6 @@ import scala.reflect.ClassTag * * @tparam T type of the elements in the array * - * @author Aleksandar Prokopec - * @since 2.9 * @see [[http://docs.scala-lang.org/overviews/parallel-collections/concrete-parallel-collections.html#parallel_array Scala's Parallel Collections Library overview]] * section on `ParArray` for more information. * @@ -95,7 +93,7 @@ self => extends SeqSplitter[T] { def hasNext = i < until - def next = { + def next() = { val elem = arr(i) i += 1 elem.asInstanceOf[T] @@ -590,7 +588,7 @@ self => val targarrseq = ArraySeq.make(targetarr).asInstanceOf[ArraySeq[S]] // fill it in parallel - tasksupport.executeAndWaitResult(new Map[S](f, targetarr, 0, length)) + tasksupport.executeAndWaitResult(new ParArrayMap[S](f, targetarr, 0, length)) // wrap it into a parallel array new ParArray[S](targarrseq) @@ -652,7 +650,7 @@ self => } } - class Map[S](f: T => S, targetarr: Array[Any], offset: Int, howmany: Int) extends Task[Unit, Map[S]] { + class ParArrayMap[S](f: T => S, targetarr: Array[Any], offset: Int, howmany: Int) extends Task[Unit, ParArrayMap[S]] { var result = () def leaf(prev: Option[Unit]) = { @@ -667,7 +665,7 @@ self => } def split = { val fp = howmany / 2 - List(new Map(f, targetarr, offset, fp), new Map(f, targetarr, offset + fp, howmany - fp)) + List(new ParArrayMap(f, targetarr, offset, fp), new ParArrayMap(f, targetarr, offset + fp, howmany - fp)) } def shouldSplitFurther = howmany > scala.collection.parallel.thresholdFromSize(length, tasksupport.parallelismLevel) } diff --git a/core/src/main/scala/scala/collection/parallel/mutable/ParFlatHashTable.scala b/core/src/main/scala/scala/collection/parallel/mutable/ParFlatHashTable.scala index 86e92637..7b1d212b 100644 --- a/core/src/main/scala/scala/collection/parallel/mutable/ParFlatHashTable.scala +++ b/core/src/main/scala/scala/collection/parallel/mutable/ParFlatHashTable.scala @@ -22,7 +22,6 @@ import scala.collection.parallel.IterableSplitter * @define coll table * @define Coll `ParFlatHashTable` * - * @author Aleksandar Prokopec */ trait ParFlatHashTable[T] extends scala.collection.mutable.FlatHashTable[T] { diff --git a/core/src/main/scala/scala/collection/parallel/mutable/ParHashMap.scala b/core/src/main/scala/scala/collection/parallel/mutable/ParHashMap.scala index a3834141..ca83e628 100644 --- a/core/src/main/scala/scala/collection/parallel/mutable/ParHashMap.scala +++ b/core/src/main/scala/scala/collection/parallel/mutable/ParHashMap.scala @@ -32,7 +32,6 @@ import scala.collection.parallel.Task * @define Coll `ParHashMap` * @define coll parallel hash map * - * @author Aleksandar Prokopec * @see [[http://docs.scala-lang.org/overviews/parallel-collections/concrete-parallel-collections.html#parallel_hash_tables Scala's Parallel Collections Library overview]] * section on Parallel Hash Tables for more information. */ diff --git a/core/src/main/scala/scala/collection/parallel/mutable/ParHashSet.scala b/core/src/main/scala/scala/collection/parallel/mutable/ParHashSet.scala index 8f15ec5f..6ec4c16a 100644 --- a/core/src/main/scala/scala/collection/parallel/mutable/ParHashSet.scala +++ b/core/src/main/scala/scala/collection/parallel/mutable/ParHashSet.scala @@ -33,7 +33,6 @@ import scala.collection.parallel.Task * @define Coll `ParHashSet` * @define coll parallel hash set * - * @author Aleksandar Prokopec * @see [[http://docs.scala-lang.org/overviews/parallel-collections/concrete-parallel-collections.html#parallel_hash_tables Scala's Parallel Collections Library overview]] * section on Parallel Hash Tables for more information. */ @@ -143,7 +142,7 @@ with scala.collection.mutable.FlatHashTable.HashUtils[T] { this } - def result: ParHashSet[T] = { + def result(): ParHashSet[T] = { val contents = if (size >= ParHashSetCombiner.numblocks * sizeMapBucketSize) parPopulate else seqPopulate new ParHashSet(contents) } diff --git a/core/src/main/scala/scala/collection/parallel/mutable/ParIterable.scala b/core/src/main/scala/scala/collection/parallel/mutable/ParIterable.scala index 450f0a14..cbf74fbc 100644 --- a/core/src/main/scala/scala/collection/parallel/mutable/ParIterable.scala +++ b/core/src/main/scala/scala/collection/parallel/mutable/ParIterable.scala @@ -24,9 +24,6 @@ import scala.collection.parallel.{ ParIterableLike, Combiner } * $sideeffects * * @tparam T the element type of the collection - * - * @author Aleksandar Prokopec - * @since 2.9 */ trait ParIterable[T] extends scala.collection.parallel.ParIterable[T] with GenericParTemplate[T, ParIterable] diff --git a/core/src/main/scala/scala/collection/parallel/mutable/ParMap.scala b/core/src/main/scala/scala/collection/parallel/mutable/ParMap.scala index fd621955..ccd9996f 100644 --- a/core/src/main/scala/scala/collection/parallel/mutable/ParMap.scala +++ b/core/src/main/scala/scala/collection/parallel/mutable/ParMap.scala @@ -23,9 +23,6 @@ import scala.collection.parallel.Combiner * * @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 parallel.ParMap[K, V] diff --git a/core/src/main/scala/scala/collection/parallel/mutable/ParMapLike.scala b/core/src/main/scala/scala/collection/parallel/mutable/ParMapLike.scala index 38655f4d..88ebf979 100644 --- a/core/src/main/scala/scala/collection/parallel/mutable/ParMapLike.scala +++ b/core/src/main/scala/scala/collection/parallel/mutable/ParMapLike.scala @@ -15,7 +15,6 @@ package collection.parallel package mutable import scala.collection.mutable.Cloneable -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. @@ -26,9 +25,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, diff --git a/core/src/main/scala/scala/collection/parallel/mutable/ParSet.scala b/core/src/main/scala/scala/collection/parallel/mutable/ParSet.scala index 545523f9..a264dfa4 100644 --- a/core/src/main/scala/scala/collection/parallel/mutable/ParSet.scala +++ b/core/src/main/scala/scala/collection/parallel/mutable/ParSet.scala @@ -17,8 +17,6 @@ import scala.collection.generic._ import scala.collection.parallel.Combiner /** A mutable variant of `ParSet`. - * - * @author Aleksandar Prokopec */ trait ParSet[T] extends ParIterable[T] diff --git a/core/src/main/scala/scala/collection/parallel/mutable/ParSetLike.scala b/core/src/main/scala/scala/collection/parallel/mutable/ParSetLike.scala index a27654e5..f8f2b3c7 100644 --- a/core/src/main/scala/scala/collection/parallel/mutable/ParSetLike.scala +++ b/core/src/main/scala/scala/collection/parallel/mutable/ParSetLike.scala @@ -15,7 +15,6 @@ package collection package parallel.mutable import scala.collection.mutable.Cloneable -import scala.language.higherKinds import scala.collection.mutable.Growable import scala.collection.mutable.Shrinkable @@ -27,9 +26,6 @@ import scala.collection.mutable.Shrinkable * @tparam T the element type of the set * @define Coll `mutable.ParSet` * @define coll mutable parallel set - * - * @author Aleksandar Prokopec - * @since 2.9 */ trait ParSetLike[T, +CC[X] <: ParIterable[X], diff --git a/core/src/main/scala/scala/collection/parallel/mutable/ParTrieMap.scala b/core/src/main/scala/scala/collection/parallel/mutable/ParTrieMap.scala index 5c21c13b..c9f5cf78 100644 --- a/core/src/main/scala/scala/collection/parallel/mutable/ParTrieMap.scala +++ b/core/src/main/scala/scala/collection/parallel/mutable/ParTrieMap.scala @@ -32,8 +32,6 @@ import scala.collection.concurrent.TrieMapIterator * to create the splitter. This means that parallel bulk operations can be * called concurrently with the modifications. * - * @author Aleksandar Prokopec - * @since 2.10 * @see [[http://docs.scala-lang.org/overviews/parallel-collections/concrete-parallel-collections.html#parallel_concurrent_tries Scala's Parallel Collections Library overview]] * section on `ParTrieMap` for more information. */ @@ -58,7 +56,7 @@ extends ParMap[K, V] override def clear() = ctrie.clear() - def result = this + def result() = this def get(key: K): Option[V] = ctrie.get(key) diff --git a/core/src/main/scala/scala/collection/parallel/mutable/UnrolledParArrayCombiner.scala b/core/src/main/scala/scala/collection/parallel/mutable/UnrolledParArrayCombiner.scala index b6a63c8e..c2bdb442 100644 --- a/core/src/main/scala/scala/collection/parallel/mutable/UnrolledParArrayCombiner.scala +++ b/core/src/main/scala/scala/collection/parallel/mutable/UnrolledParArrayCombiner.scala @@ -31,7 +31,7 @@ extends Combiner[T, ParArray[T]] { this } - def result = { + def result() = { val array = new Array[Any](size) val arrayseq = ArraySeq.make(array).asInstanceOf[ArraySeq[T]] diff --git a/core/src/main/scala/scala/collection/parallel/package.scala b/core/src/main/scala/scala/collection/parallel/package.scala index 3ea99b31..65fc8da4 100644 --- a/core/src/main/scala/scala/collection/parallel/package.scala +++ b/core/src/main/scala/scala/collection/parallel/package.scala @@ -113,7 +113,7 @@ package parallel { extends IterableSplitter[T] { signalDelegate = _sigdel def hasNext = index < until - def next = { + def next() = { val r = buffer(index) index += 1 r diff --git a/testmacros/src/main/scala/testutil/ShouldNotTypecheck.scala b/testmacros/src/main/scala/testutil/ShouldNotTypecheck.scala index 97c6443b..bed2bcd0 100644 --- a/testmacros/src/main/scala/testutil/ShouldNotTypecheck.scala +++ b/testmacros/src/main/scala/testutil/ShouldNotTypecheck.scala @@ -15,7 +15,6 @@ package testutil import scala.language.experimental.macros import scala.reflect.macros.blackbox.Context import scala.reflect.macros.TypecheckException -import scala.util.control.NonFatal import java.util.regex.Pattern /**