Skip to content

Commit

Permalink
[DOCS] Remove rawtypes suppressions and fix violations in REST high-l…
Browse files Browse the repository at this point in the history
…evel client docs tests
  • Loading branch information
javanna committed Feb 2, 2018
1 parent 174e243 commit 9d11cfd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
import org.elasticsearch.script.ScriptType;
import org.elasticsearch.search.fetch.subphase.FetchSourceContext;

import java.io.IOException;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
Expand All @@ -88,7 +87,6 @@
*/
public class CRUDDocumentationIT extends ESRestHighLevelClientTestCase {

@SuppressWarnings({"unchecked", "rawtypes"})
public void testIndex() throws Exception {
RestHighLevelClient client = highLevelClient();

Expand Down Expand Up @@ -246,7 +244,7 @@ public void onFailure(Exception e) {

// Replace the empty listener by a blocking listener in test
final CountDownLatch latch = new CountDownLatch(1);
listener = new LatchedActionListener(listener, latch);
listener = new LatchedActionListener<>(listener, latch);

// tag::index-execute-async
client.indexAsync(request, listener); // <1>
Expand All @@ -256,7 +254,6 @@ public void onFailure(Exception e) {
}
}

@SuppressWarnings({"unchecked", "rawtypes"})
public void testUpdate() throws Exception {
RestHighLevelClient client = highLevelClient();
{
Expand Down Expand Up @@ -517,7 +514,7 @@ public void onFailure(Exception e) {

// Replace the empty listener by a blocking listener in test
final CountDownLatch latch = new CountDownLatch(1);
listener = new LatchedActionListener(listener, latch);
listener = new LatchedActionListener<>(listener, latch);

// tag::update-execute-async
client.updateAsync(request, listener); // <1>
Expand All @@ -527,7 +524,6 @@ public void onFailure(Exception e) {
}
}

@SuppressWarnings({"unchecked", "rawtypes"})
public void testDelete() throws Exception {
RestHighLevelClient client = highLevelClient();

Expand Down Expand Up @@ -638,7 +634,7 @@ public void onFailure(Exception e) {

// Replace the empty listener by a blocking listener in test
final CountDownLatch latch = new CountDownLatch(1);
listener = new LatchedActionListener(listener, latch);
listener = new LatchedActionListener<>(listener, latch);

// tag::delete-execute-async
client.deleteAsync(request, listener); // <1>
Expand All @@ -648,7 +644,6 @@ public void onFailure(Exception e) {
}
}

@SuppressWarnings({"unchecked", "rawtypes"})
public void testBulk() throws Exception {
RestHighLevelClient client = highLevelClient();
{
Expand Down Expand Up @@ -741,7 +736,7 @@ public void onFailure(Exception e) {

// Replace the empty listener by a blocking listener in test
final CountDownLatch latch = new CountDownLatch(1);
listener = new LatchedActionListener(listener, latch);
listener = new LatchedActionListener<>(listener, latch);

// tag::bulk-execute-async
client.bulkAsync(request, listener); // <1>
Expand All @@ -751,7 +746,6 @@ public void onFailure(Exception e) {
}
}

@SuppressWarnings({"unchecked", "rawtypes"})
public void testGet() throws Exception {
RestHighLevelClient client = highLevelClient();
{
Expand Down Expand Up @@ -896,7 +890,7 @@ public void onFailure(Exception e) {

// Replace the empty listener by a blocking listener in test
final CountDownLatch latch = new CountDownLatch(1);
listener = new LatchedActionListener(listener, latch);
listener = new LatchedActionListener<>(listener, latch);

//tag::get-execute-async
client.getAsync(request, listener); // <1>
Expand Down Expand Up @@ -930,7 +924,7 @@ public void onFailure(Exception e) {
}
}

public void testBulkProcessor() throws InterruptedException, IOException {
public void testBulkProcessor() throws InterruptedException {
RestHighLevelClient client = highLevelClient();
{
// tag::bulk-processor-init
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
*/
public class SearchDocumentationIT extends ESRestHighLevelClientTestCase {

@SuppressWarnings({"unused", "unchecked", "rawtypes"})
@SuppressWarnings({"unused", "unchecked"})
public void testSearch() throws Exception {
RestHighLevelClient client = highLevelClient();
{
Expand Down Expand Up @@ -192,7 +192,7 @@ public void onFailure(Exception e) {

// Replace the empty listener by a blocking listener in test
final CountDownLatch latch = new CountDownLatch(1);
listener = new LatchedActionListener(listener, latch);
listener = new LatchedActionListener<>(listener, latch);

// tag::search-execute-async
client.searchAsync(searchRequest, listener); // <1>
Expand Down Expand Up @@ -355,7 +355,7 @@ public void testSearchRequestAggregations() throws IOException {
}
}

@SuppressWarnings({ "unused", "rawtypes" })
@SuppressWarnings("unused")
public void testSearchRequestSuggestions() throws IOException {
RestHighLevelClient client = highLevelClient();
{
Expand Down Expand Up @@ -461,6 +461,7 @@ public void testSearchRequestHighlighting() throws IOException {
}
}

@SuppressWarnings("unused")
public void testSearchRequestProfiling() throws IOException {
RestHighLevelClient client = highLevelClient();
{
Expand Down Expand Up @@ -529,7 +530,7 @@ public void testSearchRequestProfiling() throws IOException {
}
}

@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings("unchecked")
public void testScroll() throws Exception {
RestHighLevelClient client = highLevelClient();
{
Expand Down Expand Up @@ -616,7 +617,7 @@ public void onFailure(Exception e) {

// Replace the empty listener by a blocking listener in test
final CountDownLatch latch = new CountDownLatch(1);
scrollListener = new LatchedActionListener(scrollListener, latch);
scrollListener = new LatchedActionListener<>(scrollListener, latch);

// tag::search-scroll-execute-async
client.searchScrollAsync(scrollRequest, scrollListener); // <1>
Expand Down

0 comments on commit 9d11cfd

Please sign in to comment.