Skip to content

Commit e535864

Browse files
committed
Resolving issues
1 parent fafb50f commit e535864

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public final class RRFRetrieverBuilder extends CompoundRetrieverBuilder<RRFRetri
106106
return fields;
107107
}, FIELDS_FIELD, ObjectParser.ValueType.STRING_ARRAY);
108108
PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), QUERY_FIELD);
109-
PARSER.declareInt(ConstructingObjectParser.optionalConstructorArg(), RankBuilder.RANK_WINDOW_SIZE_FIELD);
109+
PARSER.declareInt(ConstructingObjectParser.optionalConstructorArg(), RANK_WINDOW_SIZE_FIELD);
110110
PARSER.declareInt(ConstructingObjectParser.optionalConstructorArg(), RANK_CONSTANT_FIELD);
111111
PARSER.declareFloatArray(ConstructingObjectParser.optionalConstructorArg(), WEIGHTS_FIELD);
112112
RetrieverBuilder.declareBaseParserFields(PARSER);

x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverComponent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.elasticsearch.xcontent.XContentParser;
1818

1919
import java.io.IOException;
20+
import java.util.Objects;
2021

2122
import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg;
2223
import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg;
@@ -31,8 +32,7 @@ public class RRFRetrieverComponent implements ToXContentObject {
3132
final float weight;
3233

3334
public RRFRetrieverComponent(RetrieverBuilder retrieverBuilder, Float weight) {
34-
assert retrieverBuilder != null;
35-
this.retriever = retrieverBuilder;
35+
this.retriever = Objects.requireNonNull(retrieverBuilder, "retrieverBuilder must not be null");
3636
this.weight = weight == null ? DEFAULT_WEIGHT : weight;
3737
if (this.weight < 0) {
3838
throw new IllegalArgumentException("[weight] must be non-negative, found [" + this.weight + "]");

0 commit comments

Comments
 (0)