camel-diagram: Fix route source name stripping line numbers#22991
camel-diagram: Fix route source name stripping line numbers#22991gnodet wants to merge 1 commit intoapache:mainfrom
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
All tested modules (9 modules)
|
|
this is no longer needed as the json source from route structure dump has removed the line number and include this in a seperate "line" attribute |
The extractSourceName() method used lastIndexOf(':') to strip URI scheme
prefixes, which also stripped line number suffixes from sources like
"cheese.java:9", leaving just "9". Changed to use indexOf(':') with a
check that the part before the colon is all letters (a valid URI scheme),
preserving line numbers in the display.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude Code on behalf of Guillaume Nodet True, but the code is still wrong regardless — it uses The fix changes to |
bf1b171 to
a933542
Compare
Fix route source display in diagram that was stripping line numbers from source names like
cheese.java:9, showing just9instead.Problem
extractSourceName()usedlastIndexOf(':')to strip URI scheme prefixes (e.g.file:), but this also stripped line number suffixes from sources likecheese.java:9, leaving just9.Fix
Changed to use
indexOf(':')(first colon) with a check that the part before the colon consists only of letters (a valid URI scheme likefile,classpath,ref). This correctly handles:file:/path/to/my-route.yaml→my-route.yamlclasspath:my-route.yaml→my-route.yamlcheese.java:9→cheese.java:9(preserved)file:/path/to/cheese.java:9→cheese.java:9(preserved)Test plan