You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Allen Wittenauer (JIRA)" <ji...@apache.org> on 2015/03/09 16:44:38 UTC
[jira] [Resolved] (HADOOP-11199) Configuration should be able to
set empty value for property
[ https://issues.apache.org/jira/browse/HADOOP-11199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Allen Wittenauer resolved HADOOP-11199.
---------------------------------------
Resolution: Duplicate
Duping this to HADOOP-6228 since there are more people on that JIRA.
> Configuration should be able to set empty value for property
> ------------------------------------------------------------
>
> Key: HADOOP-11199
> URL: https://issues.apache.org/jira/browse/HADOOP-11199
> Project: Hadoop Common
> Issue Type: Bug
> Components: conf
> Reporter: Wangda Tan
> Attachments: HADOOP-11199-01.patch
>
>
> Currently in hadoop.common.conf.Configuration, when you specify a XML like this:
> {code}
> <configuration>
> <property>
> <name>conf.name</name>
> <value></value>
> </property>
> </configuration>
> {code}
> When you trying to get the conf.name, the returned value is null instead of an empty string.
> Test code for this,
> {code}
> import java.io.ByteArrayInputStream;
> import org.apache.hadoop.conf.Configuration;
> public class HadoopConfigurationEmptyTest {
> public static void main(String[] args) {
> Configuration conf = new Configuration(false);
> ByteArrayInputStream bais =
> new ByteArrayInputStream(("<configuration><property>"
> + "<name>conf.name</name>" + "<value></value>"
> + "</property></configuration>").getBytes());
> conf.addResource(bais);
> System.out.println(conf.get("conf.name"));
> }
> }
> {code}
> Does this intentionally or a behavior should be fixed?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)