Merge pull request #13410 from rjernst/you_were_warned
Fix compiler warnings
This commit is contained in:
commit
9d71f0726e
|
@ -15,6 +15,10 @@
|
||||||
<name>Elasticsearch: Core</name>
|
<name>Elasticsearch: Core</name>
|
||||||
<description>Elasticsearch - Open Source, Distributed, RESTful Search Engine</description>
|
<description>Elasticsearch - Open Source, Distributed, RESTful Search Engine</description>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<xlint.options>-Xlint:-cast,-deprecation,-fallthrough,-overrides,-rawtypes,-serial,-try,-unchecked</xlint.options>
|
||||||
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hamcrest</groupId>
|
<groupId>org.hamcrest</groupId>
|
||||||
|
|
|
@ -36,6 +36,8 @@ import org.elasticsearch.node.settings.NodeSettingsService;
|
||||||
import org.elasticsearch.threadpool.ThreadPool;
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
import org.elasticsearch.transport.TransportService;
|
import org.elasticsearch.transport.TransportService;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close index action
|
* Close index action
|
||||||
*/
|
*/
|
||||||
|
@ -92,7 +94,7 @@ public class TransportCloseIndexAction extends TransportMasterNodeAction<CloseIn
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable t) {
|
public void onFailure(Throwable t) {
|
||||||
logger.debug("failed to close indices [{}]", t, concreteIndices);
|
logger.debug("failed to close indices [{}]", t, (Object)concreteIndices);
|
||||||
listener.onFailure(t);
|
listener.onFailure(t);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -36,6 +36,8 @@ import org.elasticsearch.node.settings.NodeSettingsService;
|
||||||
import org.elasticsearch.threadpool.ThreadPool;
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
import org.elasticsearch.transport.TransportService;
|
import org.elasticsearch.transport.TransportService;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open index action
|
* Open index action
|
||||||
*/
|
*/
|
||||||
|
@ -92,7 +94,7 @@ public class TransportOpenIndexAction extends TransportMasterNodeAction<OpenInde
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable t) {
|
public void onFailure(Throwable t) {
|
||||||
logger.debug("failed to open indices [{}]", t, concreteIndices);
|
logger.debug("failed to open indices [{}]", t, (Object)concreteIndices);
|
||||||
listener.onFailure(t);
|
listener.onFailure(t);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -35,6 +35,8 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.threadpool.ThreadPool;
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
import org.elasticsearch.transport.TransportService;
|
import org.elasticsearch.transport.TransportService;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -90,7 +92,7 @@ public class TransportUpdateSettingsAction extends TransportMasterNodeAction<Upd
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable t) {
|
public void onFailure(Throwable t) {
|
||||||
logger.debug("failed to update settings on indices [{}]", t, concreteIndices);
|
logger.debug("failed to update settings on indices [{}]", t, (Object)concreteIndices);
|
||||||
listener.onFailure(t);
|
listener.onFailure(t);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -668,6 +668,7 @@ public class IndexNameExpressionResolver extends AbstractComponent {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
String resolveExpression(String expression, final Context context) {
|
String resolveExpression(String expression, final Context context) {
|
||||||
if (expression.startsWith(EXPRESSION_LEFT_BOUND) == false || expression.endsWith(EXPRESSION_RIGHT_BOUND) == false) {
|
if (expression.startsWith(EXPRESSION_LEFT_BOUND) == false || expression.endsWith(EXPRESSION_RIGHT_BOUND) == false) {
|
||||||
return expression;
|
return expression;
|
||||||
|
|
|
@ -30,6 +30,7 @@ import org.elasticsearch.common.inject.TypeLiteral;
|
||||||
* @param <I> the injectable type encountered
|
* @param <I> the injectable type encountered
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("overloads")
|
||||||
public interface TypeEncounter<I> {
|
public interface TypeEncounter<I> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class NodeEnvironment extends AbstractComponent implements Closeable {
|
||||||
public NodePath(Path path, Environment environment) throws IOException {
|
public NodePath(Path path, Environment environment) throws IOException {
|
||||||
this.path = path;
|
this.path = path;
|
||||||
this.indicesPath = path.resolve(INDICES_FOLDER);
|
this.indicesPath = path.resolve(INDICES_FOLDER);
|
||||||
this.fileStore = environment.getFileStore(path);
|
this.fileStore = Environment.getFileStore(path);
|
||||||
if (fileStore.supportsFileAttributeView("lucene")) {
|
if (fileStore.supportsFileAttributeView("lucene")) {
|
||||||
this.spins = (Boolean) fileStore.getAttribute("lucene:spins");
|
this.spins = (Boolean) fileStore.getAttribute("lucene:spins");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -33,6 +33,7 @@ import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.env.NodeEnvironment;
|
import org.elasticsearch.env.NodeEnvironment;
|
||||||
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -171,7 +172,7 @@ public class Gateway extends AbstractComponent implements ClusterStateListener {
|
||||||
public void reset() throws Exception {
|
public void reset() throws Exception {
|
||||||
try {
|
try {
|
||||||
Path[] dataPaths = nodeEnv.nodeDataPaths();
|
Path[] dataPaths = nodeEnv.nodeDataPaths();
|
||||||
logger.trace("removing node data paths: [{}]", dataPaths);
|
logger.trace("removing node data paths: [{}]", (Object)dataPaths);
|
||||||
IOUtils.rm(dataPaths);
|
IOUtils.rm(dataPaths);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
logger.debug("failed to delete shard locations", ex);
|
logger.debug("failed to delete shard locations", ex);
|
||||||
|
|
|
@ -59,6 +59,7 @@ public class SingleFieldsVisitor extends FieldsVisitor {
|
||||||
|
|
||||||
public void postProcess(MappedFieldType fieldType) {
|
public void postProcess(MappedFieldType fieldType) {
|
||||||
if (uid != null) {
|
if (uid != null) {
|
||||||
|
// TODO: this switch seems very wrong...either each case should be breaking, or this should not be a switch
|
||||||
switch (field) {
|
switch (field) {
|
||||||
case UidFieldMapper.NAME: addValue(field, uid.toString());
|
case UidFieldMapper.NAME: addValue(field, uid.toString());
|
||||||
case IdFieldMapper.NAME: addValue(field, uid.id());
|
case IdFieldMapper.NAME: addValue(field, uid.id());
|
||||||
|
|
|
@ -77,10 +77,10 @@ public class IndicesQueryParser implements QueryParser {
|
||||||
currentFieldName = parser.currentName();
|
currentFieldName = parser.currentName();
|
||||||
} else if (token == XContentParser.Token.START_OBJECT) {
|
} else if (token == XContentParser.Token.START_OBJECT) {
|
||||||
if (parseContext.parseFieldMatcher().match(currentFieldName, QUERY_FIELD)) {
|
if (parseContext.parseFieldMatcher().match(currentFieldName, QUERY_FIELD)) {
|
||||||
innerQuery = new XContentStructure.InnerQuery(parseContext, null);
|
innerQuery = new XContentStructure.InnerQuery(parseContext, (String[])null);
|
||||||
queryFound = true;
|
queryFound = true;
|
||||||
} else if (parseContext.parseFieldMatcher().match(currentFieldName, NO_MATCH_QUERY)) {
|
} else if (parseContext.parseFieldMatcher().match(currentFieldName, NO_MATCH_QUERY)) {
|
||||||
innerNoMatchQuery = new XContentStructure.InnerQuery(parseContext, null);
|
innerNoMatchQuery = new XContentStructure.InnerQuery(parseContext, (String[])null);
|
||||||
} else {
|
} else {
|
||||||
throw new QueryParsingException(parseContext, "[indices] query does not support [" + currentFieldName + "]");
|
throw new QueryParsingException(parseContext, "[indices] query does not support [" + currentFieldName + "]");
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class ScoreFunctionParserMapper {
|
||||||
public ScoreFunctionParser get(QueryParseContext parseContext, String parserName) {
|
public ScoreFunctionParser get(QueryParseContext parseContext, String parserName) {
|
||||||
ScoreFunctionParser functionParser = get(parserName);
|
ScoreFunctionParser functionParser = get(parserName);
|
||||||
if (functionParser == null) {
|
if (functionParser == null) {
|
||||||
throw new QueryParsingException(parseContext, "No function with the name [" + parserName + "] is registered.", null);
|
throw new QueryParsingException(parseContext, "No function with the name [" + parserName + "] is registered.");
|
||||||
}
|
}
|
||||||
return functionParser;
|
return functionParser;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class PercentilesBucketBuilder extends BucketMetricsBuilder<PercentilesBu
|
||||||
@Override
|
@Override
|
||||||
protected void doInternalXContent(XContentBuilder builder, Params params) throws IOException {
|
protected void doInternalXContent(XContentBuilder builder, Params params) throws IOException {
|
||||||
if (percents != null) {
|
if (percents != null) {
|
||||||
builder.field(PercentilesBucketParser.PERCENTS.getPreferredName(), percents);
|
builder.field(PercentilesBucketParser.PERCENTS.getPreferredName(), (Object[])percents);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -227,6 +227,7 @@ public class QueryPhase implements SearchPhase {
|
||||||
// set the last emitted doc
|
// set the last emitted doc
|
||||||
scrollContext.lastEmittedDoc = topDocs.scoreDocs[topDocs.scoreDocs.length - 1];
|
scrollContext.lastEmittedDoc = topDocs.scoreDocs[topDocs.scoreDocs.length - 1];
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -442,7 +442,7 @@ public class NettyTransport extends AbstractLifecycleComponent<Transport> implem
|
||||||
for (int i = 0; i < hostAddresses.length; i++) {
|
for (int i = 0; i < hostAddresses.length; i++) {
|
||||||
addresses[i] = NetworkAddress.format(hostAddresses[i]);
|
addresses[i] = NetworkAddress.format(hostAddresses[i]);
|
||||||
}
|
}
|
||||||
logger.debug("binding server bootstrap to: {}", addresses);
|
logger.debug("binding server bootstrap to: {}", (Object)addresses);
|
||||||
}
|
}
|
||||||
for (InetAddress hostAddress : hostAddresses) {
|
for (InetAddress hostAddress : hostAddresses) {
|
||||||
bindServerBootstrap(name, hostAddress, settings);
|
bindServerBootstrap(name, hostAddress, settings);
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class BasicAnalysisBackwardCompatibilityIT extends ESBackcompatTestCase {
|
||||||
fields[i] = "type=string,analyzer=" + analyzer;
|
fields[i] = "type=string,analyzer=" + analyzer;
|
||||||
}
|
}
|
||||||
assertAcked(prepareCreate("test")
|
assertAcked(prepareCreate("test")
|
||||||
.addMapping("type", fields)
|
.addMapping("type", (Object[])fields)
|
||||||
.setSettings(indexSettings()));
|
.setSettings(indexSettings()));
|
||||||
ensureYellow();
|
ensureYellow();
|
||||||
InputOutput[] inout = new InputOutput[numFields];
|
InputOutput[] inout = new InputOutput[numFields];
|
||||||
|
|
|
@ -114,14 +114,14 @@ public class IndexNameExpressionResolverTests extends ESTestCase {
|
||||||
String[] results = indexNameExpressionResolver.concreteIndices(context, Strings.EMPTY_ARRAY);
|
String[] results = indexNameExpressionResolver.concreteIndices(context, Strings.EMPTY_ARRAY);
|
||||||
assertEquals(3, results.length);
|
assertEquals(3, results.length);
|
||||||
|
|
||||||
results = indexNameExpressionResolver.concreteIndices(context, null);
|
results = indexNameExpressionResolver.concreteIndices(context, (String[])null);
|
||||||
assertEquals(3, results.length);
|
assertEquals(3, results.length);
|
||||||
|
|
||||||
context = new IndexNameExpressionResolver.Context(state, IndicesOptions.strictExpand());
|
context = new IndexNameExpressionResolver.Context(state, IndicesOptions.strictExpand());
|
||||||
results = indexNameExpressionResolver.concreteIndices(context, Strings.EMPTY_ARRAY);
|
results = indexNameExpressionResolver.concreteIndices(context, Strings.EMPTY_ARRAY);
|
||||||
assertEquals(4, results.length);
|
assertEquals(4, results.length);
|
||||||
|
|
||||||
results = indexNameExpressionResolver.concreteIndices(context, null);
|
results = indexNameExpressionResolver.concreteIndices(context, (String[])null);
|
||||||
assertEquals(4, results.length);
|
assertEquals(4, results.length);
|
||||||
|
|
||||||
context = new IndexNameExpressionResolver.Context(state, IndicesOptions.strictExpandOpen());
|
context = new IndexNameExpressionResolver.Context(state, IndicesOptions.strictExpandOpen());
|
||||||
|
@ -348,7 +348,7 @@ public class IndexNameExpressionResolverTests extends ESTestCase {
|
||||||
assertEquals(2, results.length);
|
assertEquals(2, results.length);
|
||||||
assertThat(results, arrayContainingInAnyOrder("foo", "foobar"));
|
assertThat(results, arrayContainingInAnyOrder("foo", "foobar"));
|
||||||
|
|
||||||
results = indexNameExpressionResolver.concreteIndices(context, null);
|
results = indexNameExpressionResolver.concreteIndices(context, (String[])null);
|
||||||
assertEquals(0, results.length);
|
assertEquals(0, results.length);
|
||||||
|
|
||||||
results = indexNameExpressionResolver.concreteIndices(context, Strings.EMPTY_ARRAY);
|
results = indexNameExpressionResolver.concreteIndices(context, Strings.EMPTY_ARRAY);
|
||||||
|
|
|
@ -179,7 +179,7 @@ public class MultiDataPathUpgraderTests extends ESTestCase {
|
||||||
OldIndexBackwardsCompatibilityIT.copyIndex(logger, src, indexName, multiDataPath);
|
OldIndexBackwardsCompatibilityIT.copyIndex(logger, src, indexName, multiDataPath);
|
||||||
final ShardPath shardPath = new ShardPath(false, nodeEnvironment.availableShardPaths(new ShardId(indexName, 0))[0], nodeEnvironment.availableShardPaths(new ShardId(indexName, 0))[0], IndexMetaData.INDEX_UUID_NA_VALUE, new ShardId(indexName, 0));
|
final ShardPath shardPath = new ShardPath(false, nodeEnvironment.availableShardPaths(new ShardId(indexName, 0))[0], nodeEnvironment.availableShardPaths(new ShardId(indexName, 0))[0], IndexMetaData.INDEX_UUID_NA_VALUE, new ShardId(indexName, 0));
|
||||||
|
|
||||||
logger.info("{}", FileSystemUtils.files(shardPath.resolveIndex()));
|
logger.info("{}", (Object)FileSystemUtils.files(shardPath.resolveIndex()));
|
||||||
|
|
||||||
MultiDataPathUpgrader helper = new MultiDataPathUpgrader(nodeEnvironment);
|
MultiDataPathUpgrader helper = new MultiDataPathUpgrader(nodeEnvironment);
|
||||||
helper.upgrade(new ShardId(indexName, 0), shardPath);
|
helper.upgrade(new ShardId(indexName, 0), shardPath);
|
||||||
|
|
|
@ -148,7 +148,7 @@ public class IndexShardTests extends ESSingleNodeTestCase {
|
||||||
ensureGreen();
|
ensureGreen();
|
||||||
NodeEnvironment env = getInstanceFromNode(NodeEnvironment.class);
|
NodeEnvironment env = getInstanceFromNode(NodeEnvironment.class);
|
||||||
Path[] shardPaths = env.availableShardPaths(new ShardId("test", 0));
|
Path[] shardPaths = env.availableShardPaths(new ShardId("test", 0));
|
||||||
logger.info("--> paths: [{}]", shardPaths);
|
logger.info("--> paths: [{}]", (Object)shardPaths);
|
||||||
// Should not be able to acquire the lock because it's already open
|
// Should not be able to acquire the lock because it's already open
|
||||||
try {
|
try {
|
||||||
NodeEnvironment.acquireFSLockForPaths(Settings.EMPTY, shardPaths);
|
NodeEnvironment.acquireFSLockForPaths(Settings.EMPTY, shardPaths);
|
||||||
|
|
|
@ -390,7 +390,7 @@ public class TranslogTests extends ESTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSnapshotOnClosedTranslog() throws IOException {
|
public void testSnapshotOnClosedTranslog() throws IOException {
|
||||||
assertTrue(Files.exists(translogDir.resolve(translog.getFilename(1))));
|
assertTrue(Files.exists(translogDir.resolve(Translog.getFilename(1))));
|
||||||
translog.add(new Translog.Create("test", "1", new byte[]{1}));
|
translog.add(new Translog.Create("test", "1", new byte[]{1}));
|
||||||
translog.close();
|
translog.close();
|
||||||
try {
|
try {
|
||||||
|
@ -436,14 +436,14 @@ public class TranslogTests extends ESTestCase {
|
||||||
|
|
||||||
|
|
||||||
public void assertFileIsPresent(Translog translog, long id) {
|
public void assertFileIsPresent(Translog translog, long id) {
|
||||||
if (Files.exists(translogDir.resolve(translog.getFilename(id)))) {
|
if (Files.exists(translogDir.resolve(Translog.getFilename(id)))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fail(translog.getFilename(id) + " is not present in any location: " + translog.location());
|
fail(Translog.getFilename(id) + " is not present in any location: " + translog.location());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void assertFileDeleted(Translog translog, long id) {
|
public void assertFileDeleted(Translog translog, long id) {
|
||||||
assertFalse("translog [" + id + "] still exists", Files.exists(translog.location().resolve(translog.getFilename(id))));
|
assertFalse("translog [" + id + "] still exists", Files.exists(translog.location().resolve(Translog.getFilename(id))));
|
||||||
}
|
}
|
||||||
|
|
||||||
static class LocationOperation {
|
static class LocationOperation {
|
||||||
|
@ -913,7 +913,7 @@ public class TranslogTests extends ESTestCase {
|
||||||
final Translog.Location lastLocation = translog.add(new Translog.Create("test", "" + translogOperations, Integer.toString(translogOperations).getBytes(Charset.forName("UTF-8"))));
|
final Translog.Location lastLocation = translog.add(new Translog.Create("test", "" + translogOperations, Integer.toString(translogOperations).getBytes(Charset.forName("UTF-8"))));
|
||||||
|
|
||||||
final Checkpoint checkpoint = Checkpoint.read(translog.location().resolve(Translog.CHECKPOINT_FILE_NAME));
|
final Checkpoint checkpoint = Checkpoint.read(translog.location().resolve(Translog.CHECKPOINT_FILE_NAME));
|
||||||
try (final ImmutableTranslogReader reader = translog.openReader(translog.location().resolve(translog.getFilename(translog.currentFileGeneration())), checkpoint)) {
|
try (final ImmutableTranslogReader reader = translog.openReader(translog.location().resolve(Translog.getFilename(translog.currentFileGeneration())), checkpoint)) {
|
||||||
assertEquals(lastSynced + 1, reader.totalOperations());
|
assertEquals(lastSynced + 1, reader.totalOperations());
|
||||||
for (int op = 0; op < translogOperations; op++) {
|
for (int op = 0; op < translogOperations; op++) {
|
||||||
Translog.Location location = locations.get(op);
|
Translog.Location location = locations.get(op);
|
||||||
|
|
|
@ -196,7 +196,7 @@ public class OpenCloseIndexIT extends ESIntegTestCase {
|
||||||
@Test(expected = ActionRequestValidationException.class)
|
@Test(expected = ActionRequestValidationException.class)
|
||||||
public void testCloseNullIndex() {
|
public void testCloseNullIndex() {
|
||||||
Client client = client();
|
Client client = client();
|
||||||
client.admin().indices().prepareClose(null).execute().actionGet();
|
client.admin().indices().prepareClose((String[])null).execute().actionGet();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = ActionRequestValidationException.class)
|
@Test(expected = ActionRequestValidationException.class)
|
||||||
|
@ -208,7 +208,7 @@ public class OpenCloseIndexIT extends ESIntegTestCase {
|
||||||
@Test(expected = ActionRequestValidationException.class)
|
@Test(expected = ActionRequestValidationException.class)
|
||||||
public void testOpenNullIndex() {
|
public void testOpenNullIndex() {
|
||||||
Client client = client();
|
Client client = client();
|
||||||
client.admin().indices().prepareOpen(null).execute().actionGet();
|
client.admin().indices().prepareOpen((String[])null).execute().actionGet();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -263,7 +263,7 @@ public class SimpleIndexTemplateIT extends ESIntegTestCase {
|
||||||
@Test
|
@Test
|
||||||
public void testThatInvalidGetIndexTemplatesFails() throws Exception {
|
public void testThatInvalidGetIndexTemplatesFails() throws Exception {
|
||||||
logger.info("--> get template null");
|
logger.info("--> get template null");
|
||||||
testExpectActionRequestValidationException(null);
|
testExpectActionRequestValidationException((String[])null);
|
||||||
|
|
||||||
logger.info("--> get template empty");
|
logger.info("--> get template empty");
|
||||||
testExpectActionRequestValidationException("");
|
testExpectActionRequestValidationException("");
|
||||||
|
|
|
@ -306,9 +306,8 @@ public class MinDocCountIT extends AbstractTermsTestCase {
|
||||||
testMinDocCountOnTerms(field, script, order, include, false);
|
testMinDocCountOnTerms(field, script, order, include, false);
|
||||||
} catch (Throwable secondFailure) {
|
} catch (Throwable secondFailure) {
|
||||||
logger.error("exception on retry (will re-throw the original in a sec)", secondFailure);
|
logger.error("exception on retry (will re-throw the original in a sec)", secondFailure);
|
||||||
} finally {
|
|
||||||
throw ae;
|
|
||||||
}
|
}
|
||||||
|
throw ae;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1365,7 +1365,8 @@ public class SearchQueryIT extends ESIntegTestCase {
|
||||||
assertHitCount(searchResponse, 1l);
|
assertHitCount(searchResponse, 1l);
|
||||||
assertThat(searchResponse.getHits().hits().length, equalTo(1));
|
assertThat(searchResponse.getHits().hits().length, equalTo(1));
|
||||||
|
|
||||||
searchResponse = client().prepareSearch().setQuery(constantScoreQuery(idsQuery(null).ids("1"))).get();
|
// TODO: why do we even support passing null??
|
||||||
|
searchResponse = client().prepareSearch().setQuery(constantScoreQuery(idsQuery((String[])null).ids("1"))).get();
|
||||||
assertHitCount(searchResponse, 1l);
|
assertHitCount(searchResponse, 1l);
|
||||||
assertThat(searchResponse.getHits().hits().length, equalTo(1));
|
assertThat(searchResponse.getHits().hits().length, equalTo(1));
|
||||||
|
|
||||||
|
@ -1403,7 +1404,7 @@ public class SearchQueryIT extends ESIntegTestCase {
|
||||||
assertHitCount(searchResponse, 1l);
|
assertHitCount(searchResponse, 1l);
|
||||||
assertThat(searchResponse.getHits().hits().length, equalTo(1));
|
assertThat(searchResponse.getHits().hits().length, equalTo(1));
|
||||||
|
|
||||||
searchResponse = client().prepareSearch().setQuery(idsQuery(null).ids("1")).get();
|
searchResponse = client().prepareSearch().setQuery(idsQuery((String[])null).ids("1")).get();
|
||||||
assertHitCount(searchResponse, 1l);
|
assertHitCount(searchResponse, 1l);
|
||||||
assertThat(searchResponse.getHits().hits().length, equalTo(1));
|
assertThat(searchResponse.getHits().hits().length, equalTo(1));
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ public class ContextSuggestSearchIT extends ESIntegTestCase {
|
||||||
.startObject("context")
|
.startObject("context")
|
||||||
.startObject("location")
|
.startObject("location")
|
||||||
.field("type", "geo")
|
.field("type", "geo")
|
||||||
.array("precision", precisions.toArray(new Integer[precisions.size()]))
|
.array("precision", (Object[])precisions.toArray(new Integer[precisions.size()]))
|
||||||
.endObject()
|
.endObject()
|
||||||
.endObject().endObject()
|
.endObject().endObject()
|
||||||
.endObject().endObject();
|
.endObject().endObject();
|
||||||
|
@ -185,7 +185,7 @@ public class ContextSuggestSearchIT extends ESIntegTestCase {
|
||||||
.startObject("context")
|
.startObject("context")
|
||||||
.startObject("location")
|
.startObject("location")
|
||||||
.field("type", "geo")
|
.field("type", "geo")
|
||||||
.array("precision", precisions.toArray(new Integer[precisions.size()]))
|
.array("precision", (Object[])precisions.toArray(new Integer[precisions.size()]))
|
||||||
.endObject()
|
.endObject()
|
||||||
.endObject().endObject()
|
.endObject().endObject()
|
||||||
.endObject().endObject();
|
.endObject().endObject();
|
||||||
|
|
|
@ -1713,7 +1713,9 @@ public abstract class ESIntegTestCase extends ESTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Helper method to create list of plugins without specifying generic types. */
|
/** Helper method to create list of plugins without specifying generic types. */
|
||||||
protected static Collection<Class<? extends Plugin>> pluginList(Class<? extends Plugin>... plugins) {
|
@SafeVarargs
|
||||||
|
@SuppressWarnings("varargs") // due to type erasure, the varargs type is non-reifiable, which casues this warning
|
||||||
|
protected final Collection<Class<? extends Plugin>> pluginList(Class<? extends Plugin>... plugins) {
|
||||||
return Arrays.asList(plugins);
|
return Arrays.asList(plugins);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<elasticsearch.plugin.classname>org.elasticsearch.plugin.analysis.icu.AnalysisICUPlugin</elasticsearch.plugin.classname>
|
<elasticsearch.plugin.classname>org.elasticsearch.plugin.analysis.icu.AnalysisICUPlugin</elasticsearch.plugin.classname>
|
||||||
<tests.rest.suite>analysis_icu</tests.rest.suite>
|
<tests.rest.suite>analysis_icu</tests.rest.suite>
|
||||||
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
||||||
|
<xlint.options>-Xlint:-deprecation</xlint.options>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<elasticsearch.plugin.classname>org.elasticsearch.plugin.analysis.AnalysisPhoneticPlugin</elasticsearch.plugin.classname>
|
<elasticsearch.plugin.classname>org.elasticsearch.plugin.analysis.AnalysisPhoneticPlugin</elasticsearch.plugin.classname>
|
||||||
<tests.rest.suite>analysis_phonetic</tests.rest.suite>
|
<tests.rest.suite>analysis_phonetic</tests.rest.suite>
|
||||||
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
||||||
|
<xlint.options>-Xlint:-rawtypes,-unchecked</xlint.options>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
|
@ -30,6 +30,8 @@ governing permissions and limitations under the License. -->
|
||||||
<tests.jvms>1</tests.jvms>
|
<tests.jvms>1</tests.jvms>
|
||||||
<tests.rest.suite>cloud_azure</tests.rest.suite>
|
<tests.rest.suite>cloud_azure</tests.rest.suite>
|
||||||
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
||||||
|
<!-- need -path because there is no resources dir... -->
|
||||||
|
<xlint.options>-Xlint:-path,-serial,-static,-unchecked</xlint.options>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
|
@ -31,6 +31,7 @@ governing permissions and limitations under the License. -->
|
||||||
<!-- currently has no unit tests -->
|
<!-- currently has no unit tests -->
|
||||||
<tests.rest.suite>cloud_gce</tests.rest.suite>
|
<tests.rest.suite>cloud_gce</tests.rest.suite>
|
||||||
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
||||||
|
<xlint.options>-Xlint:-rawtypes,-unchecked</xlint.options>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
|
@ -113,7 +113,7 @@ public class DeleteByQueryRequest extends ActionRequest<DeleteByQueryRequest> im
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DeleteByQueryRequest indices(String... indices) {
|
public DeleteByQueryRequest indices(String[] indices) {
|
||||||
this.indices = indices;
|
this.indices = indices;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ public class DeleteByQueryRequest extends ActionRequest<DeleteByQueryRequest> im
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DeleteByQueryRequest source(Map querySource) {
|
public DeleteByQueryRequest source(Map<String,?> querySource) {
|
||||||
try {
|
try {
|
||||||
XContentBuilder builder = XContentFactory.contentBuilder(Requests.CONTENT_TYPE);
|
XContentBuilder builder = XContentFactory.contentBuilder(Requests.CONTENT_TYPE);
|
||||||
builder.map(querySource);
|
builder.map(querySource);
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class TransportDeleteByQueryActionTests extends ESSingleNodeTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExecuteScanFailsOnMissingIndex() {
|
public void testExecuteScanFailsOnMissingIndex() {
|
||||||
DeleteByQueryRequest delete = new DeleteByQueryRequest().indices("none");
|
DeleteByQueryRequest delete = new DeleteByQueryRequest().indices(new String[]{"none"});
|
||||||
TestActionListener listener = new TestActionListener();
|
TestActionListener listener = new TestActionListener();
|
||||||
|
|
||||||
newAsyncAction(delete, listener).executeScan();
|
newAsyncAction(delete, listener).executeScan();
|
||||||
|
@ -62,7 +62,7 @@ public class TransportDeleteByQueryActionTests extends ESSingleNodeTestCase {
|
||||||
public void testExecuteScanFailsOnMalformedQuery() {
|
public void testExecuteScanFailsOnMalformedQuery() {
|
||||||
createIndex("test");
|
createIndex("test");
|
||||||
|
|
||||||
DeleteByQueryRequest delete = new DeleteByQueryRequest().indices("test").source("{...}");
|
DeleteByQueryRequest delete = new DeleteByQueryRequest().indices(new String[]{"test"}).source("{...}");
|
||||||
TestActionListener listener = new TestActionListener();
|
TestActionListener listener = new TestActionListener();
|
||||||
|
|
||||||
newAsyncAction(delete, listener).executeScan();
|
newAsyncAction(delete, listener).executeScan();
|
||||||
|
@ -83,7 +83,7 @@ public class TransportDeleteByQueryActionTests extends ESSingleNodeTestCase {
|
||||||
assertHitCount(client().prepareCount("test").get(), numDocs);
|
assertHitCount(client().prepareCount("test").get(), numDocs);
|
||||||
|
|
||||||
final long limit = randomIntBetween(0, numDocs);
|
final long limit = randomIntBetween(0, numDocs);
|
||||||
DeleteByQueryRequest delete = new DeleteByQueryRequest().indices("test").source(boolQuery().must(rangeQuery("num").lte(limit)).buildAsBytes());
|
DeleteByQueryRequest delete = new DeleteByQueryRequest().indices(new String[]{"test"}).source(boolQuery().must(rangeQuery("num").lte(limit)).buildAsBytes());
|
||||||
TestActionListener listener = new TestActionListener();
|
TestActionListener listener = new TestActionListener();
|
||||||
|
|
||||||
newAsyncAction(delete, listener).executeScan();
|
newAsyncAction(delete, listener).executeScan();
|
||||||
|
@ -139,7 +139,7 @@ public class TransportDeleteByQueryActionTests extends ESSingleNodeTestCase {
|
||||||
ClearScrollResponse clearScrollResponse = client().prepareClearScroll().addScrollId(scrollId).get();
|
ClearScrollResponse clearScrollResponse = client().prepareClearScroll().addScrollId(scrollId).get();
|
||||||
assertTrue(clearScrollResponse.isSucceeded());
|
assertTrue(clearScrollResponse.isSucceeded());
|
||||||
|
|
||||||
DeleteByQueryRequest delete = new DeleteByQueryRequest().indices("test");
|
DeleteByQueryRequest delete = new DeleteByQueryRequest().indices(new String[]{"test"});
|
||||||
TestActionListener listener = new TestActionListener();
|
TestActionListener listener = new TestActionListener();
|
||||||
|
|
||||||
newAsyncAction(delete, listener).executeScroll(searchResponse.getScrollId());
|
newAsyncAction(delete, listener).executeScroll(searchResponse.getScrollId());
|
||||||
|
@ -160,7 +160,7 @@ public class TransportDeleteByQueryActionTests extends ESSingleNodeTestCase {
|
||||||
String scrollId = searchResponse.getScrollId();
|
String scrollId = searchResponse.getScrollId();
|
||||||
assertTrue(Strings.hasText(scrollId));
|
assertTrue(Strings.hasText(scrollId));
|
||||||
|
|
||||||
DeleteByQueryRequest delete = new DeleteByQueryRequest().indices("test").timeout(TimeValue.timeValueSeconds(1));
|
DeleteByQueryRequest delete = new DeleteByQueryRequest().indices(new String[]{"test"}).timeout(TimeValue.timeValueSeconds(1));
|
||||||
TestActionListener listener = new TestActionListener();
|
TestActionListener listener = new TestActionListener();
|
||||||
|
|
||||||
final TransportDeleteByQueryAction.AsyncDeleteByQueryAction async = newAsyncAction(delete, listener);
|
final TransportDeleteByQueryAction.AsyncDeleteByQueryAction async = newAsyncAction(delete, listener);
|
||||||
|
@ -183,7 +183,7 @@ public class TransportDeleteByQueryActionTests extends ESSingleNodeTestCase {
|
||||||
String scrollId = searchResponse.getScrollId();
|
String scrollId = searchResponse.getScrollId();
|
||||||
assertTrue(Strings.hasText(scrollId));
|
assertTrue(Strings.hasText(scrollId));
|
||||||
|
|
||||||
DeleteByQueryRequest delete = new DeleteByQueryRequest().indices("test");
|
DeleteByQueryRequest delete = new DeleteByQueryRequest().indices(new String[]{"test"});
|
||||||
TestActionListener listener = new TestActionListener();
|
TestActionListener listener = new TestActionListener();
|
||||||
|
|
||||||
newAsyncAction(delete, listener).executeScroll(searchResponse.getScrollId());
|
newAsyncAction(delete, listener).executeScroll(searchResponse.getScrollId());
|
||||||
|
@ -219,7 +219,7 @@ public class TransportDeleteByQueryActionTests extends ESSingleNodeTestCase {
|
||||||
assertTrue(Strings.hasText(scrollId));
|
assertTrue(Strings.hasText(scrollId));
|
||||||
assertThat(searchResponse.getHits().getTotalHits(), equalTo(limit));
|
assertThat(searchResponse.getHits().getTotalHits(), equalTo(limit));
|
||||||
|
|
||||||
DeleteByQueryRequest delete = new DeleteByQueryRequest().indices("test").size(100).source(boolQuery().must(rangeQuery("num").lte(limit)).buildAsBytes());
|
DeleteByQueryRequest delete = new DeleteByQueryRequest().indices(new String[]{"test"}).size(100).source(boolQuery().must(rangeQuery("num").lte(limit)).buildAsBytes());
|
||||||
TestActionListener listener = new TestActionListener();
|
TestActionListener listener = new TestActionListener();
|
||||||
|
|
||||||
newAsyncAction(delete, listener).executeScroll(searchResponse.getScrollId());
|
newAsyncAction(delete, listener).executeScroll(searchResponse.getScrollId());
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
<tests.jvms>1</tests.jvms>
|
<tests.jvms>1</tests.jvms>
|
||||||
<tests.rest.suite>discovery_ec2</tests.rest.suite>
|
<tests.rest.suite>discovery_ec2</tests.rest.suite>
|
||||||
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
||||||
|
<xlint.options>-Xlint:-rawtypes</xlint.options>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class AwsEc2UnicastHostsProvider extends AbstractComponent implements Uni
|
||||||
|
|
||||||
this.tags = settings.getByPrefix("discovery.ec2.tag.").getAsMap();
|
this.tags = settings.getByPrefix("discovery.ec2.tag.").getAsMap();
|
||||||
|
|
||||||
Set<String> availabilityZones = new HashSet();
|
Set<String> availabilityZones = new HashSet<>();
|
||||||
availabilityZones.addAll(Arrays.asList(settings.getAsArray("discovery.ec2.availability_zones")));
|
availabilityZones.addAll(Arrays.asList(settings.getAsArray("discovery.ec2.availability_zones")));
|
||||||
if (settings.get("discovery.ec2.availability_zones") != null) {
|
if (settings.get("discovery.ec2.availability_zones") != null) {
|
||||||
availabilityZones.addAll(Strings.commaDelimitedListToSet(settings.get("discovery.ec2.availability_zones")));
|
availabilityZones.addAll(Strings.commaDelimitedListToSet(settings.get("discovery.ec2.availability_zones")));
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
<tests.rest.suite>jvm_example</tests.rest.suite>
|
<tests.rest.suite>jvm_example</tests.rest.suite>
|
||||||
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
||||||
<skip.unit.tests>true</skip.unit.tests>
|
<skip.unit.tests>true</skip.unit.tests>
|
||||||
|
<xlint.options>-Xlint:-rawtypes</xlint.options>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<elasticsearch.plugin.classname>org.elasticsearch.plugin.javascript.JavaScriptPlugin</elasticsearch.plugin.classname>
|
<elasticsearch.plugin.classname>org.elasticsearch.plugin.javascript.JavaScriptPlugin</elasticsearch.plugin.classname>
|
||||||
<tests.rest.suite>lang_javascript</tests.rest.suite>
|
<tests.rest.suite>lang_javascript</tests.rest.suite>
|
||||||
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
||||||
|
<xlint.options>-Xlint:-rawtypes,-unchecked</xlint.options>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<elasticsearch.plugin.classname>org.elasticsearch.plugin.python.PythonPlugin</elasticsearch.plugin.classname>
|
<elasticsearch.plugin.classname>org.elasticsearch.plugin.python.PythonPlugin</elasticsearch.plugin.classname>
|
||||||
<tests.rest.suite>lang_python</tests.rest.suite>
|
<tests.rest.suite>lang_python</tests.rest.suite>
|
||||||
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
||||||
|
<xlint.options>-Xlint:-unchecked</xlint.options>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
|
@ -29,6 +29,7 @@ governing permissions and limitations under the License. -->
|
||||||
<elasticsearch.plugin.classname>org.elasticsearch.plugin.mapper.MapperMurmur3Plugin</elasticsearch.plugin.classname>
|
<elasticsearch.plugin.classname>org.elasticsearch.plugin.mapper.MapperMurmur3Plugin</elasticsearch.plugin.classname>
|
||||||
<tests.rest.suite>mapper_murmur3</tests.rest.suite>
|
<tests.rest.suite>mapper_murmur3</tests.rest.suite>
|
||||||
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
||||||
|
<xlint.options>-Xlint:-rawtypes</xlint.options>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
<tests.jvms>1</tests.jvms>
|
<tests.jvms>1</tests.jvms>
|
||||||
<tests.rest.suite>repository_s3</tests.rest.suite>
|
<tests.rest.suite>repository_s3</tests.rest.suite>
|
||||||
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
<tests.rest.load_packaged>false</tests.rest.load_packaged>
|
||||||
|
<xlint.options>-Xlint:-rawtypes</xlint.options>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class TestAwsS3Service extends InternalAwsS3Service {
|
||||||
return "plugs in mock s3 service";
|
return "plugs in mock s3 service";
|
||||||
}
|
}
|
||||||
public void onModule(S3Module s3Module) {
|
public void onModule(S3Module s3Module) {
|
||||||
s3Module.s3ServiceImpl = TestAwsS3Service.class;
|
S3Module.s3ServiceImpl = TestAwsS3Service.class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
7
pom.xml
7
pom.xml
|
@ -39,6 +39,9 @@
|
||||||
<jvm.executable>${java.home}${file.separator}bin${file.separator}java</jvm.executable>
|
<jvm.executable>${java.home}${file.separator}bin${file.separator}java</jvm.executable>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
|
<!-- Path warnings must be ignored because maven doesnt create the classes output
|
||||||
|
dir when no source files exist (eg for distribution or qa modules) -->
|
||||||
|
<xlint.options>-Xlint:-path</xlint.options>
|
||||||
|
|
||||||
<!-- libraries -->
|
<!-- libraries -->
|
||||||
<lucene.version>5.4.0</lucene.version>
|
<lucene.version>5.4.0</lucene.version>
|
||||||
|
@ -574,8 +577,12 @@
|
||||||
be fixed in version > 3.1
|
be fixed in version > 3.1
|
||||||
-->
|
-->
|
||||||
<useIncrementalCompilation>false</useIncrementalCompilation>
|
<useIncrementalCompilation>false</useIncrementalCompilation>
|
||||||
|
<showWarnings>true</showWarnings>
|
||||||
<compilerArgs>
|
<compilerArgs>
|
||||||
<arg>-XDignore.symbol.file</arg>
|
<arg>-XDignore.symbol.file</arg>
|
||||||
|
<arg>-Xlint:all</arg>
|
||||||
|
<arg>${xlint.options}</arg>
|
||||||
|
<arg>-Werror</arg>
|
||||||
</compilerArgs>
|
</compilerArgs>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
Loading…
Reference in New Issue