[
https://issues.apache.org/jira/browse/LANG-753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13155697#comment-13155697
]
Oliver Siegmar commented on LANG-753:
-------------------------------------
Consider that there are currently many more 2.6 users than 3.0 users. So
breaking 3.0 compatibility is not as bad as breaking 2.6 compatibility if the
change would be made *now*. This breaking changed should be documented very
well, of course. Probably it could also be a 3.1 verison.
>From my point of view, a NullPointerException is the wrong type of Exception
>anyway. A NullPointerException should be thrown by the JVM only if an
>operation is executed on a null reference accidently. If I want to ensure that
>a method argument is required (must not be null) I'd like to throw an
>IllegalArgumentException because that describes what really happend - an
>illegal argument (null in this case) was passed to the method.
> Validate.notNull() should throw IllegalArgumentException but throws
> NullPointerException
> ----------------------------------------------------------------------------------------
>
> Key: LANG-753
> URL: https://issues.apache.org/jira/browse/LANG-753
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.*
> Affects Versions: 3.0.1
> Reporter: Oliver Siegmar
>
> Validate.notNull() throws an IllegalArgumentException in commons-lang 2.6,
> but in 3.0.1 it throws a NullPointerException. I can't find any note about
> this in the release notes. I think this is a regression, because it could
> break others code.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira