fixed typo in ConstructingObjectParse (#27129)

This commit is contained in:
olcbean 2017-10-26 21:14:56 +02:00 committed by Lee Hinman
parent dda5d1af29
commit 35a2cc1003
2 changed files with 2 additions and 2 deletions

View File

@ -453,7 +453,7 @@ public final class ConstructingObjectParser<Value, Context> extends AbstractObje
* use of ConstructingObjectParser. You should be using ObjectParser instead. Since this is more of a programmer error and the
* parser ought to still work we just assert this.
*/
assert false == constructorArgInfos.isEmpty() : "[" + objectParser.getName() + "] must configure at least on constructor "
assert false == constructorArgInfos.isEmpty() : "[" + objectParser.getName() + "] must configure at least one constructor "
+ "argument. If it doesn't have any it should use ObjectParser instead of ConstructingObjectParser. This is a bug "
+ "in the parser declaration.";
// All missing constructor arguments were optional. Just build the target and return it.

View File

@ -224,7 +224,7 @@ public class ConstructingObjectParserTests extends ESTestCase {
parser.apply(createParser(JsonXContent.jsonXContent, "{}"), null);
fail("Expected AssertionError");
} catch (AssertionError e) {
assertEquals("[constructor_args_required] must configure at least on constructor argument. If it doesn't have any it should "
assertEquals("[constructor_args_required] must configure at least one constructor argument. If it doesn't have any it should "
+ "use ObjectParser instead of ConstructingObjectParser. This is a bug in the parser declaration.", e.getMessage());
}
}