hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zhihai xu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-12117) Potential NPE from Configuration#loadProperty with allowNullValueProperties set.
Date Fri, 26 Jun 2015 04:45:04 GMT

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

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

Hi [~raviprak], thanks for the review! The current unit tests don't trigger this issue.
bq. I'd be wary of opening up the access level of a Configuration method (even if it is labeled
@VisibleForTesting) . Are you sure we can't unit test without changing the access level? Also
please log the exception in testLoadProperty().
Good suggestions! fixed in the new patch.
I uploaded a new patch HADOOP-12117.001.patch, which addressed all your comments, please review
it.

> 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, HADOOP-12117.001.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)

Mime
View raw message