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:
David Pursehouse 2018-08-28 17:31:37 +09:00
parent 7b7c4d318a
commit 63899d219e

View File

@ -40,7 +40,7 @@ class ElasticRestClientProvider implements Provider<RestClient>, LifecycleListen
private final ElasticConfiguration cfg; private final ElasticConfiguration cfg;
private RestClient client; private volatile RestClient client;
private ElasticQueryAdapter adapter; private ElasticQueryAdapter adapter;
@Inject @Inject