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

    https://github.com/apache/spark/pull/7122#discussion_r35452547
  
    --- 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 --
    
    good point, I hesitated to do it at first but don't remember why I decided 
to not put it in a companion object. Will do


---
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