Browse Source

Rank-Eval: Reduce scope of an unchecked supression

We should only supress the unchecked warnings on ConstructingObjectParser.
Christoph Büscher 7 years ago
parent
commit
bec888fa78

+ 1 - 1
modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedRequest.java

@@ -70,7 +70,6 @@ import java.util.Set;
  * }
  * </pre>
  */
-@SuppressWarnings("unchecked")
 public class RatedRequest implements Writeable, ToXContentObject {
     private final String id;
     private final List<String> summaryFields;
@@ -250,6 +249,7 @@ public class RatedRequest implements Writeable, ToXContentObject {
     private static final ParseField FIELDS_FIELD = new ParseField("summary_fields");
     private static final ParseField TEMPLATE_ID_FIELD = new ParseField("template_id");
 
+    @SuppressWarnings("unchecked")
     private static final ConstructingObjectParser<RatedRequest, Void> PARSER = new ConstructingObjectParser<>("request",
             a -> new RatedRequest((String) a[0], (List<RatedDocument>) a[1], (SearchSourceBuilder) a[2], (Map<String, Object>) a[3],
                     (String) a[4]));