davsclaus opened a new pull request, #27017: URL: https://github.com/apache/camel/pull/27017
Fixes [CAMEL-25111](https://issues.apache.org/jira/browse/CAMEL-25111): bugs found in a deep review of the properties component in camel-base. ## Fixed 1. **Reloading is now atomic.** `reloadProperties` cleared the properties of a location and then filled them again, so concurrent lookups could fail with "Property not found" during a reload. The loaded properties now replace the old ones in one step. 2. **Adding a source at runtime could break lookups.** A concurrent lookup could fail with `ConcurrentModificationException`, for example when route reload adds a file source. The list of sources is now thread-safe. 3. **Lookups loaded all properties of a source.** Every lookup from a `LoadablePropertiesSource` that is not a location (such as the MicroProfile Config source) loaded all of that source's properties just to find the location of one property. Only that property is loaded now. 4. **Reloading an optional location failed when the file was missing.** Reloading a `;optional=true` location dropped the optional flag, so it failed if the file had been removed. The flag is now kept. 5. **Unknown resolvers were silently ignored.** A location such as `Classpath:app.properties` or `C:\app.properties` is now an error when Camel starts, unless the location is optional or `ignoreMissingLocation` is set. 6. **`addLocation(PropertiesLocation)` did not work.** It never created a properties source, and it failed with `UnsupportedOperationException` after `setLocation`. 7. **Environment variable lookups failed in the Turkish locale.** `IOHelper` upper-cases keys with `Locale.ENGLISH` now, so `file.index` no longer becomes `FİLE_İNDEX`. 8. **Functions could be created more than once.** A properties function resolved from several threads at the same time could be created and started several times. It is now created once. 9. **`getResolvedValue` threw `NullPointerException` before the component was built.** 10. **The `service` function missed camelCase names.** It upper-cased the name before looking up environment variables, so `service:mySvc` was not found, while `service.host` and `service.port` found it. It now uses the same lookup as those two. 11. **Override and initial properties reported the wrong source.** The location of `OrderedLocationProperties` used as override or initial properties is now reported, instead of `OverrideProperties` / `InitialProperties`. 12. **A `;` in a location path cut the path short.** It now only starts an option when `optional=` follows. The upgrade guide covers 5 and 12. ## Not changed - The documentation shows `{{env:X}}` in locations. That is only resolved when the location itself is set through property binding. - A missing `ref:` location is only detected when a property is looked up. ## Tests - **New tests:** `PropertiesComponentEdgeCasesTest` (camel-core) and a Turkish-locale test in `IOHelperTest` (camel-util). All 11 new tests fail without the fix, including the concurrency tests (69 misses during reload, `ConcurrentModificationException`, the function created 16 times). - **Full suites:** camel-core and its upstream modules pass (7830 tests in camel-core, built with `-am`). _Claude Code on behalf of Claus Ibsen_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
