Merge branch 'stable-2.14' into stable-2.15
* stable-2.14: ElasticRestClientProvider: Make client field volatile AbstractElasticIndexer: Specify charset for InputStreamReader SshCommandsIT: Use immutable type for constant field declarations rest-api-config.txt: Fix monospace `plugin` Change-Id: I4dbc4d1876c10ec1cc79a490c86082aa46999163
This commit is contained in:
commit
50acf00ad7
|
@ -26,7 +26,6 @@ import com.google.gerrit.acceptance.UseSsh;
|
||||||
import com.google.gerrit.common.data.GlobalCapability;
|
import com.google.gerrit.common.data.GlobalCapability;
|
||||||
import com.google.gerrit.sshd.Commands;
|
import com.google.gerrit.sshd.Commands;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -37,7 +36,7 @@ public class SshCommandsIT extends AbstractDaemonTest {
|
||||||
private static final Logger log = LoggerFactory.getLogger(SshCommandsIT.class);
|
private static final Logger log = LoggerFactory.getLogger(SshCommandsIT.class);
|
||||||
|
|
||||||
// TODO: It would be better to dynamically generate this list
|
// TODO: It would be better to dynamically generate this list
|
||||||
private static final Map<String, List<String>> COMMANDS =
|
private static final ImmutableMap<String, List<String>> COMMANDS =
|
||||||
ImmutableMap.of(
|
ImmutableMap.of(
|
||||||
Commands.ROOT,
|
Commands.ROOT,
|
||||||
ImmutableList.of(
|
ImmutableList.of(
|
||||||
|
|
|
@ -73,7 +73,7 @@ abstract class AbstractElasticIndex<K, V> implements Index<K, V> {
|
||||||
String content = "";
|
String content = "";
|
||||||
if (responseEntity != null) {
|
if (responseEntity != null) {
|
||||||
InputStream contentStream = responseEntity.getContent();
|
InputStream contentStream = responseEntity.getContent();
|
||||||
try (Reader reader = new InputStreamReader(contentStream)) {
|
try (Reader reader = new InputStreamReader(contentStream, UTF_8)) {
|
||||||
content = CharStreams.toString(reader);
|
content = CharStreams.toString(reader);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue