summaryrefslogtreecommitdiff
path: root/core/src/main/java/org/elasticsearch/search/suggest/phrase/Laplace.java
diff options
context:
space:
mode:
authorChristoph Büscher <christoph@elastic.co>2016-04-14 15:47:03 +0200
committerChristoph Büscher <christoph@elastic.co>2016-04-15 15:14:46 +0200
commit15c59d07b325c3e72dd0e8fc90cc0811285efff9 (patch)
treecefcc2596cca06a7aee32048552c9ec026b50962 /core/src/main/java/org/elasticsearch/search/suggest/phrase/Laplace.java
parentcf80b00507d94b61ce1eeb25866cf4277aac00db (diff)
Remove ParseFieldMatcher from AbstractXContentParser
Currently we are able to set a ParseFieldMatcher on XContentParsers, mainly to conveniently carry it around to be available where the actual parsing happens. This was just recently introduced together with ObjectParser so that ObjectParser can make use of deprecation logging and throwing errors while parsing. This however is trappy because we create parsers in so many places in the code and it is easy to forget setting the right ParseFieldMatcher. Instead we should hold the ParseFieldMatcher only in the parse contexts (e.g. QueryParseContext). This PR removes the ParseFieldMatcher from XContentParser. ObjectParser can still make use of it because we can make the otherwise unbounded `context` type to extend an interface that makes sure contexts used in ObjectParser can supply a ParseFieldMatcher. Contexts in ObjectParser are now no longer optional, but it is sufficient to pass in a small lambda expression in places where no other context is available. Relates to #17417
Diffstat (limited to 'core/src/main/java/org/elasticsearch/search/suggest/phrase/Laplace.java')
0 files changed, 0 insertions, 0 deletions