8287908: Use non-cloning reflection methods where acceptable

Reviewed-by: rriggs
This commit is contained in:
Sergey Tsypanov 2022-09-12 13:31:53 +00:00 committed by Roger Riggs
parent 0c61bf109f
commit 9ef6c0925a
4 changed files with 9 additions and 9 deletions

View file

@ -522,7 +522,7 @@ final class ProxyGenerator extends ClassWriter {
*/
private void addProxyMethod(Method m, Class<?> fromClass) {
Class<?> returnType = m.getReturnType();
Class<?>[] exceptionTypes = m.getExceptionTypes();
Class<?>[] exceptionTypes = m.getSharedExceptionTypes();
String sig = m.toShortSignature();
List<ProxyMethod> sigmethods = proxyMethods.computeIfAbsent(sig,
@ -544,7 +544,7 @@ final class ProxyGenerator extends ClassWriter {
return;
}
}
sigmethods.add(new ProxyMethod(m, sig, m.getParameterTypes(), returnType,
sigmethods.add(new ProxyMethod(m, sig, m.getSharedParameterTypes(), returnType,
exceptionTypes, fromClass,
"m" + proxyMethodCount++));
}
@ -717,8 +717,8 @@ final class ProxyGenerator extends ClassWriter {
*/
private ProxyMethod(Method method, String methodFieldName) {
this(method, method.toShortSignature(),
method.getParameterTypes(), method.getReturnType(),
method.getExceptionTypes(), method.getDeclaringClass(), methodFieldName);
method.getSharedParameterTypes(), method.getReturnType(),
method.getSharedExceptionTypes(), method.getDeclaringClass(), methodFieldName);
}
/**