RFR[16]: 8247681: Improve bootstrapping of unary concatenations

Paul Sandoz paul.sandoz at oracle.com
Wed Jun 17 14:40:50 UTC 2020



> On Jun 17, 2020, at 3:54 AM, Claes Redestad <claes.redestad at oracle.com> wrote:
> 
> On 2020-06-16 18:06, Paul Sandoz wrote:
>> Looks good.
> 
> Thanks!
> 
>> It’s tempting to do something like this to de-dup the code with less potential for mistakes:
>> String s = null;
>> // Select the singular non-null value, if any
>> If (s0 != null && s1 == null) s = s0;
>> else if (s0 == null && s1 != null) s = s1;
>> If (s != null) {
>>     if (s.isEmpty()) {
>>>>     } else if (…) { … }
>> }
> 
> Ok. The index of where to inject the constant is order dependent,

Ah, I missed that, plus was not aware that s0 and s1 cannot both be null.

> but
> the code still slims down a bit:
> 
> http://cr.openjdk.java.net/~redestad/8247681/open.01/
> 

+1

Paul.

> Re-ran tier1+2
> 
> /Claes
> 



More information about the core-libs-dev mailing list