Add MethodTypeDesc.of(ClassDesc) and MethodTypeDesc.of(ClassDesc, Collection<ClassDesc>) for convenience to users.
MethodTypeDesc.of(ClassDesc) avoids extra array allocation at javac-generated call site. For instance, 18/40 MethodTypeDesc creations inJDK-8294972 are benefitted by this new overload.
MethodTypeDesc.of(ClassDesc, Collection<ClassDesc>) allows users to pass in immutable lists and collections directly. In a future patch, if the passed parameter type collection is an immutable list, MethodTypeDesc.of(ClassDesc, Collection<ClassDesc>) can avoid copying the collection with List::copyOf(Collection), while using arrays always require defensive copying against malicious users.
MethodTypeDesc.of(ClassDesc) avoids extra array allocation at javac-generated call site. For instance, 18/40 MethodTypeDesc creations in
MethodTypeDesc.of(ClassDesc, Collection<ClassDesc>) allows users to pass in immutable lists and collections directly. In a future patch, if the passed parameter type collection is an immutable list, MethodTypeDesc.of(ClassDesc, Collection<ClassDesc>) can avoid copying the collection with List::copyOf(Collection), while using arrays always require defensive copying against malicious users.
- blocks
-
JDK-8306889 Convert MethodTypeDescImpl parameter storage from array to immutable list
-
- Closed
-
- csr for
-
JDK-8306699 Add overloads to MethodTypeDesc::of
-
- Closed
-