mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8334437: De-duplicate ProxyMethod list creation
Reviewed-by: asotona, liach
This commit is contained in:
parent
8591eff78d
commit
5883a20b82
1 changed files with 6 additions and 6 deletions
|
@ -508,8 +508,7 @@ final class ProxyGenerator {
|
|||
Class<?>[] exceptionTypes = m.getSharedExceptionTypes();
|
||||
|
||||
String sig = m.toShortSignature();
|
||||
List<ProxyMethod> sigmethods = proxyMethods.computeIfAbsent(sig,
|
||||
_ -> new ArrayList<>(3));
|
||||
List<ProxyMethod> sigmethods = proxyMethodsFor(sig);
|
||||
for (ProxyMethod pm : sigmethods) {
|
||||
if (returnType == pm.returnType) {
|
||||
/*
|
||||
|
@ -531,16 +530,17 @@ final class ProxyGenerator {
|
|||
exceptionTypes, fromClass, "m" + proxyMethodCount++));
|
||||
}
|
||||
|
||||
private List<ProxyMethod> proxyMethodsFor(String sig) {
|
||||
return proxyMethods.computeIfAbsent(sig, _ -> new ArrayList<>(3));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an existing ProxyMethod (hashcode, equals, toString).
|
||||
*
|
||||
* @param pm an existing ProxyMethod
|
||||
*/
|
||||
private void addProxyMethod(ProxyMethod pm) {
|
||||
String sig = pm.shortSignature;
|
||||
List<ProxyMethod> sigmethods = proxyMethods.computeIfAbsent(sig,
|
||||
_ -> new ArrayList<>(3));
|
||||
sigmethods.add(pm);
|
||||
proxyMethodsFor(pm.shortSignature).add(pm);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue