You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2019/11/18 15:07:38 UTC
[dubbo] branch master updated: concurrent cache bug fix (#5043)
This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new 764b110 concurrent cache bug fix (#5043)
764b110 is described below
commit 764b110d445bdbdaecad12741ab7cbe68a40afea
Author: wang <fa...@163.com>
AuthorDate: Mon Nov 18 23:07:25 2019 +0800
concurrent cache bug fix (#5043)
---
.../src/main/java/org/apache/dubbo/common/bytecode/Wrapper.java | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/bytecode/Wrapper.java b/dubbo-common/src/main/java/org/apache/dubbo/common/bytecode/Wrapper.java
index 7f83f97..8f52a34 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/bytecode/Wrapper.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/bytecode/Wrapper.java
@@ -113,12 +113,7 @@ public abstract class Wrapper {
return OBJECT_WRAPPER;
}
- Wrapper ret = WRAPPER_MAP.get(c);
- if (ret == null) {
- ret = makeWrapper(c);
- WRAPPER_MAP.put(c, ret);
- }
- return ret;
+ return WRAPPER_MAP.computeIfAbsent(c, key -> makeWrapper(key));
}
private static Wrapper makeWrapper(Class<?> c) {