Revert workaround for Java 8 ConcurrentHashMap bug.

Closes #3060
This commit is contained in:
Mark Paluch
2024-03-07 16:07:24 +01:00
parent c38fcccc12
commit 8dbfb9a6ab
2 changed files with 2 additions and 13 deletions

View File

@@ -536,11 +536,7 @@ public class CustomConversions {
public Class<?> computeIfAbsent(Class<?> sourceType, Class<?> targetType,
Function<ConvertiblePair, Class<?>> mappingFunction) {
TargetTypes targetTypes = customReadTargetTypes.get(sourceType);
if (targetTypes == null) {
targetTypes = customReadTargetTypes.computeIfAbsent(sourceType, TargetTypes::new);
}
TargetTypes targetTypes = customReadTargetTypes.computeIfAbsent(sourceType, TargetTypes::new);
return targetTypes.computeIfAbsent(targetType, mappingFunction);
}

View File

@@ -124,14 +124,7 @@ public class DefaultTypeMapper<S> implements TypeMapper<S>, BeanClassLoaderAware
*/
@Nullable
private TypeInformation<?> getFromCacheOrCreate(Alias alias) {
Optional<TypeInformation<?>> typeInformation = typeCache.get(alias);
if (typeInformation == null) {
typeInformation = typeCache.computeIfAbsent(alias, getAlias);
}
return typeInformation.orElse(null);
return typeCache.computeIfAbsent(alias, getAlias).orElse(null);
}
@Override