commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Benson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-924) In FieldUtils replace Validate.isTrue(object != null) with Validate.notNull(object)
Date Fri, 18 Oct 2013 16:42:43 GMT

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

Matt Benson commented on LANG-924:
----------------------------------

Yes, I made the changes locally before deciding that changing from NPE to IllegalArgumentException
was an unacceptable violation of BC.

> In FieldUtils replace Validate.isTrue(object != null) with Validate.notNull(object)
> -----------------------------------------------------------------------------------
>
>                 Key: LANG-924
>                 URL: https://issues.apache.org/jira/browse/LANG-924
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.reflect.*
>    Affects Versions: 3.1
>            Reporter: Benedikt Ritter
>             Fix For: Review Patch
>
>
> Methods in FieldUtils validate input using code like:
> {code}
> Validate.isTrue(cls != null, "The class must not be null")
> {code}
> This could be changed to:
> {code}
> Validate.notNull(cls, "The class must not be null")
> {code}
> However this could affect client code, since isTrue(boolean) throws IllegalArgumentException
and notNull throws NullPointerException.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message