Skip to content

Conversation

@harawata
Copy link
Member

@harawata harawata commented Apr 9, 2021

This is a workaround for JDK-8161372.

Related to ...

We should drop this workaround once we drop Java 8 support (or the fix is backported).

…fAbsent()

This is a workaround for JDK-8161372

mybatis#1929
https://groups.google.com/g/mybatis-user/c/iBTN98c0dP4/m/H6IJS-LzAQAJ

We should drop this workaround once we drop Java 8 support or the fix is backported.
@harawata harawata added the bug on dependency library Indicates a bug on dependency library label Apr 9, 2021
@harawata harawata added this to the 3.5.7 milestone Apr 9, 2021
@harawata harawata self-assigned this Apr 9, 2021
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.008%) to 87.248% when pulling 2fc8ec0 on harawata:workaround-jdk-8161372 into f6caf12 on mybatis:master.

@harawata harawata merged commit 0262a99 into mybatis:master Apr 9, 2021
if (value != null) {
return value;
}
return map.computeIfAbsent(key, mappingFunction::apply);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just use mappingFunction ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ComputeIfAbsent blocks when multiple threads obtain the same key. I think it's to improve performance. https://bugs.openjdk.java.net/browse/JDK-8161372

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug on dependency library Indicates a bug on dependency library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants