gnodet opened a new pull request, #27835: URL: https://github.com/apache/camel/pull/27835
## Summary Deprecates `Route.clearRouteModel()` as proposed in [CAMEL-25631](https://issues.apache.org/jira/browse/CAMEL-25631). ## Changes - **`Route.java`** (API interface): added `@Deprecated(since = "4.24.0", forRemoval = true)` and updated javadoc. Also corrected `getRoute()` javadoc (it said the return was `null` after route creation — that is no longer true). - **`DefaultRoute.java`** (implementation): added `@Deprecated`, turned body into a no-op (clears nothing). The model is kept on the route. - **`RouteReifier.java`**: removed the `addBootstrap(route::clearRouteModel)` call site (and the now-unused `ServiceStatus` import). Routes created at startup now retain their model, making `Route.getRoute()` and `Route.getErrorHandlerFactory()` consistent regardless of when a route was added. - **`camel-4x-upgrade-guide-4_24.adoc`**: added upgrade guide entry. ## Background `clearRouteModel()` was introduced in 2020 for the lightweight context (CAMEL-15795). The lightweight context was removed in 2023 (CAMEL-19292). Since then, the `CamelContext` already keeps route definitions in its model, so clearing them on the `Route` object saves little memory but inconsistently makes `Route.getRoute()` and `Route.getErrorHandlerFactory()` return `null` only for routes created at startup (found while working on CAMEL-25466). ## Testing Built and tested locally: ``` mvn verify -B -pl core/camel-api,core/camel-base-engine,core/camel-core-reifier -am -Dlicense.skip ``` → BUILD SUCCESS (all tests pass) _This PR was opened by Hermes Agent on behalf of gnodet._ -- 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]
