From 55e1da0b0cea242ed13187d9e1d0664aaf1d0157 Mon Sep 17 00:00:00 2001 From: olcbean Date: Fri, 20 Oct 2017 02:04:20 +0200 Subject: [PATCH] fixed typo in ConstructingObjectParse --- .../elasticsearch/common/xcontent/ConstructingObjectParser.java | 2 +- .../common/xcontent/ConstructingObjectParserTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/common/xcontent/ConstructingObjectParser.java b/core/src/main/java/org/elasticsearch/common/xcontent/ConstructingObjectParser.java index d77abac198097..03f6b14f525ec 100644 --- a/core/src/main/java/org/elasticsearch/common/xcontent/ConstructingObjectParser.java +++ b/core/src/main/java/org/elasticsearch/common/xcontent/ConstructingObjectParser.java @@ -453,7 +453,7 @@ private Value finish() { * 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. diff --git a/core/src/test/java/org/elasticsearch/common/xcontent/ConstructingObjectParserTests.java b/core/src/test/java/org/elasticsearch/common/xcontent/ConstructingObjectParserTests.java index bc0bd430a8892..7e5bdbd017449 100644 --- a/core/src/test/java/org/elasticsearch/common/xcontent/ConstructingObjectParserTests.java +++ b/core/src/test/java/org/elasticsearch/common/xcontent/ConstructingObjectParserTests.java @@ -224,7 +224,7 @@ class NoConstructorArgs { 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()); } }