Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7122#discussion_r35440810
  
    --- Diff: 
core/src/main/scala/org/apache/spark/serializer/JavaSerializer.scala ---
    @@ -62,17 +62,34 @@ private[spark] class JavaDeserializationStream(in: 
InputStream, loader: ClassLoa
       extends DeserializationStream {
     
       private val objIn = new ObjectInputStream(in) {
    -    override def resolveClass(desc: ObjectStreamClass): Class[_] = {
    -      // scalastyle:off classforname
    -      Class.forName(desc.getName, false, loader)
    -      // scalastyle:on classforname
    -    }
    +    override def resolveClass(desc: ObjectStreamClass): Class[_] =
    +      try {
    +        // scalastyle:off classforname
    +        Class.forName(desc.getName, false, loader)
    +        // scalastyle:on classforname
    +      } catch {
    +        case e: ClassNotFoundException =>
    +          JavaSerDe.primitiveMappings.get(desc.getName).getOrElse(throw e)
    +      }
       }
     
       def readObject[T: ClassTag](): T = objIn.readObject().asInstanceOf[T]
       def close() { objIn.close() }
     }
     
    +private object JavaSerDe {
    --- End diff --
    
    can you rename this to match the class, `JavaDeserializationStream`?  
Alternatively we could give it some name which is more specific, eg. 
`JavaSerializationPrimitiveClassHelper` or something, but I think just making 
it a companion object is good enough.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to