Github user zsxwing commented on the pull request:

    https://github.com/apache/spark/pull/6735#issuecomment-110677571
  
    It's because `enclosingObject` in `instantiateClass` is null. The bytecodes 
in constructor will check the first field:
    ```
      public 
org.apache.spark.streaming.StreamingContext$$anonfun$binaryRecordsStream$1(org.apache.spark.streaming.StreamingContext,
 java.lang.String, int);
        Code:
           0: aload_1
           1: ifnonnull     12
           4: new           #119                // class 
java/lang/NullPointerException
           7: dup
           8: invokespecial #122                // Method 
java/lang/NullPointerException."<init>":()V
          11: athrow
          12: aload_0
          13: aload_1
          14: putfield      #27                 // Field 
$outer:Lorg/apache/spark/streaming/StreamingContext;
          17: aload_0
          18: aload_2
          19: putfield      #57                 // Field 
directory$2:Ljava/lang/String;
          22: aload_0
          23: iload_3
          24: putfield      #49                 // Field recordLength$1:I
          27: aload_0
          28: invokespecial #123                // Method 
scala/runtime/AbstractFunction0."<init>":()V
          31: return
    ```
    Before this fix, `Utils.isInInterpreter` always returns `true` because of 
the wrong class name... Now the code path of `Utils.isInInterpreter == false` 
is activated.
    
    I'm looking for a fix for this `NullPointerException`.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to