You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getSimpleName() getSimpleName()] yields an "java.lang.!InternalError: Malformed class name" for Scala classes, which are defined inside Scala objects.
Exception in thread "main" java.lang.InternalError:Malformedclassname
at java.lang.Class.getSimpleName(Class.java:1129)
at Toast$$Egg.eat(Test.scala:3)
at Main$$.<init>(Test.scala:8)
at Main$$.<clinit>(Test.scala)
at Main.main(Test.scala)
The text was updated successfully, but these errors were encountered:
@dragos said:
This happens because 'getSimpleName' is assuming the name has a certain pattern of '$$'s, which unfortunately is not the case when the class is defined inside a top-level object. The IBM JVM for instance is printing the right name, so this is an issue of Sun's implementation. Changing the naming scheme for objects requires quite a lot of thought so I postpone this issue for.
@paulp said:
This code did the right thing on all JVMs I have ready access to, but I didn't want to close it in case I just didn't find the right JVM. However, the fact that it worked on sun's linux JVM makes me suspect that the bug is no longer valid. Iulian, can you confirm or dispute this for me?
[http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getSimpleName() getSimpleName()] yields an "java.lang.!InternalError: Malformed class name" for Scala classes, which are defined inside Scala objects.
yields
The text was updated successfully, but these errors were encountered: