Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ case class NewInstance(
// that might be defined on the companion object.
case 0 => s"$className$$.MODULE$$.apply($argString)"
case _ => outer.map { gen =>
s"${gen.value}.new ${cls.getSimpleName}($argString)"
s"${gen.value}.new ${Utils.getSimpleName(cls)}($argString)"
}.getOrElse {
s"new $className($argString)"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,18 @@ class ExpressionEncoderSuite extends CodegenInterpretedPlanTest with AnalysisTes

encodeDecodeTest(Array(Option(InnerClass(1))), "array of optional inner class")

// holder class to trigger Class.getSimpleName issue
object MalformedClassObject extends Serializable {
case class MalformedNameExample(x: Int)
}

{
OuterScopes.addOuterScope(MalformedClassObject)
encodeDecodeTest(
MalformedClassObject.MalformedNameExample(42),
"nested Scala class should work")
}

productTest(PrimitiveData(1, 1, 1, 1, 1, 1, true))

productTest(
Expand Down