Skip to content

Commit 0578116

Browse files
committed
Add release notes wrt #4953, minor tweaks
1 parent a1f50eb commit 0578116

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

release-notes/CREDITS-2.x

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,3 +1909,7 @@ Floris Westerman (@FWest98)
19091909
* Reported #4934: `DeserializationContext.readTreeAsValue()` handles null nodes
19101910
differently from `ObjectMapper.treeToValue()`
19111911
(2.19.0)
1912+
1913+
Joren Inghelbrecht (@jin-harmoney)
1914+
* Contributed #4953: Allow clearing all caches to avoid classloader leaks
1915+
(2.19.0)

release-notes/VERSION-2.x

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ Project: jackson-databind
4646
#4934: `DeserializationContext.readTreeAsValue()` handles null nodes
4747
differently from `ObjectMapper.treeToValue()`
4848
(reported by Floris W)
49+
#4953: Allow clearing all caches to avoid classloader leaks
50+
(contributed by Joren I)
4951
5052
2.18.3 (not yet released)
5153

src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4796,17 +4796,18 @@ public void acceptJsonFormatVisitor(JavaType type, JsonFormatVisitorWrapper visi
47964796
*/
47974797

47984798
/**
4799-
* Method that will clear all caches.
4800-
* This can be used to remove memory usage or to force re-construction cached entries after configuration changes.
4801-
* Can also be used to avoid class-loader memory leaks when reloading applications.
4802-
4799+
* Method that will clear all caches this mapper owns.
4800+
*<p>
4801+
* This method should not be needed in normal operation, but may be
4802+
* useful to avoid class-loader memory leaks when reloading applications.
4803+
*
48034804
* @since 2.19
48044805
*/
48054806
public void clearCaches() {
48064807
_rootDeserializers.clear();
4807-
getTypeFactory().clearCache();
4808-
getDeserializationContext().flushCachedDeserializers();
4809-
getSerializerProvider().flushCachedSerializers();
4808+
_typeFactory.clearCache();
4809+
_deserializationContext.flushCachedDeserializers();
4810+
_serializerProvider.flushCachedSerializers();
48104811
}
48114812

48124813
/*

0 commit comments

Comments
 (0)