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] [Created] (CONFIGURATION-561) Configuration.getList signature incorrect and incompatible change
Date Tue, 10 Dec 2013 17:11:09 GMT
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)

Mime
View raw message