[ 
https://issues.apache.org/jira/browse/CAMEL-24268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18099945#comment-18099945
 ] 

Guillaume Nodet commented on CAMEL-24268:
-----------------------------------------

This issue is being investigated by a coding agent (Claude Code on behalf of 
gnodet).

Analysis: The resumeInflightExchanges field is confirmed write-only dead code 
after the ThrottlingLimits holder refactoring. It is written by two setters but 
never read anywhere, has no getter, and is not in toString(). The fix is to 
remove the dead field and derive the default programmatically.

_Note: This comment was generated by a coding agent and requires manual 
verification._

> ThrottlingInflightRoutePolicy: resumeInflightExchanges field is write-only 
> after holder refactoring
> ---------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-24268
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24268
>             Project: Camel
>          Issue Type: Task
>          Components: camel-core
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>            Priority: Major
>              Labels: good-first-issue
>
> Found during review of PR #24985 (CAMEL-24227: volatile sweep for 
> JMX-writable fields). After introducing the {{ThrottlingLimits}} immutable 
> holder, the {{resumeInflightExchanges}} field became write-only.
> h3. Problem
> After the holder refactoring in PR #24985:
> # {{resumeInflightExchanges}} is written by the setters but never read 
> directly — {{startConsumer()}} now takes it as a parameter from the holder 
> snapshot
> # There is no getter for {{resumeInflightExchanges}}
> # {{toString()}} does not use it
> # The default value is duplicated between the field initializer and the 
> literal {{new ThrottlingLimits(...)}} constructor call
> This is dead code / unnecessary state that should be cleaned up.
> h3. Suggested fix
> Remove the {{resumeInflightExchanges}} field entirely and derive the value 
> only when constructing a new {{ThrottlingLimits}} holder. Remove the 
> duplicated default.
> h3. References
> * PR [#24985|https://github.com/apache/camel/pull/24985] review comment by 
> oscerd
> * 
> {{core/camel-core-processor/src/main/java/org/apache/camel/processor/ThrottlingInflightRoutePolicy.java}}



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

Reply via email to