You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/07/09 08:55:00 UTC

[jira] [Resolved] (CAMEL-23971) BaseOrderedProperties missing containsKey/contains/containsValue overrides

     [ https://issues.apache.org/jira/browse/CAMEL-23971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-23971.
---------------------------------
    Resolution: Fixed

> BaseOrderedProperties missing containsKey/contains/containsValue overrides
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-23971
>                 URL: https://issues.apache.org/jira/browse/CAMEL-23971
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Adriano Machado
>            Assignee: Adriano Machado
>            Priority: Minor
>             Fix For: 4.22.0
>
>
> BaseOrderedProperties (in core/camel-util) extends Properties which extends Hashtable, but stores all data in a private LinkedHashMap. It overrides put(), get(), getProperty(), keySet(), remove(), etc. to delegate to the map, but does NOT override containsKey(), contains(), or containsValue().
> Because put() never stores into the parent Hashtable, the inherited Hashtable.containsKey() always returns false. This silently breaks ~10 call sites across the codebase:
> - VersionSetTest: assertions are vacuously true (always pass regardless of actual state)
> - DependencyList, ExportBaseCommand, ExportSpringBoot, ExportCamelMain, ExportQuarkus: conditional guards that never fire, so properties are always overwritten instead of preserved
> - BaseMainSupport, MainHelper: property-consumed checks that never detect consumed properties
> Discovered while working on CAMEL-23867 (TUI settings per-key config routing). The immediate workaround there was to use getProperty(key) != null instead of containsKey(key), but the root cause belongs in BaseOrderedProperties.
> Fix: add three overrides delegating to the internal map (containsKey, containsValue, and the legacy contains). This affects OrderedProperties, CamelCaseOrderedProperties, and OrderedLocationProperties (all subclasses). A full build is needed to verify that fixing the bug does not break tests that accidentally depended on the broken behavior.
> _Reported by Claude Code on behalf of Adriano Machado._



--
This message was sent by Atlassian Jira
(v8.20.10#820010)