From 5b078ebfede271ee74109a0c0513df7a9a346171 Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Fri, 5 Jul 2013 16:26:50 +0200 Subject: [PATCH] fixed casting that caused compilation errors with JDK7 --- .../xcontent/support/XContentMapValuesTests.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/test/java/org/elasticsearch/test/unit/common/xcontent/support/XContentMapValuesTests.java b/src/test/java/org/elasticsearch/test/unit/common/xcontent/support/XContentMapValuesTests.java index d61e1ff819b..2d76145692e 100644 --- a/src/test/java/org/elasticsearch/test/unit/common/xcontent/support/XContentMapValuesTests.java +++ b/src/test/java/org/elasticsearch/test/unit/common/xcontent/support/XContentMapValuesTests.java @@ -317,6 +317,7 @@ public class XContentMapValuesTests { assertThat(((Map) ((List) filteredMap.get("array")).get(1)).get("field").toString(), equalTo("value")); } + @SuppressWarnings("unchecked") @Test public void filterIncludesUsingStarPrefix() { Map map = new HashMap(); @@ -335,16 +336,16 @@ public class XContentMapValuesTests { Map filteredMap = XContentMapValues.filter(map, new String[]{"*.field2"}, Strings.EMPTY_ARRAY); assertThat(filteredMap.size(), equalTo(1)); assertThat(filteredMap, hasKey("obj")); - assertThat(((Map) filteredMap.get("obj")).size(), equalTo(1)); - assertThat(((Map) filteredMap.get("obj")), hasKey("field2")); + assertThat(((Map) filteredMap.get("obj")).size(), equalTo(1)); + assertThat(((Map) filteredMap.get("obj")), hasKey("field2")); // only objects filteredMap = XContentMapValues.filter(map, new String[]{"*.*"}, Strings.EMPTY_ARRAY); assertThat(filteredMap.size(), equalTo(2)); assertThat(filteredMap, hasKey("obj")); - assertThat(((Map) filteredMap.get("obj")).size(), equalTo(2)); + assertThat(((Map) filteredMap.get("obj")).size(), equalTo(2)); assertThat(filteredMap, hasKey("n_obj")); - assertThat(((Map) filteredMap.get("n_obj")).size(), equalTo(2)); + assertThat(((Map) filteredMap.get("n_obj")).size(), equalTo(2)); filteredMap = XContentMapValues.filter(map, new String[]{"*"}, new String[]{"*.*2"}); @@ -352,10 +353,10 @@ public class XContentMapValuesTests { assertThat(filteredMap, hasKey("field")); assertThat(filteredMap, hasKey("obj")); assertThat(((Map) filteredMap.get("obj")).size(), equalTo(1)); - assertThat(((Map) filteredMap.get("obj")), hasKey("field")); + assertThat(((Map) filteredMap.get("obj")), hasKey("field")); assertThat(filteredMap, hasKey("n_obj")); - assertThat(((Map) filteredMap.get("n_obj")).size(), equalTo(1)); - assertThat(((Map) filteredMap.get("n_obj")), hasKey("n_field")); + assertThat(((Map) filteredMap.get("n_obj")).size(), equalTo(1)); + assertThat(((Map) filteredMap.get("n_obj")), hasKey("n_field")); }