gnodet opened a new pull request, #22991:
URL: https://github.com/apache/camel/pull/22991
Fix route source display in diagram that was stripping line numbers from
source names like `cheese.java:9`, showing just `9` instead.
## Problem
`extractSourceName()` used `lastIndexOf(':')` to strip URI scheme prefixes
(e.g. `file:`), but this also stripped line number suffixes from sources like
`cheese.java:9`, leaving just `9`.
## Fix
Changed to use `indexOf(':')` (first colon) with a check that the part
before the colon consists only of letters (a valid URI scheme like `file`,
`classpath`, `ref`). This correctly handles:
- `file:/path/to/my-route.yaml` → `my-route.yaml`
- `classpath:my-route.yaml` → `my-route.yaml`
- `cheese.java:9` → `cheese.java:9` (preserved)
- `file:/path/to/cheese.java:9` → `cheese.java:9` (preserved)
## Test plan
- [x] Added unit tests for all source name extraction scenarios
- [x] All 58 tests pass in camel-diagram module
--
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]