You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "zhihai xu (JIRA)" <ji...@apache.org> on 2015/06/24 22:15:04 UTC

[jira] [Commented] (HADOOP-12117) Potential NPE from Configuration#loadProperty with allowNullValueProperties set.

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

zhihai xu commented on HADOOP-12117:
------------------------------------

Without the fix, the test will fail with the following exception:
{code}
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.hadoop.conf.TestConfiguration
Tests run: 62, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 27.865 sec <<< FAILURE! - in org.apache.hadoop.conf.TestConfiguration
testLoadProperty(org.apache.hadoop.conf.TestConfiguration)  Time elapsed: 0.007 sec  <<< ERROR!
java.lang.NullPointerException: null
	at org.apache.hadoop.conf.Configuration.loadProperty(Configuration.java:2750)
	at org.apache.hadoop.conf.TestConfiguration.testLoadProperty(TestConfiguration.java:1520)
Results :
Tests in error: 
  TestConfiguration.testLoadProperty:1520 ยป NullPointer
Tests run: 62, Failures: 0, Errors: 1, Skipped: 0
{code}

> Potential NPE from Configuration#loadProperty with allowNullValueProperties set.
> --------------------------------------------------------------------------------
>
>                 Key: HADOOP-12117
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12117
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: conf
>    Affects Versions: 2.7.1
>            Reporter: zhihai xu
>            Assignee: zhihai xu
>         Attachments: HADOOP-12117.000.patch
>
>
> Potential NPE from Configuration#loadProperty with allowNullValueProperties set.
> The following code will cause NPE:
> {code}
> } else if (!value.equals(properties.getProperty(attr))) {
> {code}
> Because if {{allowNullValueProperties}} is true, {{value}} is null and {{finalParameters}} contains {{attr}}, NullPointerException will happen



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