harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Zhou <zhoukevi...@gmail.com>
Subject Re: [jira] Created: (HARMONY-6146) [classlib][luni][java6] java.util.Properties.Properties(defaults).stringPropertyNames() should return a set of keys including the keys in the default property list
Date Fri, 10 Apr 2009 09:18:41 GMT
Hi,
I think this failure results from the mis-operation of the constructor ---
java.util.Properties.Properties(Properties defaultProperties).
It only assigns the default properties of the new Properties object to the
given defaultProperties which is:

defaults = defaultProperties;

I think that it should add all of normal and default properties of the given
defaultProperties. The code should be changed into:

if (properties != null) {
    defaults = new Properties();
    defaults.putAll(properties);
    if (properties.defaults != null) {
        defaults.putAll(properties.defaults);
    }
}

On Fri, Apr 10, 2009 at 5:12 PM, Kevin Zhou (JIRA) <jira@apache.org> wrote:

> [classlib][luni][java6]
> java.util.Properties.Properties(defaults).stringPropertyNames() should
> return a set of keys including the keys in the default property list
>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6146
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6146
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Kevin Zhou
>             Fix For: 5.0M9
>
>
> Given a test case [1], RI passes while HY fails.
> The java spec specifies that java.util.Properties.stringPropertyNames()
> should return a set of keys in this property list, also including the keys
> in the default property list.
>
> [1] Test Case:
> public void test_Properties_stringPropertyNames() {
>    Properties properties = new Properties();
>    properties.setProperty("key", "value");
>    Properties properties2 = new Properties(properties);
>    assertEquals(1, properties2.stringPropertyNames().size());
>    Properties properties3 = new Properties(properties2);
>    assertEquals(1, properties3.stringPropertyNames().size());
> }
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message