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:11:09 UTC

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

Konstantin Gribov created CONFIGURATION-561:
-----------------------------------------------

             Summary: 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.9, 1.8
         Environment: Linux 3.12.2, Oracle JDK 7u40
            Reporter: Konstantin Gribov
            Priority: Blocker


In {{commons-configuration}} 1.7 {{Configuration.getList}} had signature:
{code:java}
public List<String> getList(String key, List<String> 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)