{"record":{"id":"6ca34d6aee707b05","repo":"apache/beam","slug":"class-s-missing-a-property-named-s-did-you-mean-s","errorCode":null,"errorMessage":"Class %s missing a property named '%s'. Did you mean '%s'?","messagePattern":"Class (.+?) missing a property named '(.+?)'\\. Did you mean '(.+?)'\\?","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/options/PipelineOptionsFactory.java","lineNumber":1897,"sourceCode":"      propertyNamesToGetters.put(descriptor.getName(), descriptor.getReadMethod());\n    }\n    Map<String, Object> convertedOptions = Maps.newHashMap();\n    for (final Map.Entry<String, Collection<String>> entry : options.asMap().entrySet()) {\n      try {\n        // Search for close matches for missing properties.\n        // Either off by one or off by two character errors.\n        if (!propertyNamesToGetters.containsKey(entry.getKey())) {\n          SortedSet<String> closestMatches =\n              new TreeSet<>(\n                  Sets.filter(\n                      propertyNamesToGetters.keySet(),\n                      input -> StringUtils.getLevenshteinDistance(entry.getKey(), input) <= 2));\n          switch (closestMatches.size()) {\n            case 0:\n              throw new IllegalArgumentException(\n                  String.format(\"Class %s missing a property named '%s'.\", klass, entry.getKey()));\n            case 1:\n              throw new IllegalArgumentException(\n                  String.format(\n                      \"Class %s missing a property named '%s'. Did you mean '%s'?\",\n                      klass, entry.getKey(), Iterables.getOnlyElement(closestMatches)));\n            default:\n              throw new IllegalArgumentException(\n                  String.format(\n                      \"Class %s missing a property named '%s'. Did you mean one of %s?\",\n                      klass, entry.getKey(), closestMatches));\n          }\n        }\n        Method method = propertyNamesToGetters.get(entry.getKey());\n        // Only allow empty argument values for String, String Array, and\n        // Collection<String>.\n        Class<?> returnType = method.getReturnType();\n        JavaType type = MAPPER.getTypeFactory().constructType(method.getGenericReturnType());\n\n        if (\"runner\".equals(entry.getKey())) {\n          String runner = Iterables.getOnlyElement(entry.getValue());","sourceCodeStart":1879,"sourceCodeEnd":1915,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/options/PipelineOptionsFactory.java#L1879-L1915","documentation":"Same missing-property error as its sibling, but Beam found exactly one existing property within Levenshtein distance 2 and suggests it: 'Did you mean <suggestion>?'. Thrown as IllegalArgumentException while converting string/JSON args to typed options.","triggerScenarios":"Setting an option key that doesn't exist but closely matches one existing property (edit distance <= 2), via fromArgs --flags or a JSON options map.","commonSituations":"Singular/plural mistakes (worker vs workers), swapped adjacent letters, or wrong capitalization of a single property name.","solutions":["Use the suggested property name from the error message","Run with --help=<class> to confirm the exact property spelling"],"exampleFix":"// before\n--numWorkerss=4\n// after\n--numWorkers=4","handlingStrategy":"validation","validationCode":"List<String> candidates = allProps.stream().filter(p -> Math.abs(p.length() - key.length()) <= 2).collect(toList());\nif (!allProps.contains(key) && candidates.size() == 1) key = candidates.get(0);","typeGuard":null,"tryCatchPattern":"catch (IllegalArgumentException e) { if (e.getMessage().contains(\"Did you mean\")) { /* adopt suggested name */ } }","preventionTips":["Copy flag names from --help output rather than typing from memory","Use IDE completion on the options interface instead of string flags"],"tags":["java","apache-beam","cli","typo","pipeline-options"],"backgroundTag":"invalid-cli-argument","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}