{"record":{"id":"a0cf5383573f9049","repo":"pinpoint-apm/pinpoint","slug":"invalid-value-value","errorCode":null,"errorMessage":"Invalid value:<value>","messagePattern":"Invalid value:<value>","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"commons-config/src/main/java/com/navercorp/pinpoint/common/config/util/ValueAnnotationProcessor.java","lineNumber":175,"sourceCode":"        } else if (type == boolean.class || type == Boolean.class) {\n            return Boolean.parseBoolean(value);\n        } else if (type == double.class || type == Double.class) {\n            return Double.parseDouble(value);\n        } else if (type == float.class || type == Float.class) {\n            return Float.parseFloat(value);\n        } else if (type == short.class || type == Short.class) {\n            return Short.parseShort(value);\n        } else if (type == byte.class || type == Byte.class) {\n            return Byte.parseByte(value);\n        } else if (type == char.class || type == Character.class) {\n            return parseChar(value);\n        }\n        throw new ConfigurationException(\"Unsupported type:\" + type.getName());\n    }\n\n    private char parseChar(String value) {\n        if (value.length() != 1) {\n            throw new IllegalArgumentException(\"Invalid value:\" + value);\n        }\n        return value.charAt(0);\n    }\n\n    private void injectField(Field field, Object target, String value) {\n        final Class<?> fieldType = field.getType();\n\n        try {\n            final Object parsedValue = parse(fieldType, value);\n            if (parsedValue != null) {\n                try {\n                    setAccessible(field);\n                    field.set(target, parsedValue);\n                } catch (ReflectiveOperationException e) {\n                    throw new ConfigurationException(getFieldName(target, field) + \" access error\", e);\n                }\n            }\n        } catch (Exception ex) {","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/commons-config/src/main/java/com/navercorp/pinpoint/common/config/util/ValueAnnotationProcessor.java#L157-L193","documentation":"When parse() encounters a char/Character target it delegates to parseChar(), which requires the resolved property string to be exactly one character long. Any other length throws IllegalArgumentException (wrapped later by injectField into RuntimeException). This is a strict single-character value validation.","triggerScenarios":"A @Value-annotated char/Character field or setter receives a property value whose string length is not 1, e.g. an empty string, a multi-character word, or a value with trailing whitespace/newline from the config file.","commonSituations":"Config file contains 'separator=;;' or 'mode=abc' for a char field; property value has invisible trailing whitespace or a CRLF; placeholder resolution produced an empty string because the key was missing a default.","solutions":["Set the config value to exactly one character, trimming surrounding whitespace","Add a default in the placeholder, e.g. ${key:|} style defaults, so resolution never yields empty","Change the field type to String if the value can legitimately be longer than one character"],"exampleFix":"// before (config)\nseparator=;;\n// after (config)\nseparator=;","handlingStrategy":"validation","validationCode":"if (value == null || value.trim().length() != 1) {\n    throw new IllegalStateException(\"char property must be exactly one character, got: '\" + value + \"'\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    processor.process(configInstance, resolver);\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"Invalid value:\")) {\n        log.error(\"char config value must be a single character\");\n    }\n}","preventionTips":["Verify char config values are exactly one character in the properties file","Beware trailing whitespace/newlines (CRLF) in property values — trim them","Prefer String fields when the value may be longer than one character"],"tags":["java","configuration","char","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}