Skip to content

Commit a25baf5

Browse files
committed
correct logic
1 parent 68f3a76 commit a25baf5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,10 @@ private void throwExpectedStartObject(XContentParser parser, XContentParser.Toke
334334
private static void throwMissingRequiredFields(List<String[]> requiredFields) {
335335
final StringBuilder message = new StringBuilder();
336336
for (String[] fields : requiredFields) {
337-
message.append("Required one of fields ").append(Arrays.toString(fields)).append(", but none were specified.");
337+
message.append("Required one of fields ").append(Arrays.toString(fields)).append(", but none were specified. ");
338+
}
339+
if (message.isEmpty() == false) {
340+
message.delete(message.length() - 1, message.length());
338341
}
339342
throw new IllegalArgumentException(message.toString());
340343
}

0 commit comments

Comments
 (0)