Array equality, comparison and mismatch
chris.hegarty at oracle.com
Tue Oct 6 08:58:06 UTC 2015
On 6 Oct 2015, at 09:50, Paul Sandoz <paul.sandoz at oracle.com> wrote:
>> On 5 Oct 2015, at 17:35, Chris Hegarty <chris.hegarty at oracle.com> wrote:
>> On 22/09/15 17:30, Paul Sandoz wrote:
>>> Please review the following which adds methods to Arrays for performing equality, comparison and mismatch:
>> This looks very good.
>> I know that there has been some discussion already about the behavior when passed null, but it seems a little unfortunate that the range accepting 'equals' methods don't behave in a similar manner to that of the non-range 'equals' methods. But I do accept that it makes little sense, where would the from/to indices come from. So I think NPE makes sense for these.
> Note that this consistent with other range accepting methods, such as on Arrays or Spliterators (which also usually throw null on the non-range methods too, i wish we could be consistent in that aspect).
>> It was not immediately obvious to me that the common prefix can be 0. Should this be called out specifically?
> When reading the documentation of compare or mismatch or both?
mismatch. But maybe this is just me.
More information about the core-libs-dev