Skip to content

getMap error message shows null value for hyphenated or mixed-case property names #8642

Description

@thswlsqls

Describe the bug
DefaultConfigProperties.getMap(String) builds the "Invalid map property" error message with the raw property name, so the value shown is null whenever the caller passes a name that needs normalization (hyphens or upper case).

Steps to reproduce
Call getMap with a hyphenated name whose value is a malformed map entry:

DefaultConfigProperties.createFromMap(Collections.singletonMap("test-map", "a=1,b"))
    .getMap("test-map");

What did you expect to see?
A message reporting the actual configured value, e.g. Invalid map property: test-map=a=1,b, matching the value lookup that getList already does with ConfigUtil.normalizePropertyKey.

What did you see instead?
Invalid map property: test-map=null. The stored config keys are normalized (test-map -> test.map), but DefaultConfigProperties.getMap() looks the value up with the un-normalized name via config.get(name), so the lookup misses and prints null.

What version and what artifacts are you using?
Artifacts: opentelemetry-sdk-extension-autoconfigure-spi
Version: main @ 09d6c17
How did you reference these artifacts? Gradle, io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi

Environment
Compiler: Temurin 21
OS: N/A

Additional context
Only the error message string is affected; getMap's normal return path already uses the normalized key, so hyphenated or mixed-case names work otherwise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions