Skip to content

CAMEL-23674: camel-jbang - Register ExportTypeConverter for Duration and Short types#23717

Merged
davsclaus merged 1 commit into
mainfrom
fix/CAMEL-23674
Jun 2, 2026
Merged

CAMEL-23674: camel-jbang - Register ExportTypeConverter for Duration and Short types#23717
davsclaus merged 1 commit into
mainfrom
fix/CAMEL-23674

Conversation

@davsclaus
Copy link
Copy Markdown
Contributor

Summary

Fixes CAMEL-23674: The export silent run fails on non-stubbed components (like timer) when property placeholders resolve to @@CamelMagicValue@@ and the target type is java.time.Duration.

Root Cause

The ExportTypeConverter already handles Duration conversion, but it was only registered as a fallback converter. The built-in DurationConverter (a direct @Converter) runs first and throws NumberFormatException when trying to parse @@CamelMagicValue@@, preventing the fallback from ever being tried.

Fix

Register the ExportTypeConverter explicitly for Duration.class (and Short.class which was also missing) so it takes priority over the built-in converters during export, matching the existing pattern for Integer, Long, Double, Float, Byte, and Boolean.

Test Plan

  • ExportTest.shouldGenerateJavaContent — previously failing on all 3 runtime variants (Quarkus, Spring Boot, Camel Main), now passes
  • Full reactor build passes

Claude Code on behalf of Claus Ibsen

…and Short types

The ExportTypeConverter was registered as a fallback converter but not
explicitly for Duration.class and Short.class. The built-in DurationConverter
runs first and throws NumberFormatException on @@CamelMagicValue@@, preventing
the fallback from being tried. Explicit registration overrides the built-in
converter so the magic value is handled gracefully during export.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions github-actions Bot added the dsl label Jun 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

🧪 CI tested the following changed modules:

  • dsl/camel-kamelet-main
All tested modules (6 modules)
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Kamelet Main
  • Camel :: Launcher :: Container

⚙️ View full build and test results

@davsclaus davsclaus merged commit 5560aaf into main Jun 2, 2026
6 checks passed
@davsclaus davsclaus deleted the fix/CAMEL-23674 branch June 2, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant