JDK 9 RFR of JDK-8161500: Use getTypeName and StringJoiner in core reflection toString methods

Claes Redestad claes.redestad at oracle.com
Fri Jul 15 23:55:01 UTC 2016


Looks OK, although I find:

StringJoiner sj = StringJoiner(delimiter, before, after);
...
sb.append(sj.toString());

to be a messier read than:

sb.append(before);
StringJoiner sj = new StringJoiner(delimiter);
...
sb.append(sj.toString())
   .append(after);

Any of these are ever used in a performance sensitive manner? I assume 
no, but still curious. :-)

/Claes

On 2016-07-16 01:17, Joseph D. Darcy wrote:
> Hello,
>
> Please review this straightforward cleanup of some of the core
> reflection implementation classes:
>
>      JDK-8161500: Use getTypeName and StringJoiner in core reflection
> toString methods
>      http://cr.openjdk.java.net/~darcy/8161500.1/
>
> All java/lang/Class and java/lang/reflect regression tests pass with
> this patch.
>
> (If the fix for JDK-8054213: "Class name repeated in output of
> Type.toString()" is pushed before this fix, a simple merge will be needed.)
>
> Thanks,
>
> -Joe


More information about the core-libs-dev mailing list