diff options
-rw-r--r-- | src/library/scala/Console.scala | 11 | ||||
-rw-r--r-- | test/files/jvm/console.scala | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/library/scala/Console.scala b/src/library/scala/Console.scala index fe29150caa..d48a849aef 100644 --- a/src/library/scala/Console.scala +++ b/src/library/scala/Console.scala @@ -167,8 +167,8 @@ object Console { * </p> * <p> * The interpretation of the formatting patterns is described in - * <a href="" target="contentFrame" class="java/text/MessageFormat"> - * <code>java.text.MessageFormat</code></a>. + * <a href="" target="contentFrame" class="java/util/Formatter"> + * <code>java.util.Formatter</code></a>. * </p> * * @param text the pattern for formatting the arguments. @@ -182,10 +182,9 @@ object Console { * target="contentFrame">Console.printf</a>. */ def format(text: String, args: Any*): Unit = - out.print( - if (text eq null) "null" - else MessageFormat.format(text, textParams(args)) - ) + if (text eq null) "null" else + out.printf(text, args.asInstanceOf[scala.runtime.BoxedObjectArray]. + unbox(args.getClass).asInstanceOf[Array[Object]]) /** Read a full line from the terminal. * diff --git a/test/files/jvm/console.scala b/test/files/jvm/console.scala index 953a60f7bf..b07765675c 100644 --- a/test/files/jvm/console.scala +++ b/test/files/jvm/console.scala @@ -9,6 +9,6 @@ object Test extends Application { flush println("..") println(1) - printf("Argument nr. {0,number} has value {1,number,#.##}\n", + printf("Argument nr. %d has value %1.2f\n", 1, 10.0/3) } |