Details
Description
Similar to SPARK-32238 and SPARK-32999, the use of java.lang.Class.getSimpleName in NewInstance.doGenCode is problematic because Scala classes may trigger java.lang.InternalError: Malformed class name.
This happens more often when using nested classes in Scala (or declaring classes in Scala REPL which implies class nesting).
Note that on newer versions of JDK the underlying malformed class name no longer reproduces (fixed in the JDK by https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8057919), so it's less of an issue there. But on JDK8u this problem still exists so we still have to fix it.