Skip to content

Commit ab89b87

Browse files
authored
Change exceptions to IllegalArgumentException in GroupingDocValuesSelector (elastic#128348) (elastic#128355)
# Conflicts: # server/src/main/java/org/elasticsearch/lucene/grouping/GroupingDocValuesSelector.java
1 parent ce28a88 commit ab89b87

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/src/main/java/org/elasticsearch/lucene/grouping/GroupingDocValuesSelector.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void setNextReader(LeafReaderContext readerContext) throws IOException {
100100
public boolean advanceExact(int target) throws IOException {
101101
if (sorted.advanceExact(target)) {
102102
if (sorted.docValueCount() > 1) {
103-
throw new IllegalStateException(
103+
throw new IllegalArgumentException(
104104
"failed to extract doc:" + target + ", the grouping field must be single valued"
105105
);
106106
}
@@ -124,7 +124,7 @@ public long longValue() throws IOException {
124124
};
125125
}
126126
}
127-
default -> throw new IllegalStateException("unexpected doc values type " + type + "` for field `" + field + "`");
127+
default -> throw new IllegalArgumentException("unexpected doc values type " + type + "` for field `" + field + "`");
128128
}
129129
}
130130

@@ -201,7 +201,7 @@ public boolean advanceExact(int target) throws IOException {
201201
if (sorted.advanceExact(target)) {
202202
ord = (int) sorted.nextOrd();
203203
if (sorted.nextOrd() != SortedSetDocValues.NO_MORE_ORDS) {
204-
throw new IllegalStateException(
204+
throw new IllegalArgumentException(
205205
"failed to extract doc:" + target + ", the grouping field must be single valued"
206206
);
207207
}
@@ -233,7 +233,7 @@ public int getValueCount() {
233233
};
234234
}
235235
}
236-
default -> throw new IllegalStateException("unexpected doc values type " + type + "` for field `" + field + "`");
236+
default -> throw new IllegalArgumentException("unexpected doc values type " + type + "` for field `" + field + "`");
237237
}
238238
}
239239

0 commit comments

Comments
 (0)