diff --git a/bench/src/test/scala/benchmark/fpbenchmarks.scala b/bench/src/test/scala/com/phaller/rasync/bench/fpbenchmarks.scala similarity index 97% rename from bench/src/test/scala/benchmark/fpbenchmarks.scala rename to bench/src/test/scala/com/phaller/rasync/bench/fpbenchmarks.scala index 06e12c7..e3252b5 100644 --- a/bench/src/test/scala/benchmark/fpbenchmarks.scala +++ b/bench/src/test/scala/com/phaller/rasync/bench/fpbenchmarks.scala @@ -1,3 +1,6 @@ +package com.phaller.rasync +package bench + import scala.concurrent.Promise import scala.annotation.tailrec import org.scalameter.api._ diff --git a/bench/src/test/scala/benchmark/rabenchmarks.scala b/bench/src/test/scala/com/phaller/rasync/bench/rabenchmarks.scala similarity index 98% rename from bench/src/test/scala/benchmark/rabenchmarks.scala rename to bench/src/test/scala/com/phaller/rasync/bench/rabenchmarks.scala index d2cdcc0..ce73e17 100644 --- a/bench/src/test/scala/benchmark/rabenchmarks.scala +++ b/bench/src/test/scala/com/phaller/rasync/bench/rabenchmarks.scala @@ -1,4 +1,5 @@ -package cell +package com.phaller.rasync +package bench import lattice.{ Lattice, NaturalNumberLattice, NaturalNumberKey } diff --git a/core/src/main/scala/cell/Backoff.scala b/core/src/main/scala/com/phaller/rasync/Backoff.scala similarity index 98% rename from core/src/main/scala/cell/Backoff.scala rename to core/src/main/scala/com/phaller/rasync/Backoff.scala index 3ac0c74..945c6a5 100644 --- a/core/src/main/scala/cell/Backoff.scala +++ b/core/src/main/scala/com/phaller/rasync/Backoff.scala @@ -1,4 +1,4 @@ -package cell +package com.phaller.rasync // Exponential backoff // Taken, and adapted from ChemistrySet, see: https://github.com/aturon/ChemistrySet diff --git a/core/src/main/scala/cell/Cell.scala b/core/src/main/scala/com/phaller/rasync/Cell.scala similarity index 91% rename from core/src/main/scala/cell/Cell.scala rename to core/src/main/scala/com/phaller/rasync/Cell.scala index 44b068d..27d9525 100644 --- a/core/src/main/scala/cell/Cell.scala +++ b/core/src/main/scala/com/phaller/rasync/Cell.scala @@ -1,4 +1,4 @@ -package cell +package com.phaller.rasync import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.{ CountDownLatch, ExecutionException } @@ -8,7 +8,7 @@ import scala.util.{ Failure, Success, Try } import lattice.{ DefaultKey, Key, Updater, NotMonotonicException, PartialOrderingWithBottom } trait Cell[K <: Key[V], V] { - private[cell] val completer: CellCompleter[K, V] + private[rasync] val completer: CellCompleter[K, V] def key: K @@ -82,31 +82,31 @@ trait Cell[K <: Key[V], V] { // internal API // Schedules execution of `callback` when next intermediate result is available. - private[cell] def onNext[U](callback: Try[V] => U): Unit //(implicit context: ExecutionContext): Unit + private[rasync] def onNext[U](callback: Try[V] => U): Unit //(implicit context: ExecutionContext): Unit // Schedules execution of `callback` when completed with final result. - private[cell] def onComplete[U](callback: Try[V] => U): Unit + private[rasync] def onComplete[U](callback: Try[V] => U): Unit // Only used in tests. - private[cell] def waitUntilNoDeps(): Unit + private[rasync] def waitUntilNoDeps(): Unit // Only used in tests. - private[cell] def waitUntilNoNextDeps(): Unit + private[rasync] def waitUntilNoNextDeps(): Unit - private[cell] def tasksActive(): Boolean - private[cell] def setTasksActive(): Boolean + private[rasync] def tasksActive(): Boolean + private[rasync] def setTasksActive(): Boolean - private[cell] def numTotalDependencies: Int - private[cell] def numNextDependencies: Int - private[cell] def numCompleteDependencies: Int + private[rasync] def numTotalDependencies: Int + private[rasync] def numNextDependencies: Int + private[rasync] def numCompleteDependencies: Int - private[cell] def numNextCallbacks: Int - private[cell] def numCompleteCallbacks: Int + private[rasync] def numNextCallbacks: Int + private[rasync] def numCompleteCallbacks: Int - private[cell] def addCompleteCallback(callback: CompleteCallbackRunnable[K, V], cell: Cell[K, V]): Unit - private[cell] def addNextCallback(callback: NextCallbackRunnable[K, V], cell: Cell[K, V]): Unit + private[rasync] def addCompleteCallback(callback: CompleteCallbackRunnable[K, V], cell: Cell[K, V]): Unit + private[rasync] def addNextCallback(callback: NextCallbackRunnable[K, V], cell: Cell[K, V]): Unit - private[cell] def resolveWithValue(value: V): Unit + private[rasync] def resolveWithValue(value: V): Unit def cellDependencies: Seq[Cell[K, V]] def totalCellDependencies: Seq[Cell[K, V]] def isIndependent(): Boolean @@ -114,8 +114,8 @@ trait Cell[K <: Key[V], V] { def removeCompleteCallbacks(cell: Cell[K, V]): Unit def removeNextCallbacks(cell: Cell[K, V]): Unit - private[cell] def removeAllCallbacks(cell: Cell[K, V]): Unit - private[cell] def removeAllCallbacks(cells: Seq[Cell[K, V]]): Unit + private[rasync] def removeAllCallbacks(cell: Cell[K, V]): Unit + private[rasync] def removeAllCallbacks(cells: Seq[Cell[K, V]]): Unit def isADependee(): Boolean } @@ -261,19 +261,19 @@ private class CellImpl[K <: Key[V], V](pool: HandlerPool, val key: K, updater: U pre.asInstanceOf[State[K, V]] } - override private[cell] def numCompleteDependencies: Int = { + override private[rasync] def numCompleteDependencies: Int = { val current = currentState() if (current == null) 0 else current.completeDeps.size } - override private[cell] def numNextDependencies: Int = { + override private[rasync] def numNextDependencies: Int = { val current = currentState() if (current == null) 0 else current.nextDeps.size } - override private[cell] def numTotalDependencies: Int = { + override private[rasync] def numTotalDependencies: Int = { val current = currentState() if (current == null) 0 else (current.completeDeps ++ current.nextDeps).size @@ -329,7 +329,7 @@ private class CellImpl[K <: Key[V], V](pool: HandlerPool, val key: K, updater: U } } - override private[cell] def resolveWithValue(value: V): Unit = { + override private[rasync] def resolveWithValue(value: V): Unit = { this.putFinal(value) } @@ -419,11 +419,11 @@ private class CellImpl[K <: Key[V], V](pool: HandlerPool, val key: K, updater: U } } - override private[cell] def addCompleteCallback(callback: CompleteCallbackRunnable[K, V], cell: Cell[K, V]): Unit = { + override private[rasync] def addCompleteCallback(callback: CompleteCallbackRunnable[K, V], cell: Cell[K, V]): Unit = { dispatchOrAddCallback(callback) } - override private[cell] def addNextCallback(callback: NextCallbackRunnable[K, V], cell: Cell[K, V]): Unit = { + override private[rasync] def addNextCallback(callback: NextCallbackRunnable[K, V], cell: Cell[K, V]): Unit = { dispatchOrAddNextCallback(callback) } @@ -442,7 +442,7 @@ private class CellImpl[K <: Key[V], V](pool: HandlerPool, val key: K, updater: U * if it fails. */ @tailrec - private[cell] final def tryNewState(value: V): Boolean = { + private[rasync] final def tryNewState(value: V): Boolean = { state.get() match { case finalRes: Try[_] => // completed with final result already try { @@ -532,7 +532,7 @@ private class CellImpl[K <: Key[V], V](pool: HandlerPool, val key: K, updater: U } @tailrec - override private[cell] final def removeDep(cell: Cell[K, V]): Unit = { + override private[rasync] final def removeDep(cell: Cell[K, V]): Unit = { state.get() match { case pre: State[_, _] => val current = pre.asInstanceOf[State[K, V]] @@ -549,7 +549,7 @@ private class CellImpl[K <: Key[V], V](pool: HandlerPool, val key: K, updater: U } @tailrec - override private[cell] final def removeNextDep(cell: Cell[K, V]): Unit = { + override private[rasync] final def removeNextDep(cell: Cell[K, V]): Unit = { state.get() match { case pre: State[_, _] => val current = pre.asInstanceOf[State[K, V]] @@ -594,7 +594,7 @@ private class CellImpl[K <: Key[V], V](pool: HandlerPool, val key: K, updater: U } @tailrec - override private[cell] final def removeAllCallbacks(cell: Cell[K, V]): Unit = { + override private[rasync] final def removeAllCallbacks(cell: Cell[K, V]): Unit = { state.get() match { case pre: State[_, _] => val current = pre.asInstanceOf[State[K, V]] @@ -609,7 +609,7 @@ private class CellImpl[K <: Key[V], V](pool: HandlerPool, val key: K, updater: U } @tailrec - override private[cell] final def removeAllCallbacks(cells: Seq[Cell[K, V]]): Unit = { + override private[rasync] final def removeAllCallbacks(cells: Seq[Cell[K, V]]): Unit = { state.get() match { case pre: State[_, _] => val current = pre.asInstanceOf[State[K, V]] @@ -623,15 +623,15 @@ private class CellImpl[K <: Key[V], V](pool: HandlerPool, val key: K, updater: U } } - override private[cell] def waitUntilNoDeps(): Unit = { + override private[rasync] def waitUntilNoDeps(): Unit = { nodepslatch.await() } - override private[cell] def waitUntilNoNextDeps(): Unit = { + override private[rasync] def waitUntilNoNextDeps(): Unit = { nonextdepslatch.await() } - override private[cell] def tasksActive() = state.get() match { + override private[rasync] def tasksActive() = state.get() match { case _: Try[_] => false case s: State[_, _] => s.tasksActive } @@ -642,7 +642,7 @@ private class CellImpl[K <: Key[V], V](pool: HandlerPool, val key: K, updater: U * @return Returns true, iff the cell's status changed (i.e. it had not been running before). */ @tailrec - override private[cell] final def setTasksActive(): Boolean = state.get() match { + override private[rasync] final def setTasksActive(): Boolean = state.get() match { case pre: State[_, _] => if (pre.tasksActive) false @@ -656,7 +656,7 @@ private class CellImpl[K <: Key[V], V](pool: HandlerPool, val key: K, updater: U } // Schedules execution of `callback` when next intermediate result is available. - override private[cell] def onNext[U](callback: Try[V] => U): Unit = { + override private[rasync] def onNext[U](callback: Try[V] => U): Unit = { val runnable = new NextConcurrentCallbackRunnable[K, V](pool, null, this, callback) // NULL indicates that no cell is waiting for this callback. dispatchOrAddNextCallback(runnable) } diff --git a/core/src/main/scala/cell/CellCompleter.scala b/core/src/main/scala/com/phaller/rasync/CellCompleter.scala similarity index 84% rename from core/src/main/scala/cell/CellCompleter.scala rename to core/src/main/scala/com/phaller/rasync/CellCompleter.scala index 8d831f2..0d81983 100644 --- a/core/src/main/scala/cell/CellCompleter.scala +++ b/core/src/main/scala/com/phaller/rasync/CellCompleter.scala @@ -1,4 +1,4 @@ -package cell +package com.phaller.rasync import scala.util.Try import lattice.{ DefaultKey, Key, Updater } @@ -13,17 +13,17 @@ trait CellCompleter[K <: Key[V], V] { */ def cell: Cell[K, V] - private[cell] def init: (Cell[K, V]) => Outcome[V] + private[rasync] def init: (Cell[K, V]) => Outcome[V] def putFinal(x: V): Unit def putNext(x: V): Unit def put(x: V, isFinal: Boolean): Unit - private[cell] def tryNewState(value: V): Boolean + private[rasync] def tryNewState(value: V): Boolean def tryComplete(value: Try[V]): Boolean - private[cell] def removeDep(cell: Cell[K, V]): Unit - private[cell] def removeNextDep(cell: Cell[K, V]): Unit + private[rasync] def removeDep(cell: Cell[K, V]): Unit + private[rasync] def removeNextDep(cell: Cell[K, V]): Unit } object CellCompleter { diff --git a/core/src/main/scala/cell/HandlerPool.scala b/core/src/main/scala/com/phaller/rasync/HandlerPool.scala similarity index 98% rename from core/src/main/scala/cell/HandlerPool.scala rename to core/src/main/scala/com/phaller/rasync/HandlerPool.scala index b6e758b..595f279 100644 --- a/core/src/main/scala/cell/HandlerPool.scala +++ b/core/src/main/scala/com/phaller/rasync/HandlerPool.scala @@ -1,4 +1,4 @@ -package cell +package com.phaller.rasync import java.util.concurrent.ForkJoinPool import java.util.concurrent.atomic.AtomicReference @@ -332,7 +332,7 @@ class HandlerPool(parallelism: Int = 8, unhandledExceptionHandler: Throwable => * * @param callback The callback that should be run sequentially to all other sequential callbacks for the dependent cell. */ - private[cell] def scheduleSequentialCallback[K <: Key[V], V](callback: SequentialCallbackRunnable[K, V]): Unit = { + private[rasync] def scheduleSequentialCallback[K <: Key[V], V](callback: SequentialCallbackRunnable[K, V]): Unit = { val dependentCell = callback.dependentCell var success = false var startCallback = false @@ -416,7 +416,7 @@ class HandlerPool(parallelism: Int = 8, unhandledExceptionHandler: Throwable => * * @param cell The cell that is triggered. */ - private[cell] def triggerExecution[K <: Key[V], V](cell: Cell[K, V]): Unit = { + private[rasync] def triggerExecution[K <: Key[V], V](cell: Cell[K, V]): Unit = { if (cell.setTasksActive()) execute(() => { val completer = cell.completer diff --git a/core/src/main/scala/cell/callbackRunnable.scala b/core/src/main/scala/com/phaller/rasync/callbackRunnable.scala similarity index 88% rename from core/src/main/scala/cell/callbackRunnable.scala rename to core/src/main/scala/com/phaller/rasync/callbackRunnable.scala index b5cdcb9..bf1646a 100644 --- a/core/src/main/scala/cell/callbackRunnable.scala +++ b/core/src/main/scala/com/phaller/rasync/callbackRunnable.scala @@ -1,4 +1,4 @@ -package cell +package com.phaller.rasync import lattice.Key @@ -10,7 +10,7 @@ import scala.util.{ Failure, Success, Try } * Run a callback in a handler pool, if a value in a cell changes. * Call execute() to add the callback to the given HandlerPool. */ -private[cell] trait CallbackRunnable[K <: Key[V], V] extends Runnable with OnCompleteRunnable { +private[rasync] trait CallbackRunnable[K <: Key[V], V] extends Runnable with OnCompleteRunnable { /** The handler pool that runs the callback function. */ val pool: HandlerPool @@ -31,7 +31,7 @@ private[cell] trait CallbackRunnable[K <: Key[V], V] extends Runnable with OnCom * Run a callback concurrently, if a value in a cell changes. * Call execute() to add the callback to the given HandlerPool. */ -private[cell] trait ConcurrentCallbackRunnable[K <: Key[V], V] extends CallbackRunnable[K, V] { +private[rasync] trait ConcurrentCallbackRunnable[K <: Key[V], V] extends CallbackRunnable[K, V] { /** Add this CallbackRunnable to its handler pool such that it is run concurrently. */ def execute(): Unit = try pool.execute(this) @@ -42,7 +42,7 @@ private[cell] trait ConcurrentCallbackRunnable[K <: Key[V], V] extends CallbackR * Run a callback sequentially (for a dependent cell), if a value in another cell changes. * Call execute() to add the callback to the given HandlerPool. */ -private[cell] trait SequentialCallbackRunnable[K <: Key[V], V] extends CallbackRunnable[K, V] { +private[rasync] trait SequentialCallbackRunnable[K <: Key[V], V] extends CallbackRunnable[K, V] { val dependentCell: Cell[K, V] /** @@ -57,7 +57,7 @@ private[cell] trait SequentialCallbackRunnable[K <: Key[V], V] extends CallbackR * A dependency between to cells consisting of a dependent cell(completer), * an other cell and the callback to calculate new values for the dependent cell. */ -private[cell] trait Dependency[K <: Key[V], V] { +private[rasync] trait Dependency[K <: Key[V], V] { val dependentCompleter: CellCompleter[K, V] val otherCell: Cell[K, V] val valueCallback: V => Outcome[V] @@ -70,7 +70,7 @@ private[cell] trait Dependency[K <: Key[V], V] { * @param otherCell Cell that triggers this callback. * @param callback Callback function that is triggered on an onNext event */ -private[cell] abstract class CompleteCallbackRunnable[K <: Key[V], V]( +private[rasync] abstract class CompleteCallbackRunnable[K <: Key[V], V]( override val pool: HandlerPool, override val dependentCell: Cell[K, V], // needed to not call whenNext callback, if whenComplete callback exists. override val otherCell: Cell[K, V], @@ -87,7 +87,7 @@ private[cell] abstract class CompleteCallbackRunnable[K <: Key[V], V]( } } -private[cell] class CompleteConcurrentCallbackRunnable[K <: Key[V], V](override val pool: HandlerPool, override val dependentCell: Cell[K, V], override val otherCell: Cell[K, V], override val callback: Try[V] => Any) +private[rasync] class CompleteConcurrentCallbackRunnable[K <: Key[V], V](override val pool: HandlerPool, override val dependentCell: Cell[K, V], override val otherCell: Cell[K, V], override val callback: Try[V] => Any) extends CompleteCallbackRunnable[K, V](pool, dependentCell, otherCell, callback) with ConcurrentCallbackRunnable[K, V] { } @@ -99,7 +99,7 @@ private[cell] class CompleteConcurrentCallbackRunnable[K <: Key[V], V](override * @param otherCell The cell that `dependentCompleter` depends on. * @param valueCallback Called to retrieve the new value for the dependent cell. */ -private[cell] abstract class CompleteDepRunnable[K <: Key[V], V]( +private[rasync] abstract class CompleteDepRunnable[K <: Key[V], V]( override val pool: HandlerPool, override val dependentCompleter: CellCompleter[K, V], override val otherCell: Cell[K, V], @@ -129,7 +129,7 @@ private[cell] abstract class CompleteDepRunnable[K <: Key[V], V]( * @param otherCell The cell that `dependentCompleter` depends on. * @param valueCallback Called to retrieve the new value for the dependent cell. */ -private[cell] class CompleteConcurrentDepRunnable[K <: Key[V], V]( +private[rasync] class CompleteConcurrentDepRunnable[K <: Key[V], V]( override val pool: HandlerPool, override val dependentCompleter: CellCompleter[K, V], override val otherCell: Cell[K, V], @@ -144,7 +144,7 @@ private[cell] class CompleteConcurrentDepRunnable[K <: Key[V], V]( * @param otherCell The cell that `dependentCompleter` depends on. * @param valueCallback Called to retrieve the new value for the dependent cell. */ -private[cell] class CompleteSequentialDepRunnable[K <: Key[V], V]( +private[rasync] class CompleteSequentialDepRunnable[K <: Key[V], V]( override val pool: HandlerPool, override val dependentCompleter: CellCompleter[K, V], override val otherCell: Cell[K, V], @@ -158,7 +158,7 @@ private[cell] class CompleteSequentialDepRunnable[K <: Key[V], V]( * @param otherCell Cell that triggers this callback. * @param callback Callback function that is triggered on an onNext event */ -private[cell] abstract class NextCallbackRunnable[K <: Key[V], V]( +private[rasync] abstract class NextCallbackRunnable[K <: Key[V], V]( override val pool: HandlerPool, override val dependentCell: Cell[K, V], // needed to not call whenNext callback, if whenComplete callback exists. override val otherCell: Cell[K, V], @@ -176,7 +176,7 @@ private[cell] abstract class NextCallbackRunnable[K <: Key[V], V]( * @param otherCell Cell that triggers this callback. * @param callback Callback function that is triggered on an onNext event */ -private[cell] class NextConcurrentCallbackRunnable[K <: Key[V], V]( +private[rasync] class NextConcurrentCallbackRunnable[K <: Key[V], V]( override val pool: HandlerPool, override val dependentCell: Cell[K, V], override val otherCell: Cell[K, V], @@ -192,7 +192,7 @@ private[cell] class NextConcurrentCallbackRunnable[K <: Key[V], V]( * @param otherCell The cell that `dependentCompleter` depends on. * @param valueCallback Called to retrieve the new value for the dependent cell. */ -private[cell] abstract class NextDepRunnable[K <: Key[V], V]( +private[rasync] abstract class NextDepRunnable[K <: Key[V], V]( override val pool: HandlerPool, override val dependentCompleter: CellCompleter[K, V], override val otherCell: Cell[K, V], @@ -223,7 +223,7 @@ private[cell] abstract class NextDepRunnable[K <: Key[V], V]( * @param otherCell The cell that `dependentCompleter` depends on. * @param valueCallback Called to retrieve the new value for the dependent cell. */ -private[cell] class NextConcurrentDepRunnable[K <: Key[V], V]( +private[rasync] class NextConcurrentDepRunnable[K <: Key[V], V]( override val pool: HandlerPool, override val dependentCompleter: CellCompleter[K, V], override val otherCell: Cell[K, V], @@ -238,9 +238,9 @@ private[cell] class NextConcurrentDepRunnable[K <: Key[V], V]( * @param otherCell The cell that `dependentCompleter` depends on. * @param valueCallback Called to retrieve the new value for the dependent cell. */ -private[cell] class NextSequentialDepRunnable[K <: Key[V], V]( +private[rasync] class NextSequentialDepRunnable[K <: Key[V], V]( override val pool: HandlerPool, override val dependentCompleter: CellCompleter[K, V], override val otherCell: Cell[K, V], override val valueCallback: V => Outcome[V]) extends NextDepRunnable[K, V](pool, dependentCompleter, otherCell, valueCallback) with SequentialCallbackRunnable[K, V] { -} \ No newline at end of file +} diff --git a/core/src/main/scala/immutability/ImmutabilityDemo.scala b/core/src/main/scala/com/phaller/rasync/immutability/ImmutabilityDemo.scala similarity index 98% rename from core/src/main/scala/immutability/ImmutabilityDemo.scala rename to core/src/main/scala/com/phaller/rasync/immutability/ImmutabilityDemo.scala index 92ce457..cd5bfb1 100644 --- a/core/src/main/scala/immutability/ImmutabilityDemo.scala +++ b/core/src/main/scala/com/phaller/rasync/immutability/ImmutabilityDemo.scala @@ -1,4 +1,4 @@ -package immutability; +package com.phaller.rasync.immutability; // The following mutabilities are defined w.r.t. the case that the class hierarchy is closed. diff --git a/core/src/main/scala/lattice/Key.scala b/core/src/main/scala/com/phaller/rasync/lattice/Key.scala similarity index 94% rename from core/src/main/scala/lattice/Key.scala rename to core/src/main/scala/com/phaller/rasync/lattice/Key.scala index ce5ee17..9a386f1 100644 --- a/core/src/main/scala/lattice/Key.scala +++ b/core/src/main/scala/com/phaller/rasync/lattice/Key.scala @@ -1,7 +1,6 @@ +package com.phaller.rasync package lattice -import cell.Cell - trait Key[V] { def resolve[K <: Key[V]](cells: Seq[Cell[K, V]]): Seq[(Cell[K, V], V)] def fallback[K <: Key[V]](cells: Seq[Cell[K, V]]): Seq[(Cell[K, V], V)] diff --git a/core/src/main/scala/lattice/Lattice.scala b/core/src/main/scala/com/phaller/rasync/lattice/Lattice.scala similarity index 98% rename from core/src/main/scala/lattice/Lattice.scala rename to core/src/main/scala/com/phaller/rasync/lattice/Lattice.scala index 329424f..543b7bf 100644 --- a/core/src/main/scala/lattice/Lattice.scala +++ b/core/src/main/scala/com/phaller/rasync/lattice/Lattice.scala @@ -1,3 +1,4 @@ +package com.phaller.rasync package lattice import scala.annotation.implicitNotFound diff --git a/core/src/main/scala/lattice/Lattices/NaturalNumberLattice.scala b/core/src/main/scala/com/phaller/rasync/lattice/NaturalNumberLattice.scala similarity index 95% rename from core/src/main/scala/lattice/Lattices/NaturalNumberLattice.scala rename to core/src/main/scala/com/phaller/rasync/lattice/NaturalNumberLattice.scala index 60ea511..ab9e9ee 100644 --- a/core/src/main/scala/lattice/Lattices/NaturalNumberLattice.scala +++ b/core/src/main/scala/com/phaller/rasync/lattice/NaturalNumberLattice.scala @@ -1,3 +1,4 @@ +package com.phaller.rasync package lattice object NaturalNumberKey extends DefaultKey[Int] diff --git a/core/src/main/scala/lattice/Lattices/StringIntLattice.scala b/core/src/main/scala/com/phaller/rasync/lattice/StringIntLattice.scala similarity index 96% rename from core/src/main/scala/lattice/Lattices/StringIntLattice.scala rename to core/src/main/scala/com/phaller/rasync/lattice/StringIntLattice.scala index 1312427..bdb4b76 100644 --- a/core/src/main/scala/lattice/Lattices/StringIntLattice.scala +++ b/core/src/main/scala/com/phaller/rasync/lattice/StringIntLattice.scala @@ -1,9 +1,8 @@ +package com.phaller.rasync package lattice import scala.language.implicitConversions -import cell.Cell - class StringIntKey(s: String) extends Key[Int] { def resolve[K <: Key[Int]](cells: Seq[Cell[K, Int]]): Seq[(Cell[K, Int], Int)] = { cells.map((cell: Cell[K, Int]) => (cell, 0)) diff --git a/core/src/main/scala/lattice/updater.scala b/core/src/main/scala/com/phaller/rasync/lattice/updater.scala similarity index 98% rename from core/src/main/scala/lattice/updater.scala rename to core/src/main/scala/com/phaller/rasync/lattice/updater.scala index 7cc3cee..b2c241b 100644 --- a/core/src/main/scala/lattice/updater.scala +++ b/core/src/main/scala/com/phaller/rasync/lattice/updater.scala @@ -1,3 +1,4 @@ +package com.phaller.rasync package lattice trait Updater[V] { diff --git a/core/src/main/scala/cell/outcome.scala b/core/src/main/scala/com/phaller/rasync/outcome.scala similarity index 98% rename from core/src/main/scala/cell/outcome.scala rename to core/src/main/scala/com/phaller/rasync/outcome.scala index 5ec033f..a5ce5e2 100644 --- a/core/src/main/scala/cell/outcome.scala +++ b/core/src/main/scala/com/phaller/rasync/outcome.scala @@ -1,4 +1,4 @@ -package cell +package com.phaller.rasync /** * Use this trait in callbacks to return the new value of a cell. diff --git a/core/src/test/scala/Immutability.scala b/core/src/test/scala/com/phaller/rasync/test/Immutability.scala similarity index 98% rename from core/src/test/scala/Immutability.scala rename to core/src/test/scala/com/phaller/rasync/test/Immutability.scala index 4a87def..9096876 100644 --- a/core/src/test/scala/Immutability.scala +++ b/core/src/test/scala/com/phaller/rasync/test/Immutability.scala @@ -1,4 +1,5 @@ -package cell +package com.phaller.rasync +package test import lattice.{ MonotonicUpdater, Key, Lattice } diff --git a/core/src/test/scala/LatticeSuite.scala b/core/src/test/scala/com/phaller/rasync/test/LatticeSuite.scala similarity index 98% rename from core/src/test/scala/LatticeSuite.scala rename to core/src/test/scala/com/phaller/rasync/test/LatticeSuite.scala index 0506db6..863ac07 100644 --- a/core/src/test/scala/LatticeSuite.scala +++ b/core/src/test/scala/com/phaller/rasync/test/LatticeSuite.scala @@ -1,3 +1,6 @@ +package com.phaller.rasync +package test + import lattice.{ Lattice, NaturalNumberLattice, PartialOrderingWithBottom } import org.scalatest.FunSuite diff --git a/core/src/test/scala/cell/LazySuite.scala b/core/src/test/scala/com/phaller/rasync/test/LazySuite.scala similarity index 99% rename from core/src/test/scala/cell/LazySuite.scala rename to core/src/test/scala/com/phaller/rasync/test/LazySuite.scala index 9969534..80d153e 100644 --- a/core/src/test/scala/cell/LazySuite.scala +++ b/core/src/test/scala/com/phaller/rasync/test/LazySuite.scala @@ -1,4 +1,5 @@ -package cell +package com.phaller.rasync +package test import java.util.concurrent.CountDownLatch diff --git a/core/src/test/scala/latticetest/PowerSetLattice.scala b/core/src/test/scala/com/phaller/rasync/test/PowerSetLattice.scala similarity index 98% rename from core/src/test/scala/latticetest/PowerSetLattice.scala rename to core/src/test/scala/com/phaller/rasync/test/PowerSetLattice.scala index f687fae..97d847c 100644 --- a/core/src/test/scala/latticetest/PowerSetLattice.scala +++ b/core/src/test/scala/com/phaller/rasync/test/PowerSetLattice.scala @@ -1,8 +1,8 @@ -package latticetest +package com.phaller.rasync +package test import org.scalatest.FunSuite -import cell._ import lattice.{ Lattice, NotMonotonicException, Key } object Util { diff --git a/core/src/test/scala/cell/PsSuite.scala b/core/src/test/scala/com/phaller/rasync/test/PsSuite.scala similarity index 98% rename from core/src/test/scala/cell/PsSuite.scala rename to core/src/test/scala/com/phaller/rasync/test/PsSuite.scala index ac192a5..9388be5 100644 --- a/core/src/test/scala/cell/PsSuite.scala +++ b/core/src/test/scala/com/phaller/rasync/test/PsSuite.scala @@ -1,4 +1,5 @@ -package cell +package com.phaller.rasync +package test import lattice._ import org.scalatest.FunSuite diff --git a/core/src/test/scala/Purity.scala b/core/src/test/scala/com/phaller/rasync/test/Purity.scala similarity index 95% rename from core/src/test/scala/Purity.scala rename to core/src/test/scala/com/phaller/rasync/test/Purity.scala index a738132..eb4b815 100644 --- a/core/src/test/scala/Purity.scala +++ b/core/src/test/scala/com/phaller/rasync/test/Purity.scala @@ -1,4 +1,5 @@ -package cell +package com.phaller.rasync +package test import lattice.{ MonotonicUpdater, Key, Lattice, NotMonotonicException } diff --git a/core/src/test/scala/cell/base.scala b/core/src/test/scala/com/phaller/rasync/test/base.scala similarity index 99% rename from core/src/test/scala/cell/base.scala rename to core/src/test/scala/com/phaller/rasync/test/base.scala index cb4c1ae..4abf9fb 100644 --- a/core/src/test/scala/cell/base.scala +++ b/core/src/test/scala/com/phaller/rasync/test/base.scala @@ -1,4 +1,5 @@ -package cell +package com.phaller.rasync +package test import org.scalatest.FunSuite diff --git a/core/src/test/scala/internalBase.scala b/core/src/test/scala/com/phaller/rasync/test/internalBase.scala similarity index 94% rename from core/src/test/scala/internalBase.scala rename to core/src/test/scala/com/phaller/rasync/test/internalBase.scala index 436d5be..2fbf8d1 100644 --- a/core/src/test/scala/internalBase.scala +++ b/core/src/test/scala/com/phaller/rasync/test/internalBase.scala @@ -1,4 +1,5 @@ -package cell +package com.phaller.rasync +package test import org.scalatest.FunSuite @@ -11,9 +12,6 @@ import scala.concurrent.duration._ import lattice._ -import opal.PurityAnalysis -import org.opalj.br.analyses.Project - class InternalBaseSuite extends FunSuite { implicit val stringIntUpdater: Updater[Int] = new StringIntUpdater diff --git a/core/src/test/scala/opal/ImmutabilityAnalysis.scala b/core/src/test/scala/com/phaller/rasync/test/opal/ImmutabilityAnalysis.scala similarity index 99% rename from core/src/test/scala/opal/ImmutabilityAnalysis.scala rename to core/src/test/scala/com/phaller/rasync/test/opal/ImmutabilityAnalysis.scala index a3e114e..f8efc71 100644 --- a/core/src/test/scala/opal/ImmutabilityAnalysis.scala +++ b/core/src/test/scala/com/phaller/rasync/test/opal/ImmutabilityAnalysis.scala @@ -1,3 +1,5 @@ +package com.phaller.rasync +package test package opal import java.net.URL @@ -9,7 +11,6 @@ import scala.collection.JavaConverters._ import scala.concurrent.Await import scala.concurrent.duration._ -import cell._ import org.opalj.br.{ Field, ClassFile, ObjectType } import org.opalj.br.analyses.{ BasicReport, DefaultOneStepAnalysis, Project, PropertyStoreKey } import org.opalj.br.analyses.TypeExtensibilityKey diff --git a/core/src/test/scala/opal/OPALSuite.scala b/core/src/test/scala/com/phaller/rasync/test/opal/OPALSuite.scala similarity index 98% rename from core/src/test/scala/opal/OPALSuite.scala rename to core/src/test/scala/com/phaller/rasync/test/opal/OPALSuite.scala index 7d931a4..6d1b023 100644 --- a/core/src/test/scala/opal/OPALSuite.scala +++ b/core/src/test/scala/com/phaller/rasync/test/opal/OPALSuite.scala @@ -1,3 +1,5 @@ +package com.phaller.rasync +package test package opal import org.scalatest.FunSuite @@ -9,7 +11,6 @@ import java.io.File import scala.concurrent.{ Await, Promise } import scala.concurrent.duration._ -import cell.{ CellCompleter, HandlerPool } import lattice.NotMonotonicException class OPALSuite extends FunSuite { diff --git a/core/src/test/scala/opal/PurityAnalysis.scala b/core/src/test/scala/com/phaller/rasync/test/opal/PurityAnalysis.scala similarity index 98% rename from core/src/test/scala/opal/PurityAnalysis.scala rename to core/src/test/scala/com/phaller/rasync/test/opal/PurityAnalysis.scala index ed7dea9..c3c3a67 100644 --- a/core/src/test/scala/opal/PurityAnalysis.scala +++ b/core/src/test/scala/com/phaller/rasync/test/opal/PurityAnalysis.scala @@ -1,3 +1,5 @@ +package com.phaller.rasync +package test package opal import java.net.URL @@ -6,9 +8,6 @@ import scala.collection.JavaConverters._ import scala.concurrent.Await import scala.concurrent.duration._ -import cell.{ HandlerPool, Cell, FinalOutcome, NoOutcome, Outcome, NextOutcome } -import cell.{ PurityKey, Purity, Pure, Impure, UnknownPurity } - import org.opalj.Success import org.opalj.br.{ ClassFile, Method, MethodWithBody, PC } import org.opalj.br.analyses.{ BasicReport, DefaultOneStepAnalysis, Project } diff --git a/core/src/test/scala/pool.scala b/core/src/test/scala/com/phaller/rasync/test/pool.scala similarity index 98% rename from core/src/test/scala/pool.scala rename to core/src/test/scala/com/phaller/rasync/test/pool.scala index dc35ae0..741f6ab 100644 --- a/core/src/test/scala/pool.scala +++ b/core/src/test/scala/com/phaller/rasync/test/pool.scala @@ -1,4 +1,5 @@ -package cell +package com.phaller.rasync +package test import java.util.concurrent.ConcurrentHashMap