hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vinayakumar B (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-12117) Potential NPE from Configuration#loadProperty with allowNullValueProperties set.
Date Mon, 06 Jul 2015 11:19:04 GMT

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

Vinayakumar B commented on HADOOP-12117:
----------------------------------------

Hi [~zxu],
I have one nit in test.

No need to catch {{Exception}} and then fail. Let it fail directly with NPE.

Otherwise +1.

> 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
>            Priority: Minor
>         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