Skip to content

Commit b5d0b46

Browse files
authored
Merge pull request #1 from knecht/clearcache-patch-1
add JsoniterSpi.clearCaches
2 parents fdcb4c7 + aa663e6 commit b5d0b46

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/com/jsoniter/spi/JsoniterSpi.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,15 @@ private synchronized static void addObjectFactory(Class clazz, Extension extensi
292292
objectFactories = copy;
293293
}
294294

295+
public static synchronized void clearCaches() {
296+
mapKeyEncoders = new HashMap<>();
297+
mapKeyDecoders = new HashMap<>();
298+
encoders = new HashMap<>();
299+
decoders = new HashMap<>();
300+
objectFactories = new HashMap<>();
301+
}
302+
303+
295304
private static class TypeProperty {
296305

297306
public final Type type;

0 commit comments

Comments
 (0)