8058779: Faster implementation of String.replace(CharSequence, CharSequence)

Paul Sandoz paul.sandoz at oracle.com
Tue Jun 2 09:15:59 UTC 2015


On Jun 2, 2015, at 10:56 AM, Ivan Gerasimov <ivan.gerasimov at oracle.com> wrote:
>> 
>> You could simplify the data provider sourceTargetReplacementWithNull, there is no point testing with a null source. String.replace accepts two arguments, each can be either null or non-null. Thats 2 bits of state, so one can simply be explicit and presumably it should not matter what the non-null argument value (there are enough non-null values supplied by the other data providers):
>> 
>>   {null, null}
>>   {null, "foo"}
>>   {"foo", null}
> I agree there is not much value in testing the case source == null, so it can be removed.
> However, I would leave other test cases.
> Earlier in this thread Rémi spotted a bug, which had been observed in a call "bar".replace("foo", null), but not in "foo".replace("foo", null).
> 

Ok, presumably for the same identity rather than value?

Paul.





More information about the core-libs-dev mailing list