summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala17
-rw-r--r--test/files/buildmanager/t2562/t2562.check2
2 files changed, 14 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala b/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
index 209c38e0c2..d07f34421f 100644
--- a/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
+++ b/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
@@ -111,7 +111,7 @@ class RefinedBuildManager(val settings: Settings) extends Changes with BuildMana
(from.hasFlag(Flags.MODULE) == to.hasFlag(Flags.MODULE))
// For testing purposes only, order irrelevant for compilation
- def toStringSorted(set: Set[AbstractFile]): String = {
+ def toStringSet(set: Set[AbstractFile]): String = {
val s = (set.toList).sort(_.name < _.name)
s.mkString("Set(", ", ", ")")
}
@@ -119,7 +119,7 @@ class RefinedBuildManager(val settings: Settings) extends Changes with BuildMana
def update0(files: Set[AbstractFile]): Unit = if (!files.isEmpty) {
deleteClassfiles(files)
val run = compiler.newRun()
- compiler.inform("compiling " + toStringSorted(files))
+ compiler.inform("compiling " + toStringSet(files))
buildingFiles(files)
run.compileFiles(files.toList)
@@ -127,8 +127,17 @@ class RefinedBuildManager(val settings: Settings) extends Changes with BuildMana
return
}
- // Use linked hash map to improve determinism required for testing purposes
- val changesOf = new mutable.LinkedHashMap[Symbol, List[Change]]
+ // Deterministic behaviour required by partest
+ val changesOf = new mutable.HashMap[Symbol, List[Change]] {
+ override def toString: String = {
+ val syms = toList.sort(_._1.fullNameString < _._1.fullNameString)
+ val changesOrdered = syms.map(entry => {
+ val list = entry._2.sort(_.toString < _.toString)
+ entry._1.toString + " -> " + list.mkString("List(", ", ", ")")
+ })
+ changesOrdered.mkString("Map(", ", ", ")")
+ }
+ }
val additionalDefs: mutable.HashSet[AbstractFile] = mutable.HashSet.empty
val defs = compiler.dependencyAnalysis.definitions
diff --git a/test/files/buildmanager/t2562/t2562.check b/test/files/buildmanager/t2562/t2562.check
index ba86202156..813d2735e1 100644
--- a/test/files/buildmanager/t2562/t2562.check
+++ b/test/files/buildmanager/t2562/t2562.check
@@ -9,4 +9,4 @@ compiling Set(B.scala)
Changes: Map(object B -> List(Changed(Definition(B.x2))[method x2 changed from ()Int to ()java.lang.String flags: <method>]))
invalidate A.scala because it references changed definition [Changed(Definition(B.x2))[method x2 changed from ()Int to ()java.lang.String flags: <method>]]
compiling Set(A.scala, B.scala)
-Changes: Map(object B -> List(Changed(Definition(B.x0))[method x0 changed from ()Int to ()java.lang.String flags: <method>], Changed(Definition(B.x1))[method x1 changed from ()Int to ()java.lang.String flags: <method>]), object A -> List(Changed(Definition(A.x0))[method x0 changed from ()Int to ()java.lang.String flags: <method>], Changed(Definition(A.x1))[method x1 changed from ()Int to ()java.lang.String flags: <method>], Changed(Definition(A.x2))[method x2 changed from ()Int to ()java.lang.String flags: <method>]))
+Changes: Map(object A -> List(Changed(Definition(A.x0))[method x0 changed from ()Int to ()java.lang.String flags: <method>], Changed(Definition(A.x1))[method x1 changed from ()Int to ()java.lang.String flags: <method>], Changed(Definition(A.x2))[method x2 changed from ()Int to ()java.lang.String flags: <method>]), object B -> List(Changed(Definition(B.x0))[method x0 changed from ()Int to ()java.lang.String flags: <method>], Changed(Definition(B.x1))[method x1 changed from ()Int to ()java.lang.String flags: <method>]))