[NEW BUG]: Avoid allocations in String.replace(CharSequence, CharSequence) in case no replacement happened
christoph.dreis at freenet.de
Thu Mar 2 11:45:09 UTC 2017
> Hi Vitaly,
> I don't see any contract to throw an NPE:
> In any case, what's the reasonable of checking an argument, which is not
> used in that case?
> Am 02.03.2017 um 00:18 schrieb Vitaly Davidovich:
> > Seems like a good idea. You probably want to null check 'replacement'
> > before the bail out as the method is specified as throwing NPE in that case.
It is stated in the class comment.
"Unless otherwise noted, passing a null argument to a constructor or method in this class will cause a NullPointerException to be thrown."
More information about the core-libs-dev