Hi Roman,

You can try the change and see if it breaks any existing tests. Feel free
to create a PR even if it just to make the Javadoc match the code. I've not
studied this part of the code in a while, so maybe someone else can opine.

Gary


On Fri, Feb 12, 2021, 18:30 Roman Zaynetdinov <roman.zaynetdi...@lekane.com>
wrote:

> Hi,
>
> I am switching to commons-configuration2 and trying to use typed getList
> method. I have noticed that javadoc doesn't correspond to the actual
> implementation.
>
> ImmutableConfiguration.java:
>
> /**
>  * Gets a list of typed objects associated with the given configuration key
>  * returning an empty list if the key doesn't map to an existing object.
>  * ...
>  */
> <T> List<T> getList(Class<T> cls, String key);
>
> But implementation uses null as a default value.
> AbstractConfiguration.java:
>
> public <T> List<T> getList(final Class<T> cls, final String key)
> {
>     return getList(cls, key, null);
> }
>
> Should it use new ArrayList<>() instead of null? Similar to untyped getList
> method?
>
> - Roman
>

Reply via email to