File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
src/main/java/com/fasterxml/jackson/databind/ser Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public final class SerializerCache
33
33
/**
34
34
* Most recent read-only instance, created from _sharedMap, if any.
35
35
*/
36
- private ReadOnlyClassToSerializerMap _readOnlyMap = null ;
36
+ private volatile ReadOnlyClassToSerializerMap _readOnlyMap = null ;
37
37
38
38
public SerializerCache () { }
39
39
@@ -43,11 +43,13 @@ public SerializerCache() { }
43
43
*/
44
44
public ReadOnlyClassToSerializerMap getReadOnlyLookupMap ()
45
45
{
46
- ReadOnlyClassToSerializerMap m ;
47
- synchronized (this ) {
48
- m = _readOnlyMap ;
49
- if (m == null ) {
50
- _readOnlyMap = m = ReadOnlyClassToSerializerMap .from (_sharedMap );
46
+ ReadOnlyClassToSerializerMap m = _readOnlyMap ;
47
+ if (m == null ) {
48
+ synchronized (this ) {
49
+ m = _readOnlyMap ;
50
+ if (m == null ) {
51
+ _readOnlyMap = m = ReadOnlyClassToSerializerMap .from (_sharedMap );
52
+ }
51
53
}
52
54
}
53
55
return m .instance ();
You can’t perform that action at this time.
0 commit comments