Skip to content

Commit 7a87450

Browse files
committed
Fixes comparison to use equality instead of reference.
TypeInformation.OBJECT must not be compared by reference since TypeInformation instances come form a LRU cache and if TypeInformation.OBJECT gets evicted future instances might be equal, but won't have the same reference. Closes #2083
1 parent f792da2 commit 7a87450

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-data-relational/src/main/java/org/springframework/data/relational/core/conversion/MappingRelationalConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ public Object writeValue(@Nullable Object value, TypeInformation<?> type) {
706706
return getConversionService().convert(value, customWriteTarget.get());
707707
}
708708

709-
if (TypeInformation.OBJECT != type) {
709+
if (!TypeInformation.OBJECT.equals(type)) {
710710

711711
if (type.getType().isAssignableFrom(value.getClass())) {
712712

0 commit comments

Comments
 (0)