[
https://issues.apache.org/jira/browse/CAMEL-25631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18127096#comment-18127096
]
Guillaume Nodet commented on CAMEL-25631:
-----------------------------------------
This issue is being investigated by a coding agent (on behalf of gnodet).
Confirmed: clearRouteModel() is not yet deprecated on main. The scope is small
and well-defined - 3 files involved:
- Route.java (API interface): void clearRouteModel() at line 393 - needs
@Deprecated annotation and updated javadoc
- DefaultRoute.java (implementation): public void clearRouteModel() - needs
@Deprecated annotation
- RouteReifier.java: calls route::clearRouteModel during startup bootstrap -
should stop calling it per the JIRA proposal
This is a single-method deprecation with exactly 1 call site and 1
implementation. Clean, bounded scope.
_Note: This comment was generated by an AI coding agent and requires manual
verification._
> camel-core - Deprecate Route.clearRouteModel and remove it in a later release
> -----------------------------------------------------------------------------
>
> Key: CAMEL-25631
> URL: https://issues.apache.org/jira/browse/CAMEL-25631
> Project: Camel
> Issue Type: Task
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Guillaume Nodet
> Priority: Major
> Fix For: 4.24.0
>
>
> {{Route.clearRouteModel()}} drops the references a runtime route holds to its
> model once the route is created: the route definition, the error handler
> factory and the error handlers by factory. It came from the lightweight work:
> * CAMEL-15795 (2020) added it, so the runtime route is not tied to the model
> after the reifier has created it.
> * CAMEL-15802 and CAMEL-15839 (2020) also cleared the error handler factory,
> for the lightweight context.
> * CAMEL-18421 (2022) limited it to the startup phase, so routes added after
> startup keep their model.
> * CAMEL-19292 (2023) removed the experimental {{LightweightCamelContext}},
> its main user.
> The CamelContext keeps the route definitions in its model anyway (the
> route-structure and route-topology dumps read them from there), so the
> clearing saves little today. It also makes the runtime route differ by when
> it was added: {{getRoute()}} and {{getErrorHandlerFactory()}} return null for
> a route created at startup, but not for a route added later.
> Proposal:
> * Deprecate {{Route.clearRouteModel()}} in 4.24 and stop calling it from
> {{RouteReifier}}.
> * Update the javadoc of {{Route.getRoute()}}, which says it is null after the
> route has been created.
> * Note the deprecation in the 4.24 upgrade guide.
> * Remove the method in a later release.
> Found while working on CAMEL-25466.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)