From e6167d9350b8f268379d0b4683400fb7950f0d13 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 21 Jan 2011 05:03:42 +0000 Subject: The empty string commit made me hungry to actua... The empty string commit made me hungry to actually know what's in stuff. Now it prints quotes around a string if it's empty or if either the first or last character is whitespace. No review. --- src/library/scala/runtime/ScalaRunTime.scala | 1 + 1 file changed, 1 insertion(+) (limited to 'src/library') diff --git a/src/library/scala/runtime/ScalaRunTime.scala b/src/library/scala/runtime/ScalaRunTime.scala index 5d1fad896a..956147ab4a 100644 --- a/src/library/scala/runtime/ScalaRunTime.scala +++ b/src/library/scala/runtime/ScalaRunTime.scala @@ -290,6 +290,7 @@ object ScalaRunTime { def inner(arg: Any): String = arg match { case null => "null" case "" => "\"\"" + case x: String => if (x.head.isWhitespace || x.last.isWhitespace) "\"" + x + "\"" else x case x if useOwnToString(x) => x.toString case x: AnyRef if isArray(x) => WrappedArray make x take maxElements map inner mkString ("Array(", ", ", ")") case x: collection.Map[_, _] => x take maxElements map mapInner mkString (x.stringPrefix + "(", ", ", ")") -- cgit v1.2.3