Skip to content

Optimize XContent Object Parsers #78813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public <T> void declareField(BiConsumer<Value, T> consumer, CheckedFunction<XCon
}

public <T> void declareObject(BiConsumer<Value, T> consumer, ContextParser<Context, T> objectParser, ParseField field) {
declareField(consumer, (p, c) -> objectParser.parse(p, c), field, ValueType.OBJECT);
declareField(consumer, objectParser, field, ValueType.OBJECT);
}

/**
Expand Down Expand Up @@ -240,7 +240,7 @@ public void declareBoolean(BiConsumer<Value, Boolean> consumer, ParseField field
}

public <T> void declareObjectArray(BiConsumer<Value, List<T>> consumer, ContextParser<Context, T> objectParser, ParseField field) {
declareFieldArray(consumer, (p, c) -> objectParser.parse(p, c), field, ValueType.OBJECT_ARRAY);
declareFieldArray(consumer, objectParser, field, ValueType.OBJECT_ARRAY);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ private class Target {
/**
* The parse context that is used for this invocation. Stored here so that it can be passed to the {@link #builder}.
*/
private Context context;
private final Context context;

/**
* How many of the constructor parameters have we collected? We keep track of this so we don't have to count the
Expand Down
Loading