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

Stuart Marks stuart.marks at oracle.com
Fri Jan 11 19:08:29 UTC 2019

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 

The statement lambda can probably be replaced with an expression lambda. I think 
it makes the ternary easier to read. Also, indentation.

                     .map(c -> (c == null) ? "null" : c.getName())

I'm not sure it's worth tracking this, but I could file a bug if you'd like.


More information about the core-libs-dev mailing list