harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Ellison (JIRA)" <j...@apache.org>
Subject [jira] Commented: (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 Thu, 16 Apr 2009 13:29:14 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-6146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699699#action_12699699
] 

Tim Ellison commented on HARMONY-6146:
--------------------------------------

I don't think this patch is good.
You need to keep a reference to the original defaults properties in case they change, e.g.

        Properties defaults = new Properties();
        defaults.setProperty("default 1", "d1");
        defaults.setProperty("default 2", "d2");
        defaults.setProperty("default 3", "d3");

        Properties properties = new Properties(defaults);
        properties.setProperty("key 1", "v1");
        properties.setProperty("key 2", "v2");
        properties.setProperty("key 3", "v3");

        int size = properties.stringPropertyNames().size();
        assertEquals(6, size);

        defaults.setProperty("default 4", "d4");
        defaults.setProperty("default 5", "d5");
        defaults.setProperty("default 6", "d6");

        size = properties.stringPropertyNames().size();
        assertEquals(9, size);
    

> [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
>            Assignee: Tim Ellison
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6146.diff
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> 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
View raw message