davsclaus opened a new pull request, #24762: URL: https://github.com/apache/camel/pull/24762
## Summary _Claude Code on behalf of davsclaus_ - Fix off-by-one in `BeanExpression.lookupResult()` list bounds check: `list.size() > num - 1` → `list.size() > num` - When the OGNL index equals the list size, the guard incorrectly passed and `list.get(num)` threw a raw JDK `IndexOutOfBoundsException` instead of the friendly Camel error with bean/OGNL context - Null-safe OGNL (`?` operator) was also broken at this boundary — threw instead of returning `null` Fixes: https://issues.apache.org/jira/browse/CAMEL-24101 ## Test plan - [x] New `testBodyOGNLOrderListOutOfBoundsAtBoundary` — verifies friendly error at index == size - [x] New `testBodyOGNLOrderListOutOfBoundsAtBoundaryWithNullSafe` — verifies null-safe returns null at boundary - [x] All existing out-of-bounds tests (index > size) continue to pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.6 <[email protected]> -- 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]
