Skip to content

Commit 7a318a9

Browse files
authored
Merge pull request #1934 from harawata/gh/1929-fix
A temporary workaround for Java 8 specific ConcurrentHashMap issue JDK-8161372
2 parents 63785f2 + beee143 commit 7a318a9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/org/apache/ibatis/binding/MapperProxy.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
9191

9292
private MapperMethodInvoker cachedInvoker(Method method) throws Throwable {
9393
try {
94+
// A workaround for https://bugs.openjdk.java.net/browse/JDK-8161372
95+
// It should be removed once the fix is backported to Java 8 or
96+
// MyBatis drops Java 8 support. See gh-1929
97+
MapperMethodInvoker invoker = methodCache.get(method);
98+
if (invoker != null) {
99+
return invoker;
100+
}
101+
94102
return methodCache.computeIfAbsent(method, m -> {
95103
if (m.isDefault()) {
96104
try {

0 commit comments

Comments
 (0)