25
25
import org .jboss .jandex .MethodInfo ;
26
26
import org .jboss .jandex .Type ;
27
27
import org .jboss .jandex .Type .Kind ;
28
- import org .jboss .jandex .TypeVariable ;
29
28
import org .jboss .logging .Logger ;
30
29
import org .objectweb .asm .ClassVisitor ;
31
30
import org .objectweb .asm .Opcodes ;
@@ -68,18 +67,7 @@ static void addDelegatingMethods(IndexView index, ClassInfo classInfo, Map<Metho
68
67
if (skipForClientProxy (method , transformUnproxyableClasses , methodsFromWhichToRemoveFinal )) {
69
68
continue ;
70
69
}
71
- methods .computeIfAbsent (new Methods .MethodKey (method ), key -> {
72
- // If parameterized try to resolve the type variables
73
- Type returnType = key .method .returnType ();
74
- Type [] params = new Type [key .method .parametersCount ()];
75
- for (int i = 0 ; i < params .length ; i ++) {
76
- params [i ] = key .method .parameterType (i );
77
- }
78
- List <TypeVariable > typeVariables = key .method .typeParameters ();
79
- return MethodInfo .create (classInfo , key .method .name (), params , returnType , key .method .flags (),
80
- typeVariables .toArray (new TypeVariable [] {}),
81
- key .method .exceptions ().toArray (Type .EMPTY_ARRAY ));
82
- });
70
+ methods .putIfAbsent (new Methods .MethodKey (method ), method );
83
71
}
84
72
// Methods declared on superclasses
85
73
if (classInfo .superClassType () != null ) {
@@ -106,11 +94,12 @@ private static boolean skipForClientProxy(MethodInfo method, boolean transformUn
106
94
if (Modifier .isStatic (method .flags ()) || Modifier .isPrivate (method .flags ())) {
107
95
return true ;
108
96
}
109
- if (IGNORED_METHODS .contains (method .name ())) {
97
+ String methodName = method .name ();
98
+ if (IGNORED_METHODS .contains (methodName )) {
110
99
return true ;
111
100
}
112
101
// skip all Object methods except for toString()
113
- if (method .declaringClass ().name ().equals (DotNames .OBJECT ) && !method . name () .equals (TO_STRING )) {
102
+ if (method .declaringClass ().name ().equals (DotNames .OBJECT ) && !methodName .equals (TO_STRING )) {
114
103
return true ;
115
104
}
116
105
if (Modifier .isFinal (method .flags ())) {
@@ -124,13 +113,13 @@ private static boolean skipForClientProxy(MethodInfo method, boolean transformUn
124
113
// in case we want to transform classes but are unable to, we log a WARN
125
114
LOGGER .warn (String .format (
126
115
"Final method %s.%s() is ignored during proxy generation and should never be invoked upon the proxy instance!" ,
127
- className , method . name () ));
116
+ className , methodName ));
128
117
} else {
129
118
// JDK classes with final method are not proxyable and not transformable, we skip those methods and log a WARN
130
119
LOGGER .warn (String .format (
131
120
"JDK class %s with final method %s() cannot be proxied and is not transformable. " +
132
121
"This method will be ignored during proxy generation and should never be invoked upon the proxy instance!" ,
133
- className , method . name () ));
122
+ className , methodName ));
134
123
}
135
124
return true ;
136
125
}
0 commit comments