RFR: 8306698: Add overloads to MethodTypeDesc::of

Chen Liang liach at openjdk.org
Sun Apr 23 16:36:41 UTC 2023


On Sun, 23 Apr 2023 16:31:52 GMT, Chen Liang <liach at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/constant/MethodTypeDesc.java line 85:
>> 
>>> 83:      * @since 21
>>> 84:      */
>>> 85:     static MethodTypeDesc of(ClassDesc returnDesc, Collection<ClassDesc> paramDescs) {
>> 
>> This needs to be:
>> Suggestion:
>> 
>>     static MethodTypeDesc of(ClassDesc returnDesc, List<ClassDesc> paramDescs) {
>> 
>> 
>> as `Collection` doesn’t have a defined encounter order.
>
> No, this is what List.copyOf supports.

Alternatively, we can switch to SequencedCollection when it's integrated.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13599#discussion_r1174609637


More information about the core-libs-dev mailing list