Remove and forbid final uses of ImmutableList
This commit is contained in:
parent
b0af7a1426
commit
a8bace9f97
|
@ -24,7 +24,6 @@ import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||||
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
import com.google.common.collect.Collections2;
|
import com.google.common.collect.Collections2;
|
||||||
import com.google.common.collect.ImmutableList;
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.google.common.collect.UnmodifiableIterator;
|
import com.google.common.collect.UnmodifiableIterator;
|
||||||
import org.apache.lucene.util.CollectionUtil;
|
import org.apache.lucene.util.CollectionUtil;
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
package org.elasticsearch.transport.netty;
|
package org.elasticsearch.transport.netty;
|
||||||
|
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import org.elasticsearch.ExceptionsHelper;
|
import org.elasticsearch.ExceptionsHelper;
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
|
|
||||||
package org.elasticsearch.index.mapper.string;
|
package org.elasticsearch.index.mapper.string;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
|
||||||
|
|
||||||
import org.elasticsearch.ExceptionsHelper;
|
import org.elasticsearch.ExceptionsHelper;
|
||||||
import org.elasticsearch.client.Client;
|
import org.elasticsearch.client.Client;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
|
@ -29,6 +27,7 @@ import org.elasticsearch.index.mapper.MapperParsingException;
|
||||||
import org.elasticsearch.test.ESSingleNodeTestCase;
|
import org.elasticsearch.test.ESSingleNodeTestCase;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
import static org.elasticsearch.index.query.QueryBuilders.matchPhraseQuery;
|
import static org.elasticsearch.index.query.QueryBuilders.matchPhraseQuery;
|
||||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
|
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
|
||||||
|
@ -140,7 +139,7 @@ public class StringFieldMapperPositionIncrementGapTests extends ESSingleNodeTest
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void testGap(Client client, String indexName, String type, int positionIncrementGap) throws IOException {
|
private static void testGap(Client client, String indexName, String type, int positionIncrementGap) throws IOException {
|
||||||
client.prepareIndex(indexName, type, "position_gap_test").setSource("string", ImmutableList.of("one", "two three")).setRefresh(true).get();
|
client.prepareIndex(indexName, type, "position_gap_test").setSource("string", Arrays.asList("one", "two three")).setRefresh(true).get();
|
||||||
|
|
||||||
// Baseline - phrase query finds matches in the same field value
|
// Baseline - phrase query finds matches in the same field value
|
||||||
assertHitCount(client.prepareSearch(indexName).setQuery(matchPhraseQuery("string", "two three")).get(), 1);
|
assertHitCount(client.prepareSearch(indexName).setQuery(matchPhraseQuery("string", "two three")).get(), 1);
|
||||||
|
|
|
@ -87,3 +87,4 @@ org.elasticsearch.common.io.PathUtils#get(java.net.URI)
|
||||||
|
|
||||||
@defaultMessage avoid adding additional dependencies on Guava
|
@defaultMessage avoid adding additional dependencies on Guava
|
||||||
com.google.common.collect.Lists
|
com.google.common.collect.Lists
|
||||||
|
com.google.common.collect.ImmutableList
|
||||||
|
|
|
@ -55,14 +55,14 @@ public class ShadedIT extends LuceneTestCase {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testLoadShadedClasses() throws ClassNotFoundException {
|
public void testLoadShadedClasses() throws ClassNotFoundException {
|
||||||
Class.forName("org.elasticsearch.common.collect.ImmutableList");
|
Class.forName("org.elasticsearch.common.cache.LoadingCache");
|
||||||
Class.forName("org.elasticsearch.common.joda.time.DateTime");
|
Class.forName("org.elasticsearch.common.joda.time.DateTime");
|
||||||
Class.forName("org.elasticsearch.common.util.concurrent.jsr166e.LongAdder");
|
Class.forName("org.elasticsearch.common.util.concurrent.jsr166e.LongAdder");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = ClassNotFoundException.class)
|
@Test(expected = ClassNotFoundException.class)
|
||||||
public void testGuavaIsNotOnTheCP() throws ClassNotFoundException {
|
public void testGuavaIsNotOnTheCP() throws ClassNotFoundException {
|
||||||
Class.forName("com.google.common.collect.ImmutableList");
|
Class.forName("com.google.common.cache.LoadingCache");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = ClassNotFoundException.class)
|
@Test(expected = ClassNotFoundException.class)
|
||||||
|
|
Loading…
Reference in New Issue