Made LanguageServerImpl.supportedMethods volatile

As the parameter is used in a method that has a synchronized block,
it seems like this value can be accessed in a multit-hreaded way.
It should thus be volatile.

Signed-off-by: Titouan Vervack <tivervac@gmail.com>
This commit is contained in:
Titouan Vervack 2020-09-14 13:44:55 +00:00
parent 8e1663e5e2
commit 45409d150d

View file

@ -180,7 +180,7 @@ public class LanguageServerImpl implements LanguageServer, WorkspaceService, Tex
private LanguageClient client;
private Map<String, JsonRpcMethod> supportedMethods;
private volatile Map<String, JsonRpcMethod> supportedMethods;
private final CompletableFuture<InitializedParams> initialized = new CompletableFuture<>();