Whilst trying to figure out some joda-time
DateTime
(timestamp formatting) issues I opened a REPL with
scala -cp joda-time-2.3.jar
and forgot to add the joda-convert
jar, and eventually got a
java.lang.AssertionError: assertion failed: org.joda.convert.ToString
I was able to simplify this to:
> scala -cp joda-time-2.3.jar
Welcome to Scala version 2.11.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_05).
Type in expressions to have them evaluated.
Type :help for more information.
scala> val dt = new org.joda.time.DateTime
warning: Class org.joda.convert.FromString not found - continuing with a stub.
warning: Class org.joda.convert.ToString not found - continuing with a stub.
warning: Class org.joda.convert.FromString not found - continuing with a stub.
warning: Class org.joda.convert.ToString not found - continuing with a stub.
dt: org.joda.time.DateTime = 2014-05-14T17:54:24.511+01:00
scala> scala.runtime.ScalaRunTime.stringOf(dt)
res0: String = 2014-05-14T17:54:24.511+01:00
scala> dt.toString
java.lang.AssertionError: assertion failed: org.joda.convert.ToString
How is ScalaRunTime.stringOf(dt)
succeeding where dt.toString
fails?