Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A temporary workaround for Java 8 specific ConcurrentHashMap issue JDK-8161372 #1934

Merged
merged 1 commit into from May 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/main/java/org/apache/ibatis/binding/MapperProxy.java
Expand Up @@ -91,6 +91,14 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl

private MapperMethodInvoker cachedInvoker(Method method) throws Throwable {
try {
// A workaround for https://bugs.openjdk.java.net/browse/JDK-8161372
// It should be removed once the fix is backported to Java 8 or
// MyBatis drops Java 8 support. See gh-1929
MapperMethodInvoker invoker = methodCache.get(method);
if (invoker != null) {
return invoker;
}

return methodCache.computeIfAbsent(method, m -> {
if (m.isDefault()) {
try {
Expand Down