{"record":{"id":"0b0dd5ecbee85e6f","repo":"stanfordnlp/CoreNLP","slug":"unrecognized-option-key","errorCode":null,"errorMessage":"Unrecognized option: ${key}","messagePattern":"Unrecognized option: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/edu/stanford/nlp/util/ArgumentParser.java","lineNumber":440,"sourceCode":"      // (get values)\n      String value = entry.getValue().toString();\n      assert value != null;\n      Field target = canFill.get(key);\n      // (mark required option as fulfilled)\n      Pair<Boolean, Boolean> mark = required.get(key);\n      if (mark != null && mark.first) {\n        required.put(key, Pair.makePair(true, true));\n      }\n      // (fill the field)\n      if (target != null) {\n        // (case: declared option)\n        fillField(class2object.get(target.getDeclaringClass()), target, value);\n      } else if (ensureAllOptions) {\n        // (case: undeclared option)\n        // split the key\n        int lastDotIndex = rawKeyStr.lastIndexOf('.');\n        if (lastDotIndex < 0) {\n          err(\"Unrecognized option: \" + key);\n          continue;\n        }\n        if (!rawKeyStr.startsWith(\"log.\")) {  // ignore Redwood options\n          String className = rawKeyStr.substring(0, lastDotIndex);\n          // get the class\n          Class clazz = null;\n          try {\n            clazz = ClassLoader.getSystemClassLoader().loadClass(className);\n          } catch (Exception e) {\n            err(\"Could not set option: \" + entry.getKey() + \"; either the option is mistyped, not defined, or the class \" + className + \" does not exist.\");\n          }\n          // get the field\n          if (clazz != null) {\n            String fieldName = rawKeyStr.substring(lastDotIndex + 1);\n            try {\n              target = clazz.getField(fieldName);\n            } catch (Exception e) {\n              err(\"Could not set option: \" + entry.getKey() + \"; no such field: \" + fieldName + \" in class: \" + className);","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/util/ArgumentParser.java#L422-L458","documentation":"ArgumentParser.fillOptionsImpl, when ensureAllOptions is enabled, treats every property key as 'ClassName.fieldName'. If the key has no dot it cannot map to a class field and is reported as an unrecognized option (skipped).","triggerScenarios":"Passing a properties entry whose key contains no '.' (e.g. 'verbose=true') to fillOptions(..., ensureAllOptions=true) or bootstrapMap with the same flag.","commonSituations":"Users writing flat properties keys instead of fully-qualified option names; copying config from another tool; typos that drop the class prefix.","solutions":["Use the fully-qualified form 'fully.qualified.ClassName.fieldName' for the property key","Declare the option as a public static field on a class and reference it with the dotted path","Set ensureAllOptions=false if unknown keys should be silently ignored","Remove or rename the malformed key"],"exampleFix":"// before\nverbose=true\n// after\nedu.stanford.nlp.pipeline.StanfordCoreNLP.verbose=true","handlingStrategy":"validation","validationCode":"for (String key : props.stringPropertyNames()) {\n  if (ensureAllOptions && !key.contains(\".\"))\n    throw new IllegalArgumentException(\"option key must be Class.field: \" + key);\n}","typeGuard":null,"tryCatchPattern":"try {\n  ArgumentParser.fillOptions(cls, props, true);\n} catch (RuntimeException e) {\n  log.error(\"bad properties: \" + e.getMessage());\n}","preventionTips":["Always use fully-qualified 'package.Class.field' option keys","Set ensureAllOptions=false when unknown keys are acceptable","Lint properties files for keys lacking a dot","Keep a canonical sample properties file per pipeline"],"tags":["java","configuration","properties","argument-parsing"],"backgroundTag":"invalid-config-value","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}