Handle case when system property access is restricted
@@ -36,9 +36,12 @@ public class BufferRecyclers
*/
private final static ThreadLocalBufferManager _bufferRecyclerTracker;
static {
- _bufferRecyclerTracker = "true".equals(System.getProperty(SYSTEM_PROPERTY_TRACK_REUSABLE_BUFFERS))
- ? ThreadLocalBufferManager.instance()
- : null;
+ boolean trackReusableBuffers = false;
+ try {
+ trackReusableBuffers = "true".equals(System.getProperty(SYSTEM_PROPERTY_TRACK_REUSABLE_BUFFERS));
+ } catch (SecurityException e) { }
+
+ _bufferRecyclerTracker = trackReusableBuffers ? ThreadLocalBufferManager.instance() : null;
}
/*
