You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use StringUtils.replace(…) instead of String.replaceAll(…) for mapKeyDotReplacement.
We now use StringUtils.replace(…) to replace the map key dot in MappingMongoConverter. StringUtils perform a plain search instead of using Regex which improves the overall performance.
Closes#3613
Copy file name to clipboardExpand all lines: spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MappingMongoConverter.java
+6-2
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,7 @@
78
78
importorg.springframework.util.ClassUtils;
79
79
importorg.springframework.util.CollectionUtils;
80
80
importorg.springframework.util.ObjectUtils;
81
+
importorg.springframework.util.StringUtils;
81
82
82
83
importcom.mongodb.BasicDBList;
83
84
importcom.mongodb.BasicDBObject;
@@ -206,6 +207,9 @@ public MongoTypeMapper getTypeMapper() {
206
207
* any translation but rather reject a {@link Map} with keys containing dots causing the conversion for the entire
207
208
* object to fail. If further customization of the translation is needed, have a look at
208
209
* {@link #potentiallyEscapeMapKey(String)} as well as {@link #potentiallyUnescapeMapKey(String)}.
210
+
* <p>
211
+
* {@code mapKeyDotReplacement} is used as-is during replacement operations without further processing (i.e. regex or
212
+
* normalization).
209
213
*
210
214
* @param mapKeyDotReplacement the mapKeyDotReplacement to set. Can be {@literal null}.
0 commit comments