RFR(S): 8067471: Use private static final char[0] for empty Strings

Martin Buchholz martinrb at google.com
Fri Dec 19 19:34:55 UTC 2014


On Fri, Dec 19, 2014 at 11:14 AM, Ivan Gerasimov
<ivan.gerasimov at oracle.com> wrote:
> Sorry, it was meant to be:
>
>              if (count <= 0) {
>                  if (count < 0) {
>                      throw new StringIndexOutOfBoundsException(count);
>                  }
>                  if (offset <= value.length) {
>                      this.value = "".value;
>                      return;
>                  }
>              }

I support Ivan's idea of coalescing the rare branches into a slowpath.



More information about the core-libs-dev mailing list