gnodet-bot commented on code in PR #28364:
URL: https://github.com/apache/camel/pull/28364#discussion_r4367957961
##########
core/camel-support/src/main/java/org/apache/camel/support/component/ApiMethodPropertiesHelper.java:
##########
@@ -88,6 +88,10 @@ public Map<String, Object> getExchangeProperties(Exchange
exchange, Map<String,
int nProperties = 0;
for (Map.Entry<String, Object> entry :
exchange.getIn().getHeaders().entrySet()) {
final String key = entry.getKey();
+ if (key.length() < prefixLength || key.equals(propertyPrefix)) {
+ // a header named as the prefix, or as the camel case prefix,
names no property
Review Comment:
💬 **Nit:** The comment says *"named as the prefix, or as the camel case
prefix"* as if both conditions are caught by `key.equals(propertyPrefix)`, but
they're actually caught by different branches of the `||`:
- `key.length() < prefixLength` catches the camel-case prefix (e.g.
`"CamelFhir"` — shorter because it lacks the dot)
- `key.equals(propertyPrefix)` catches the exact prefix string (e.g.
`"CamelFhir."`)
Suggestion to make this explicit:
```suggestion
// a header shorter than the prefix catches the camel case
prefix (e.g. "CamelFhir"
// for prefix "CamelFhir."), and a header equal to the
prefix itself (e.g. "CamelFhir.")
// also names no property
```
--
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]