From bec888fa78e67d2221af2962bbca8e6ed0d9cbfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Thu, 26 Jul 2018 11:15:53 +0200 Subject: [PATCH] Rank-Eval: Reduce scope of an unchecked supression We should only supress the unchecked warnings on ConstructingObjectParser. --- .../java/org/elasticsearch/index/rankeval/RatedRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedRequest.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedRequest.java index 79dd693b3ac..2fe3f1922d5 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedRequest.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RatedRequest.java @@ -70,7 +70,6 @@ import java.util.Set; * } * */ -@SuppressWarnings("unchecked") public class RatedRequest implements Writeable, ToXContentObject { private final String id; private final List 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 PARSER = new ConstructingObjectParser<>("request", a -> new RatedRequest((String) a[0], (List) a[1], (SearchSourceBuilder) a[2], (Map) a[3], (String) a[4]));