8278461: Use Executable.getSharedParameterTypes() instead of Executable.getParameterTypes() in trusted code

Reviewed-by: redestad
This commit is contained in:
Sergey Tsypanov 2022-01-12 10:16:37 +00:00 committed by Claes Redestad
parent 525b20fce0
commit ece98d859d
2 changed files with 2 additions and 2 deletions

View File

@ -371,7 +371,7 @@ public final class Constructor<T> extends Executable {
sb.append(getDeclaringClass().getTypeName());
sb.append('(');
StringJoiner sj = new StringJoiner(",");
for (Class<?> parameterType : getParameterTypes()) {
for (Class<?> parameterType : getSharedParameterTypes()) {
sj.add(parameterType.getTypeName());
}
sb.append(sj);

View File

@ -431,7 +431,7 @@ public final class Method extends Executable {
String toShortSignature() {
StringJoiner sj = new StringJoiner(",", getName() + "(", ")");
for (Class<?> parameterType : getParameterTypes()) {
for (Class<?> parameterType : getSharedParameterTypes()) {
sj.add(parameterType.getTypeName());
}
return sj.toString();