You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Xiang Li (JIRA)" <ji...@apache.org> on 2016/11/18 09:17:58 UTC

[jira] [Commented] (PIG-5064) NPE in TestScriptUDF#testPythonBuiltinModuleImport1 when JAVA_HOME is not set

    [ https://issues.apache.org/jira/browse/PIG-5064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15676254#comment-15676254 ] 

Xiang Li commented on PIG-5064:
-------------------------------

The fix checks if JAVA_HOME is set firstly
(1) If it is set, it is safe to call t.get(0).toString(). 
(2) If it is not, verify if t.get(0) is null.

> NPE in TestScriptUDF#testPythonBuiltinModuleImport1 when JAVA_HOME is not set
> -----------------------------------------------------------------------------
>
>                 Key: PIG-5064
>                 URL: https://issues.apache.org/jira/browse/PIG-5064
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.16.0
>            Reporter: Xiang Li
>            Assignee: Xiang Li
>            Priority: Minor
>             Fix For: 0.16.1
>
>         Attachments: PIG-5064-trunk-0.patch
>
>
> When JAVA_HOME is not set (my env is Red Hat 7, alternatives is used and JAVA_HOME could be not set)
> line 250
> {code}
> Assert.assertTrue(t.get(0).toString().equals(System.getenv(input[1])));
> {code}
> t.get(0) is null, as a result, the following NPE is thrown:
> {code}
> java.lang.NullPointerException
>         at org.apache.pig.test.TestScriptUDF.testPythonBuiltinModuleImport1(TestScriptUDF.java:250)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)