commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedikt Ritter (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1070) confusing example in ArrayUtils.add()
Date Sun, 14 Dec 2014 19:02:13 GMT

    [ https://issues.apache.org/jira/browse/LANG-1070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14246064#comment-14246064
] 

Benedikt Ritter commented on LANG-1070:
---------------------------------------

bq. I suggest to to throw NullPointerException if the host array is null for all this kind
of array operations. it's wrong operation to add/remove elements to/from a null array.

The design of the rest of the API currently is null-safe. Why treat this method differently?

> confusing example in ArrayUtils.add()
> -------------------------------------
>
>                 Key: LANG-1070
>                 URL: https://issues.apache.org/jira/browse/LANG-1070
>             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
(v6.3.4#6332)

Mime
View raw message