Skip to content

Commit da5950d

Browse files
committed
Merge branch '2.9' into 2.10
2 parents 0c26e7e + 79ed860 commit da5950d

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

release-notes/VERSION-2.x

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ JSON library.
1414
=== Releases ===
1515
------------------------------------------------------------------------
1616

17+
2.10.4 (not yet released)
18+
19+
#605: Handle case when system property access is restricted
20+
(reported by rhernandez35@github)
21+
1722
2.10.3 (03-Mar-2020)
1823

1924
#592: DataFormatMatcher#getMatchedFormatName throws NPE when no match exists

src/main/java/com/fasterxml/jackson/core/util/BufferRecyclers.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* Helper entity used to control access to simple buffer recyling scheme used for
77
* some encoding, decoding tasks.
8-
*
8+
*
99
* @see BufferRecycler
1010
*
1111
* @since 2.9.2
@@ -33,10 +33,13 @@ public class BufferRecyclers
3333
*/
3434
private final static ThreadLocalBufferManager _bufferRecyclerTracker;
3535
static {
36-
_bufferRecyclerTracker = "true".equals(System.getProperty(SYSTEM_PROPERTY_TRACK_REUSABLE_BUFFERS))
37-
? ThreadLocalBufferManager.instance()
38-
: null;
39-
}
36+
boolean trackReusableBuffers = false;
37+
try {
38+
trackReusableBuffers = "true".equals(System.getProperty(SYSTEM_PROPERTY_TRACK_REUSABLE_BUFFERS));
39+
} catch (SecurityException e) { }
40+
41+
_bufferRecyclerTracker = trackReusableBuffers ? ThreadLocalBufferManager.instance() : null;
42+
}
4043

4144
/*
4245
/**********************************************************

0 commit comments

Comments
 (0)