commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Commented] (LANG-1070) confusing example in ArrayUtils.add()
Date Sun, 30 Nov 2014 18:48:12 GMT


Sebb commented on LANG-1070:

I agree it would be OK to return null if both inputs are null.

I think the reason for throwing IAE is that one cannot determine the type if both arguments
are null.
However that does not matter if the return itself is null.

> confusing example in ArrayUtils.add()
> -------------------------------------
>                 Key: LANG-1070
>                 URL:
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>    Affects Versions: 3.3.2
>            Reporter: Paul Pogonyshev
>            Priority: Trivial
> Method documentation claims that
>     ArrayUtils.add(null, null)     = null
> However, this is not true since this parameter combination leads to an exception.
> Either remove this line from documentation, or rewrite it to explicitly mention the exception.
Maybe there are other related methods with similar problem in the docs.

This message was sent by Atlassian JIRA

View raw message