Skip to content

Commit

Permalink
Fix optimization in MethodType and MethodTypeDesc
Browse files Browse the repository at this point in the history
  • Loading branch information
mpfaff committed Oct 8, 2024
1 parent 64f7728 commit e6b5785
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ public Class<?> returnType() {
* @return the parameter types (as an immutable list)
*/
public List<Class<?>> parameterList() {
return SharedSecrets.getJavaUtilCollectionAccess().listFromTrustedArray(ptypes);
return SharedSecrets.getJavaUtilCollectionAccess().listFromTrustedArray(Arrays.copyOf(ptypes, ptypes.length, Object[].class));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public ClassDesc parameterType(int index) {

@Override
public List<ClassDesc> parameterList() {
return SharedSecrets.getJavaUtilCollectionAccess().listFromTrustedArray(argTypes);
return SharedSecrets.getJavaUtilCollectionAccess().listFromTrustedArray(Arrays.copyOf(argTypes, argTypes.length, Object[].class));
}

@Override
Expand Down

0 comments on commit e6b5785

Please sign in to comment.