File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
client/src/main/java/io/split/client Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 99public class ApiKeyCounter {
1010
1111 private static final Logger _log = LoggerFactory .getLogger (ApiKeyCounter .class );
12- private static ApiKeyCounter _apiKeyCounter ;
1312 private static final Multiset <String > USED_API_KEYS = ConcurrentHashMultiset .create ();
1413
1514
1615 private ApiKeyCounter () {}
1716
18- public static synchronized ApiKeyCounter getApiKeyCounterInstance () {
19- if (_apiKeyCounter == null ) {
20- _apiKeyCounter = new ApiKeyCounter ();
21- }
17+ public static ApiKeyCounter getApiKeyCounterInstance () {
18+ return ApyKeyCounterHolder .INSTANCE ;
19+ }
2220
23- return _apiKeyCounter ;
21+ //Inner class to provide instance of class
22+ private static class ApyKeyCounterHolder
23+ {
24+ private static final ApiKeyCounter INSTANCE = new ApiKeyCounter ();
2425 }
2526
2627 public void add (String apiKey ) {
You can’t perform that action at this time.
0 commit comments