commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <>
Subject Re: Fix for the ArrayIndexOutOfBoundsException on calling NaturalRanking#rank() on an array of all NaNs
Date Fri, 16 Aug 2019 15:06:19 GMT

Le jeu. 15 août 2019 à 11:33, akash srivastava <> a écrit :
> Here is the link for the related bug:
> I have suggested two possible fixes when NaturalRanking#rank() is called on
> an array of all NaNs:
> 1) throwing an IllegalArgumentException
> 2) Returning an empty array
> I want to create a pull request regarding it, which fix do you suggest I
> should go for?

There are rationale for each.  An exception would catch a programming bug early.
But returning an empty array would allow concise code when such a case is not a
WDYT?  Are there use-cases?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message