summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-09-19 20:46:22 +0000
committerPaul Phillips <paulp@improving.org>2011-09-19 20:46:22 +0000
commitc22bc18ab6a6b91c30a6e9dde6797d7db94e22e0 (patch)
treeb98c3f48f68fd575f6f41d1c986b990ce462dcee /src/library
parente21d9b0a3907ee59b4d05489ecaf0fbf6467e27f (diff)
downloadscala-c22bc18ab6a6b91c30a6e9dde6797d7db94e22e0.tar.gz
scala-c22bc18ab6a6b91c30a6e9dde6797d7db94e22e0.tar.bz2
scala-c22bc18ab6a6b91c30a6e9dde6797d7db94e22e0.zip
Rooting out mismatched zips.
I added local logging to zip and zipped and listened for who was dropping things on the floor. Everything in this commit stems from that. Sometimes the fix was uncertain and I sprinkled some logging. If you've been hanging back with lots of internals knowledge waiting for the right commit to review, this would be a good one. But since knowledgeable people are hard to find, I'll go with review by moors.
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/runtime/ScalaRunTime.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/library/scala/runtime/ScalaRunTime.scala b/src/library/scala/runtime/ScalaRunTime.scala
index 3c7aff5b60..a56055e210 100644
--- a/src/library/scala/runtime/ScalaRunTime.scala
+++ b/src/library/scala/runtime/ScalaRunTime.scala
@@ -346,4 +346,18 @@ object ScalaRunTime {
nl + s + "\n"
}
+ private[scala] def checkZip(what: String, coll1: TraversableOnce[_], coll2: TraversableOnce[_]) {
+ if (sys.props contains "scala.debug.zip") {
+ val xs = coll1.toIndexedSeq
+ val ys = coll2.toIndexedSeq
+ if (xs.length != ys.length) {
+ Console.err.println(
+ "Mismatched zip in " + what + ":\n" +
+ " this: " + xs.mkString(", ") + "\n" +
+ " that: " + ys.mkString(", ")
+ )
+ (new Exception).getStackTrace.drop(2).take(10).foreach(println)
+ }
+ }
+ }
}