Skip to content

Commit f4733f4

Browse files
committed
Try more
1 parent 6652462 commit f4733f4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

server/src/main/java/org/elasticsearch/index/mapper/DotExpandingXContentParser.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public Token nextToken() throws IOException {
5858
Token token;
5959
// cache object field (even when final this is a valid optimization, see https://openjdk.org/jeps/8132243)
6060
var parsers = this.parsers;
61-
while ((token = currentParser.nextToken()) == null) {
61+
while ((token = getNextToken(currentParser)) == null) {
6262
currentParser = parsers.pollFirst();
6363
if (currentParser == null) {
6464
return null;
@@ -72,6 +72,14 @@ public Token nextToken() throws IOException {
7272
return Token.FIELD_NAME;
7373
}
7474

75+
private static Token getNextToken(XContentParser parser) throws IOException {
76+
if (parser instanceof DotExpandingXContentParser dot) {
77+
return dot.nextToken();
78+
} else {
79+
return parser.nextToken();
80+
}
81+
}
82+
7583
private void expandDots(XContentParser delegate) throws IOException {
7684
// this handles fields that belong to objects that can't hold subobjects, where the document specifies
7785
// the object holding the flat fields

0 commit comments

Comments
 (0)