JDK 12 RFR of JDK-8213299: runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java failed with java.lang.NoSuchMethodException

Joe Darcy joe.darcy at oracle.com
Mon Jan 14 19:04:12 UTC 2019


Hi Stuart,

On 1/11/2019 11:08 AM, Stuart Marks wrote:
> Drat, you pushed this already. But I wanted to mention a couple style 
> points:
>
> On 1/10/19 10:13 PM, Joe Darcy wrote:
>> + sb.append(Stream.of(argTypes).map(c -> {return (c == null) ? "null" 
>> : c.getName();}).
>> +              collect(Collectors.joining(",")));
>
> Since argTypes is an array, I usually prefer Arrays.stream() over 
> Stream.of(). The issue is that Stream.of() is varargs, and while this 
> case isn't formally ambiguous, it can create a question in the 
> reader's mind about whether the stream consists of the array elements 
> or of just one element that's the array itself.
>
> The statement lambda can probably be replaced with an expression 
> lambda. I think it makes the ternary easier to read. Also, indentation.
>
>     sb.append(Arrays.stream(argTypes)
>                     .map(c -> (c == null) ? "null" : c.getName())
>                     .collect(Collectors.joining(",")));
>
> I'm not sure it's worth tracking this, but I could file a bug if you'd 
> like.


Once JDK-8213299 hits the JDK 13 repo, I'd be open to doing a refactoring.

I've filed JDK-8217000: Refactor Class::methodToString .

Thanks,

-Joe



More information about the core-libs-dev mailing list