{"record":{"id":"671d2c6261147761","repo":"projectlombok/lombok","slug":"invalid-value-value","errorCode":null,"errorMessage":"Invalid value: ${value}","messagePattern":"Invalid value: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/core/lombok/core/configuration/ConfigurationDataType.java","lineNumber":116,"sourceCode":"\t\t\t@Override public String exampleValue() {\n\t\t\t\treturn \"[false | true]\";\n\t\t\t}\n\t\t});\n\t\tSIMPLE_TYPES = map;\n\t}\n\t\n\tprivate static ConfigurationValueParser enumParser(final Type enumType) {\n\t\tfinal Class<?> type = (Class<?>) enumType;\n\t\t@SuppressWarnings(\"rawtypes\") final Class rawType = type;\n\t\t\n\t\treturn new ConfigurationValueParser() {\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\t@Override public Object parse(String value) {\n\t\t\t\tif (enumType instanceof Class<?> && MappedConfigEnum.class.isAssignableFrom(type)) {\n\t\t\t\t\tfor (Object enumVal : ((Class<?>) enumType).getEnumConstants()) {\n\t\t\t\t\t\tif (((MappedConfigEnum) enumVal).matches(value)) return enumVal;\n\t\t\t\t\t}\n\t\t\t\t\tthrow new IllegalArgumentException(\"Invalid value: \" + value);\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn Enum.valueOf(rawType, value);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\t\t\tfor (int i = 0; i < value.length(); i++) {\n\t\t\t\t\t\t\tchar c = value.charAt(i);\n\t\t\t\t\t\t\tif (Character.isUpperCase(c) && i > 0) sb.append(\"_\");\n\t\t\t\t\t\t\tsb.append(Character.toUpperCase(c));\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn Enum.valueOf(rawType, sb.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t@Override public String description() {\n\t\t\t\treturn \"enum (\" + type.getName() + \")\";\n\t\t\t}","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/projectlombok/lombok/blob/6d6a3e9fec0a9555702561fbeb8eac836575116e/src/core/lombok/core/configuration/ConfigurationDataType.java#L98-L134","documentation":"ConfigurationDataType.parse for enum-typed configuration keys resolves a string to an enum constant. If the enum implements MappedConfigEnum, matching is done via matches(); when no constant matches, 'Invalid value: <value>' is thrown. This validates values like log, accessibility, flag usage enums in lombok.config.","triggerScenarios":"A lombok.config key whose data type is an enum is given a string that matches no constant of the mapped enum type; Enum.valueOf fallback path also wraps unknown values into this error family.","commonSituations":"Misspelling an enum value in lombok.config (e.g. 'fieldInsteadof getter' variants), using a value removed/renamed in a newer Lombok, or adding whitespace/casing differences.","solutions":["Correct the value to one of the enum's accepted constants (check the key's documentation in Lombok).","Check exact spelling, casing, and no stray whitespace in lombok.config.","If the value was renamed, upgrade/downgrade Lombok or migrate to the new value name."],"exampleFix":"// before (lombok.config)\nlombok.accessors.flagUsage = bleh\n// after\nlombok.accessors.flagUsage = error","handlingStrategy":"validation","validationCode":"boolean isValidEnumConfigValue(Class<?> enumType, String value) {\n  for (Object c : enumType.getEnumConstants()) {\n    if (c instanceof MappedConfigEnum && ((MappedConfigEnum) c).matches(value)) return true;\n  }\n  try { Enum.valueOf((Class<? extends Enum>) enumType.asSubclass(Enum.class), value); return true; } catch (Exception e) { return false; }\n}","typeGuard":null,"tryCatchPattern":"try {\n  Object parsed = configDataType.parse(value);\n} catch (IllegalArgumentException e) {\n  // log the offending value and use the key's documented default\n}","preventionTips":["Copy enum values from the Lombok documentation for the exact key.","Check for typos, casing, and whitespace in lombok.config values.","Review changelogs when upgrading Lombok for renamed enum values."],"tags":["lombok","configuration","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"6d6a3e9fec0a9555702561fbeb8eac836575116e","analyzedAt":"2026-09-07T23:18:01.841Z","contentChangedAt":"2026-09-07T23:18:01.841Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}