commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Gribov (JIRA)" <>
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
             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:
public List<String> getList(String key, List<String> defaultValue)

But it was changed in 1.8 to:
public List<Object> getList(String key, List<Object> defaultValue)

So something like this:
Configuration conf = ...; // some configuration
List<String> defaults = ...; // some default value

List<Object> value = conf.getList("id", defaults);
will fail at compile-time.

To fix this signature should change to
public List<Object> getList(String key, List<? extends Object> defaultValue)
in {{Configuration}} and all its implementations.

This message was sent by Atlassian JIRA

View raw message