On Fri, 14 Oct 2022 16:57:47 GMT, Mandy Chung <mch...@openjdk.org> wrote:

>> Ioi Lam has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   @iwanowww comments
>
> src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java 
> line 291:
> 
>> 289:         final List<ClassData> cd = classData;
>> 290:         return switch(cd.size()) {
>> 291:             case 0 -> null;
> 
> `List.of()` always returns the same singleton instance and does not cause any 
> object allocation.  I prefer to keep the `classDataValues()` to return 
> `List<Object>`

Ah, I now see why you have to change the signature because of the single 
element case.  I made my comment too quickly. 

A couple of suggestions:
Please add a javadoc for this method to describe what this method returns for 
different cases.   It's better to move this method close to `clinit` as they 
are tightly coupled.

-------------

PR: https://git.openjdk.org/jdk/pull/10706

Reply via email to