Skip to content

Commit 8dbfb9a

Browse files
committed
Revert workaround for Java 8 ConcurrentHashMap bug.
Closes #3060
1 parent c38fccc commit 8dbfb9a

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

src/main/java/org/springframework/data/convert/CustomConversions.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,7 @@ public Class<?> computeIfAbsent(Class<?> sourceType, Function<ConvertiblePair, C
536536
public Class<?> computeIfAbsent(Class<?> sourceType, Class<?> targetType,
537537
Function<ConvertiblePair, Class<?>> mappingFunction) {
538538

539-
TargetTypes targetTypes = customReadTargetTypes.get(sourceType);
540-
541-
if (targetTypes == null) {
542-
targetTypes = customReadTargetTypes.computeIfAbsent(sourceType, TargetTypes::new);
543-
}
539+
TargetTypes targetTypes = customReadTargetTypes.computeIfAbsent(sourceType, TargetTypes::new);
544540

545541
return targetTypes.computeIfAbsent(targetType, mappingFunction);
546542
}

src/main/java/org/springframework/data/convert/DefaultTypeMapper.java

+1-8
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,7 @@ public TypeInformation<?> readType(S source) {
124124
*/
125125
@Nullable
126126
private TypeInformation<?> getFromCacheOrCreate(Alias alias) {
127-
128-
Optional<TypeInformation<?>> typeInformation = typeCache.get(alias);
129-
130-
if (typeInformation == null) {
131-
typeInformation = typeCache.computeIfAbsent(alias, getAlias);
132-
}
133-
134-
return typeInformation.orElse(null);
127+
return typeCache.computeIfAbsent(alias, getAlias).orElse(null);
135128
}
136129

137130
@Override

0 commit comments

Comments
 (0)