ElasticRestClientProvider: Make client field volatile
ErrorProne reports a warning [1] that double-checked locking on non-volatile fields is unsafe. [1] http://errorprone.info/bugpattern/DoubleCheckedLocking Change-Id: I4277a4910bd93fab9f072323a69bbf19472eb590
This commit is contained in:
parent
7b7c4d318a
commit
63899d219e
@ -40,7 +40,7 @@ class ElasticRestClientProvider implements Provider<RestClient>, LifecycleListen
|
||||
|
||||
private final ElasticConfiguration cfg;
|
||||
|
||||
private RestClient client;
|
||||
private volatile RestClient client;
|
||||
private ElasticQueryAdapter adapter;
|
||||
|
||||
@Inject
|
||||
|
Loading…
Reference in New Issue
Block a user