commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Gribov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CONFIGURATION-561) Configuration.getList signature incorrect and incompatible change
Date Tue, 10 Dec 2013 17:25:09 GMT

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

Konstantin Gribov commented on CONFIGURATION-561:
-------------------------------------------------

Issue https://issues.apache.org/jira/browse/CONFIGURATION-558 wasn't found by searching {{getList}}.
As I see, it was fixed there.

> Configuration.getList signature incorrect and incompatible change
> -----------------------------------------------------------------
>
>                 Key: CONFIGURATION-561
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-561
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.8, 1.9
>         Environment: Linux 3.12.2, Oracle JDK 7u40
>            Reporter: Konstantin Gribov
>            Priority: Blocker
>              Labels: easyfix, newbie
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> In {{commons-configuration}} 1.7 {{Configuration.getList}} had signature:
> {code:java}
> public List getList(String key, List defaultValue)
> {code}
> But it was changed in 1.8 to:
> {code:java}
> public List<Object> getList(String key, List<Object> defaultValue)
> {code}
> So something like this:
> {code:java}
> Configuration conf = ...; // some configuration
> List<String> defaults = ...; // some default value
> List<Object> value = conf.getList("id", defaults);
> {code}
> will fail at compile-time.
> To fix this signature should change to
> {code:java}
> public List<Object> getList(String key, List<? extends Object> defaultValue)
> {code}
> in {{Configuration}} and all its implementations.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Mime
View raw message