Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/java.base/share/classes/java/lang/reflect/Executable.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,12 +25,11 @@

package java.lang.reflect;

import java.lang.annotation.*;
import java.lang.annotation.Annotation;
import java.util.Arrays;
import java.util.Map;
import java.util.Objects;
import java.util.StringJoiner;
import java.util.stream.Stream;
import java.util.stream.Collectors;

import jdk.internal.access.SharedSecrets;
Expand Down Expand Up @@ -315,7 +314,7 @@ Type[] getAllGenericParameterTypes() {
} else {
final boolean realParamData = hasRealParameterData();
final Type[] genericParamTypes = getGenericParameterTypes();
final Type[] nonGenericParamTypes = getParameterTypes();
final Type[] nonGenericParamTypes = getSharedParameterTypes();
// If we have real parameter data, then we use the
// synthetic and mandate flags to our advantage.
if (realParamData) {
Expand All @@ -342,7 +341,7 @@ Type[] getAllGenericParameterTypes() {
// synthetic/mandated, thus, no way to match up the
// indexes.
return genericParamTypes.length == nonGenericParamTypes.length ?
genericParamTypes : nonGenericParamTypes;
genericParamTypes : getParameterTypes();
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/java.base/share/classes/java/lang/reflect/Parameter.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -219,7 +219,7 @@ public Type getParameterizedType() {
public Class<?> getType() {
Class<?> tmp = parameterClassCache;
if (null == tmp) {
tmp = executable.getParameterTypes()[index];
tmp = executable.getSharedParameterTypes()[index];
parameterClassCache = tmp;
}
return tmp;
Expand Down
2 changes: 1 addition & 1 deletion src/java.base/share/classes/java/lang/reflect/Proxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ private static Class<?> findProxyInterfaceOrElseThrow(Class<?> proxyClass, Metho
// check if this method is the resolved method if referenced from
// this proxy interface (i.e. this method is not implemented
// by any other superinterface)
Method m = proxyIntf.getMethod(method.getName(), method.getParameterTypes());
Method m = proxyIntf.getMethod(method.getName(), method.getSharedParameterTypes());
if (m.getDeclaringClass() == declaringClass) {
return proxyIntf;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ private byte[] generateClassFile() {
*/
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,
Expand All @@ -544,7 +544,7 @@ private void addProxyMethod(Method m, Class<?> fromClass) {
return;
}
}
sigmethods.add(new ProxyMethod(m, sig, m.getParameterTypes(), returnType,
sigmethods.add(new ProxyMethod(m, sig, m.getSharedParameterTypes(), returnType,
exceptionTypes, fromClass,
"m" + proxyMethodCount++));
}
Expand Down Expand Up @@ -717,8 +717,8 @@ private ProxyMethod(Method method, String sig, Class<?>[] parameterTypes,
*/
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);
}

/**
Expand Down