mayurbm commented on PR #25554:
URL: https://github.com/apache/camel/pull/25554#issuecomment-5450809147

   @davsclaus Added a new test that genuinely exercises the second catch site, 
plus corrected the misleading Javadoc on the existing test.
   
   **New test: `testRoutePolicyOnStartProducesFailedToStartRouteException`**
   
   A `RoutePolicy` whose `onStart()` throws a bare `NullPointerException` is 
attached to the route. The call chain is:
   
   ```
   routeService.start()                          ← second catch site
     → BaseService.start() → doStart()
       → DefaultRoute.doStart()
         → routePolicyCallback(RoutePolicy::onStart)
           → NullPointerException thrown here
   ```
   
   The consumer (`direct:trigger`) starts successfully, so the exception 
**cannot** be caught by the first catch site 
(`camelContext.startService(consumer)`). This is the only path that can reach 
the second block.
   
   **Javadoc fix**
   
   `testRouteServiceStartNullMessageProducesFailedToStartRouteException` and 
`RouteServiceStartFailComponent` were incorrectly documented as exercising the 
second catch site. They actually hit the first catch site via 
`camelContext.startService(consumer)` → `BaseService.start()` → `doStart()`. 
Javadoc updated to reflect this accurately.
   
   All impacted modules verified locally with JDK 21 — all pass (camel-core, 
camel-main, camel-spring-xml, camel-netty-http, camel-jms, camel-mybatis, 
camel-ai-tool).
   
   _Claude Code on behalf of mayurbm_


-- 
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]

Reply via email to