fix(core): make Metadata keys consistently case-insensitive by anuq · Pull Request #1827 · apache/stormcrawler

@anuq @claude

Normalize all keys to lowercase (Locale.ROOT) on every read and write
operation via a private normalizeKey() helper. Previously, getValues()
and containsKey() had a case-insensitive fallback but addValue(),
setValue(), setValues(), addValues(), and remove() stored keys with
their original casing, causing inconsistent behavior.

Fixes apache#1588

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@anuq

…sitive lookup After making all keys lowercase via normalizeKey(), keySet(prefix) was still doing a case-sensitive startsWith() match, causing lookups with uppercase prefixes (e.g. IMAGE., NEWS.) to return empty sets. Fixes SiteMapParserBoltTest failures for extension attribute assertions.

sigee

@anuq @claude

…key lookup

- Replace testCaseInsensitiveKeys with four single-method tests:
  testGetFirstValueIsCaseInsensitive, testContainsKeyIsCaseInsensitive,
  testAddValueIsCaseInsensitive, testRemoveIsCaseInsensitive
- Fix testAddValueIsCaseInsensitive size assertion (1, not 2 — same normalized key)
- Fix checkListKeyFromOpensearch: look up "somekey" (lowercase) since
  normalizeKey() lowercases all keys before storing in OpenSearch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

mvolikas