2020import java .util .Map ;
2121import java .util .Set ;
2222import java .util .concurrent .CopyOnWriteArraySet ;
23- import java .util .concurrent .atomic .AtomicBoolean ;
2423import java .util .regex .Pattern ;
2524
2625@ SuppressWarnings ("visibilitymodifier" )
@@ -47,8 +46,8 @@ public class Configuration {
4746 private Serializer serializer = new DefaultSerializer ();
4847
4948 Set <OnErrorCallback > callbacks = new CopyOnWriteArraySet <>();
50- private final AtomicBoolean autoCaptureSessions = new AtomicBoolean ( true ) ;
51- private final AtomicBoolean sendUncaughtExceptions = new AtomicBoolean ( true ) ;
49+ private volatile boolean autoCaptureSessions = true ;
50+ private volatile boolean sendUncaughtExceptions = true ;
5251 private final FeatureFlagStore featureFlagStore = new FeatureFlagStore ();
5352
5453 Configuration (String apiKey ) {
@@ -105,19 +104,19 @@ boolean inProject(String className) {
105104 }
106105
107106 public void setAutoCaptureSessions (boolean autoCaptureSessions ) {
108- this .autoCaptureSessions . set ( autoCaptureSessions ) ;
107+ this .autoCaptureSessions = autoCaptureSessions ;
109108 }
110109
111110 public boolean shouldAutoCaptureSessions () {
112- return autoCaptureSessions . get () ;
111+ return autoCaptureSessions ;
113112 }
114113
115114 public void setSendUncaughtExceptions (boolean sendUncaughtExceptions ) {
116- this .sendUncaughtExceptions . set ( sendUncaughtExceptions ) ;
115+ this .sendUncaughtExceptions = sendUncaughtExceptions ;
117116 }
118117
119118 public boolean shouldSendUncaughtExceptions () {
120- return sendUncaughtExceptions . get () ;
119+ return sendUncaughtExceptions ;
121120 }
122121
123122 /**
@@ -165,10 +164,10 @@ public void setEndpoints(EndpointConfiguration endpointConfiguration) throws Ill
165164 boolean invalidSessionsEndpoint = sessions == null || sessions .isEmpty ();
166165 String sessionEndpoint = null ;
167166
168- if (invalidSessionsEndpoint && this .autoCaptureSessions . get () ) {
167+ if (invalidSessionsEndpoint && this .autoCaptureSessions ) {
169168 LOGGER .warn ("The session tracking endpoint has not been"
170169 + " set. Session tracking is disabled" );
171- this .autoCaptureSessions . set ( false ) ;
170+ this .autoCaptureSessions = false ;
172171 } else {
173172 sessionEndpoint = sessions ;
174173 }
0 commit comments