[
https://issues.apache.org/jira/browse/LANG-1541?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary D. Gregory resolved LANG-1541.
-----------------------------------
Fix Version/s: 3.12
Resolution: Fixed
Hi [~arturobernalg]
Thank you for your PR but it has a bug :( please see my comments in the PR...
esp RE another contribution ;)
> ArrayUtils.contains() fails to handle Double.NaN
> ------------------------------------------------
>
> Key: LANG-1541
> URL: https://issues.apache.org/jira/browse/LANG-1541
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.*
> Affects Versions: 3.7, 3.10
> Reporter: Anthony Maidment
> Priority: Minor
> Fix For: 3.12
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> ArrayUtils.contains(double[], double) does not handle Double.NaN correctly.
> That is, ArrayUtils.contains() returns false, even if the given array
> contains Double.NaN.
> For example, consider the following:
> {code:java}
> double[] a = new double[]{Double.NEGATIVE_INFINITY, Double.NaN,
> Double.POSITIVE_INFINITY};
> System.out.println(ArrayUtils.contains(a, Double.POSITIVE_INFINITY)); // true
> System.out.println(ArrayUtils.contains(a, Double.NEGATIVE_INFINITY)); // true
> System.out.println(ArrayUtils.contains(a, Double.NaN)); // false ?
> {code}
>
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)