On Fri, 13 May 2022 11:14:29 GMT, ExE Boss <d...@openjdk.java.net> wrote:

>> Сергей Цыпанов has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   8282662: Revert dubious changes in MethodType
>
> src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 727:
> 
>> 725:             MethodVisitor mv = cw.visitMethod(accessFlags,
>> 726:                     method.getName(), desc, null,
>> 727:                     typeNames(List.of(exceptionTypes)));
> 
> Since `exceptionTypes` is an array, it might be better to keep using 
> `Arrays.asList`, or add an overload for `typeNames` that works on class 
> arrays.

Usually a method declares either no exception, or a couple of them. In the 
first case `List.of()` doesn't allocate, in the second it allocates an object 
with 1-2 fields but without an array, so `List.of()` is likely to be more 
memory-saving

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

PR: https://git.openjdk.java.net/jdk/pull/7729

Reply via email to