Browse Source

fixed typo in ConstructingObjectParse (#27129)

olcbean 8 years ago
parent
commit
35a2cc1003

+ 1 - 1
core/src/main/java/org/elasticsearch/common/xcontent/ConstructingObjectParser.java

@@ -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.

+ 1 - 1
core/src/test/java/org/elasticsearch/common/xcontent/ConstructingObjectParserTests.java

@@ -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());
         }
     }