From d19cc71bb0a3bb76c83065cc2b85fa826df54f16 Mon Sep 17 00:00:00 2001 From: simerplaha Date: Thu, 18 Nov 2021 01:20:01 +1100 Subject: [PATCH] fix 2.13 build --- core-cache/src/test/scala/swaydb/core/cache/CacheSpec.scala | 1 + core-cache/src/test/scala/swaydb/core/cache/LazySpec.scala | 1 + .../test/scala/swaydb/core/actor/ActorPerformanceSpec.scala | 1 + .../test/scala/swaydb/core/cache/CachePerformanceSpec.scala | 4 +++- .../src/test/scala/swaydb/core/queue/VolatileQueueSpec.scala | 1 + core/src/test/scala/swaydb/core/CommonAssertions.scala | 1 + core/src/test/scala/swaydb/core/actor/ActorSpec.scala | 1 + .../test/scala/swaydb/core/file/sweeper/FileSweeperSpec.scala | 1 + .../swaydb/core/segment/block/SegmentBlockCacheSpec.scala | 1 + .../core/segment/block/sortedindex/SortedIndexBlockSpec.scala | 3 ++- .../swaydb/core/segment/block/values/ValuesBlockSpec.scala | 1 + core/src/test/scala/swaydb/core/util/IDGeneratorSpec.scala | 2 ++ slice/src/main/scala-2.13/swaydb/slice/SliceBuildFrom.scala | 2 +- slice/src/main/scala-2.13/swaydb/slice/SliceFactory.scala | 2 +- swaydb/src/test/scala/swaydb/api/SwayDBFunctionSpec.scala | 1 + swaydb/src/test/scala/swaydb/api/queue/QueueSpec.scala | 1 + testkit/src/main/scala/swaydb/testkit/RunThis.scala | 1 + 17 files changed, 21 insertions(+), 4 deletions(-) diff --git a/core-cache/src/test/scala/swaydb/core/cache/CacheSpec.scala b/core-cache/src/test/scala/swaydb/core/cache/CacheSpec.scala index cc0a51060..c6d1192b9 100644 --- a/core-cache/src/test/scala/swaydb/core/cache/CacheSpec.scala +++ b/core-cache/src/test/scala/swaydb/core/cache/CacheSpec.scala @@ -26,6 +26,7 @@ import swaydb.testkit.RunThis._ import swaydb.{Error, IO} import scala.annotation.tailrec +import scala.collection.parallel.CollectionConverters._ import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.Future import scala.concurrent.duration._ diff --git a/core-cache/src/test/scala/swaydb/core/cache/LazySpec.scala b/core-cache/src/test/scala/swaydb/core/cache/LazySpec.scala index 19dd29c6b..c3c78ddd6 100644 --- a/core-cache/src/test/scala/swaydb/core/cache/LazySpec.scala +++ b/core-cache/src/test/scala/swaydb/core/cache/LazySpec.scala @@ -23,6 +23,7 @@ import swaydb.IO import swaydb.effect.Base._ import swaydb.testkit.RunThis._ +import scala.collection.parallel.CollectionConverters._ import scala.concurrent.duration._ import scala.util.Random diff --git a/core-performance/src/test/scala/swaydb/core/actor/ActorPerformanceSpec.scala b/core-performance/src/test/scala/swaydb/core/actor/ActorPerformanceSpec.scala index 44b2fa0b2..d9f731715 100644 --- a/core-performance/src/test/scala/swaydb/core/actor/ActorPerformanceSpec.scala +++ b/core-performance/src/test/scala/swaydb/core/actor/ActorPerformanceSpec.scala @@ -23,6 +23,7 @@ import swaydb.core.TestExecutionContext import swaydb.{Actor, ActorRef, Benchmark} import java.util.concurrent.ConcurrentLinkedQueue +import scala.collection.parallel.CollectionConverters._ import scala.concurrent.duration._ class ActorPerformanceSpec extends AnyWordSpec with Matchers { diff --git a/core-performance/src/test/scala/swaydb/core/cache/CachePerformanceSpec.scala b/core-performance/src/test/scala/swaydb/core/cache/CachePerformanceSpec.scala index 533965bd0..c3db554b5 100644 --- a/core-performance/src/test/scala/swaydb/core/cache/CachePerformanceSpec.scala +++ b/core-performance/src/test/scala/swaydb/core/cache/CachePerformanceSpec.scala @@ -19,10 +19,12 @@ package swaydb.core.cache import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec import swaydb.Error.Segment.ExceptionHandler -import swaydb.{Benchmark, IO} import swaydb.core.CommonAssertions._ import swaydb.effect.Reserve import swaydb.testkit.RunThis._ +import swaydb.{Benchmark, IO} + +import scala.collection.parallel.CollectionConverters._ class CachePerformanceSpec extends AnyWordSpec with Matchers { diff --git a/core-queue/src/test/scala/swaydb/core/queue/VolatileQueueSpec.scala b/core-queue/src/test/scala/swaydb/core/queue/VolatileQueueSpec.scala index e96e328ad..4dfa8b747 100644 --- a/core-queue/src/test/scala/swaydb/core/queue/VolatileQueueSpec.scala +++ b/core-queue/src/test/scala/swaydb/core/queue/VolatileQueueSpec.scala @@ -20,6 +20,7 @@ import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec import swaydb.testkit.RunThis._ +import scala.collection.parallel.CollectionConverters._ import scala.concurrent.Future import scala.concurrent.duration.DurationInt import scala.util.Random diff --git a/core/src/test/scala/swaydb/core/CommonAssertions.scala b/core/src/test/scala/swaydb/core/CommonAssertions.scala index 86b8e0d10..1b7fe1f3d 100644 --- a/core/src/test/scala/swaydb/core/CommonAssertions.scala +++ b/core/src/test/scala/swaydb/core/CommonAssertions.scala @@ -66,6 +66,7 @@ import swaydb.{Bag, Error, Glass, IO} import java.nio.file.Paths import scala.annotation.tailrec import scala.collection.mutable.ListBuffer +import scala.collection.parallel.CollectionConverters._ import scala.concurrent.ExecutionContext import scala.concurrent.duration._ import scala.reflect.ClassTag diff --git a/core/src/test/scala/swaydb/core/actor/ActorSpec.scala b/core/src/test/scala/swaydb/core/actor/ActorSpec.scala index 03d913f77..5f7d0bc82 100644 --- a/core/src/test/scala/swaydb/core/actor/ActorSpec.scala +++ b/core/src/test/scala/swaydb/core/actor/ActorSpec.scala @@ -27,6 +27,7 @@ import swaydb.testkit.RunThis._ import java.util.concurrent.{ConcurrentLinkedDeque, ConcurrentSkipListSet} import scala.collection.mutable.ListBuffer +import scala.collection.parallel.CollectionConverters._ import scala.concurrent.duration._ import scala.concurrent.{Await, Future, Promise} import scala.jdk.CollectionConverters._ diff --git a/core/src/test/scala/swaydb/core/file/sweeper/FileSweeperSpec.scala b/core/src/test/scala/swaydb/core/file/sweeper/FileSweeperSpec.scala index 21c97e2e0..118693a0b 100644 --- a/core/src/test/scala/swaydb/core/file/sweeper/FileSweeperSpec.scala +++ b/core/src/test/scala/swaydb/core/file/sweeper/FileSweeperSpec.scala @@ -34,6 +34,7 @@ import swaydb.{ActorConfig, _} import java.nio.file.{Path, Paths} import java.util.concurrent.ConcurrentSkipListSet import scala.collection.mutable.ListBuffer +import scala.collection.parallel.CollectionConverters._ import scala.concurrent.duration._ class FileSweeperSpec extends TestBase with MockFactory { diff --git a/core/src/test/scala/swaydb/core/segment/block/SegmentBlockCacheSpec.scala b/core/src/test/scala/swaydb/core/segment/block/SegmentBlockCacheSpec.scala index 9884e00a5..3d0038bde 100644 --- a/core/src/test/scala/swaydb/core/segment/block/SegmentBlockCacheSpec.scala +++ b/core/src/test/scala/swaydb/core/segment/block/SegmentBlockCacheSpec.scala @@ -27,6 +27,7 @@ import swaydb.testkit.RunThis._ import swaydb.utils.StorageUnits._ import java.util.concurrent.ConcurrentLinkedQueue +import scala.collection.parallel.CollectionConverters._ import scala.concurrent.duration._ import scala.jdk.CollectionConverters._ import scala.util.Random diff --git a/core/src/test/scala/swaydb/core/segment/block/sortedindex/SortedIndexBlockSpec.scala b/core/src/test/scala/swaydb/core/segment/block/sortedindex/SortedIndexBlockSpec.scala index a6df3812f..820c545c7 100644 --- a/core/src/test/scala/swaydb/core/segment/block/sortedindex/SortedIndexBlockSpec.scala +++ b/core/src/test/scala/swaydb/core/segment/block/sortedindex/SortedIndexBlockSpec.scala @@ -17,7 +17,6 @@ package swaydb.core.segment.block.sortedindex import org.scalatest.PrivateMethodTester -import swaydb.{Benchmark, Compression} import swaydb.config.compression.{LZ4Compressor, LZ4Decompressor, LZ4Instance} import swaydb.config.{PrefixCompression, UncompressedBlockInfo} import swaydb.core.CommonAssertions._ @@ -31,8 +30,10 @@ import swaydb.core.segment.data.merge.stats.MergeStats import swaydb.core.segment.io.SegmentReadIO import swaydb.slice.order.KeyOrder import swaydb.testkit.RunThis._ +import swaydb.{Benchmark, Compression} import scala.collection.mutable.ListBuffer +import scala.collection.parallel.CollectionConverters._ class SortedIndexBlockSpec extends TestBase with PrivateMethodTester { diff --git a/core/src/test/scala/swaydb/core/segment/block/values/ValuesBlockSpec.scala b/core/src/test/scala/swaydb/core/segment/block/values/ValuesBlockSpec.scala index ecdd4ae3e..95c7e700d 100644 --- a/core/src/test/scala/swaydb/core/segment/block/values/ValuesBlockSpec.scala +++ b/core/src/test/scala/swaydb/core/segment/block/values/ValuesBlockSpec.scala @@ -30,6 +30,7 @@ import swaydb.slice.Slice import swaydb.testkit.RunThis._ import scala.collection.mutable.ListBuffer +import scala.collection.parallel.CollectionConverters._ import scala.concurrent.duration._ class ValuesBlockSpec extends TestBase { diff --git a/core/src/test/scala/swaydb/core/util/IDGeneratorSpec.scala b/core/src/test/scala/swaydb/core/util/IDGeneratorSpec.scala index a74308d38..82716767b 100644 --- a/core/src/test/scala/swaydb/core/util/IDGeneratorSpec.scala +++ b/core/src/test/scala/swaydb/core/util/IDGeneratorSpec.scala @@ -19,6 +19,8 @@ package swaydb.core.util import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers +import scala.collection.parallel.CollectionConverters._ + class IDGeneratorSpec extends AnyFlatSpec with Matchers { it should "always return new incremental ids when access concurrently" in { diff --git a/slice/src/main/scala-2.13/swaydb/slice/SliceBuildFrom.scala b/slice/src/main/scala-2.13/swaydb/slice/SliceBuildFrom.scala index a8dbbbe86..04c646b59 100644 --- a/slice/src/main/scala-2.13/swaydb/slice/SliceBuildFrom.scala +++ b/slice/src/main/scala-2.13/swaydb/slice/SliceBuildFrom.scala @@ -18,7 +18,7 @@ package swaydb.slice import com.typesafe.scalalogging.LazyLogging -import scala.collection.mutable +import scala.collection.{BuildFrom, mutable} import scala.reflect.ClassTag /** diff --git a/slice/src/main/scala-2.13/swaydb/slice/SliceFactory.scala b/slice/src/main/scala-2.13/swaydb/slice/SliceFactory.scala index ad4a15cce..6a562e38e 100644 --- a/slice/src/main/scala-2.13/swaydb/slice/SliceFactory.scala +++ b/slice/src/main/scala-2.13/swaydb/slice/SliceFactory.scala @@ -17,7 +17,7 @@ package swaydb.slice import scala.collection.compat.IterableOnce -import scala.collection.mutable +import scala.collection.{ClassTagIterableFactory, mutable} import scala.reflect.ClassTag class SliceFactory(maxSize: Int) extends ClassTagIterableFactory[Slice] { diff --git a/swaydb/src/test/scala/swaydb/api/SwayDBFunctionSpec.scala b/swaydb/src/test/scala/swaydb/api/SwayDBFunctionSpec.scala index b1c3987b8..68816ff86 100644 --- a/swaydb/src/test/scala/swaydb/api/SwayDBFunctionSpec.scala +++ b/swaydb/src/test/scala/swaydb/api/SwayDBFunctionSpec.scala @@ -29,6 +29,7 @@ import swaydb.serializers.Serializer import swaydb.testkit.RunThis._ import swaydb.{Apply, IO, Prepare, PureFunction, StorageByteImplicits} +import scala.collection.parallel.CollectionConverters._ import scala.concurrent.duration.DurationInt sealed trait Key diff --git a/swaydb/src/test/scala/swaydb/api/queue/QueueSpec.scala b/swaydb/src/test/scala/swaydb/api/queue/QueueSpec.scala index 39d2bbb60..26ef45d7c 100644 --- a/swaydb/src/test/scala/swaydb/api/queue/QueueSpec.scala +++ b/swaydb/src/test/scala/swaydb/api/queue/QueueSpec.scala @@ -23,6 +23,7 @@ import swaydb.serializers.Default._ import swaydb.{Benchmark, Glass, Queue} import java.util.concurrent.ConcurrentLinkedQueue +import scala.collection.parallel.CollectionConverters._ import scala.concurrent.duration._ import scala.jdk.CollectionConverters._ import scala.util.Random diff --git a/testkit/src/main/scala/swaydb/testkit/RunThis.scala b/testkit/src/main/scala/swaydb/testkit/RunThis.scala index 2cca178ab..4af3c414c 100644 --- a/testkit/src/main/scala/swaydb/testkit/RunThis.scala +++ b/testkit/src/main/scala/swaydb/testkit/RunThis.scala @@ -18,6 +18,7 @@ package swaydb.testkit import org.scalatest.concurrent.Eventually +import scala.collection.parallel.CollectionConverters._ import scala.concurrent.duration.{Deadline, FiniteDuration, _} import scala.concurrent.{Await, ExecutionContext, Future} import scala.util.Random