zrlw commented on code in PR #15164:
URL: https://github.com/apache/dubbo/pull/15164#discussion_r1974696641
##########
dubbo-common/src/main/java/org/apache/dubbo/common/bytecode/Wrapper.java:
##########
@@ -112,16 +112,17 @@ public Object invokeMethod(Object instance, String mn,
Class<?>[] types, Object[
* @return Wrapper instance(not null).
*/
public static Wrapper getWrapper(Class<?> c) {
- while (ClassGenerator.isDynamicClass(c)) // can not wrapper on dynamic
class.
- {
- c = c.getSuperclass();
- }
-
- if (c == Object.class) {
- return OBJECT_WRAPPER;
- }
+ return ConcurrentHashMapUtils.computeIfAbsent(WRAPPER_MAP, c, (clazz)
-> {
+ while (ClassGenerator.isDynamicClass(clazz)) // can not wrapper on
dynamic class.
+ {
+ clazz = clazz.getSuperclass();
+ }
- return ConcurrentHashMapUtils.computeIfAbsent(WRAPPER_MAP, c,
Wrapper::makeWrapper);
+ if (clazz == Object.class) {
+ return OBJECT_WRAPPER;
+ }
+ return makeWrapper(clazz);
+ });
Review Comment:
> Why change this?
it desn't matter, i just thought dynamic class should not be checked every
time for wrapping.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]