RFR 8135248: Add utility methods to check indexes and ranges
john.r.rose at oracle.com
Tue Sep 29 04:48:37 UTC 2015
On Sep 28, 2015, at 5:10 PM, Joseph D. Darcy <joe.darcy at oracle.com> wrote:
> Joining this thread late, I think the range checking methods would have a happier life where they are more often found and used if the they live somewhere other than the exception classes.
> The class java.util.Objects is not an ideal host for these methods, since they don't deal directly with objects per se, but the scope of Objects could be expanded to include these utilities as well.
You have a point, that's probably a better bikeshed.
Since the key operation is an integer compare, putting it on Integer (near compare) would also be defensible.
(The new factory methods for exceptions make sense on the exceptions themselves, of course.)
More information about the core-libs-dev