You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Konstantin Gribov (JIRA)" <ji...@apache.org> on 2013/12/10 18:25:09 UTC

[jira] [Commented] (CONFIGURATION-561) Configuration.getList signature incorrect and incompatible change

    [ 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)