hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wangda Tan (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HADOOP-11199) Configuration should be able to set empty value for property
Date Mon, 13 Oct 2014 23:59:33 GMT
Wangda Tan created HADOOP-11199:
-----------------------------------

             Summary: 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


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)

Mime
View raw message