Skip to content

Fix generator for java.time.Duration default values#1736

Merged
Croway merged 1 commit intomainfrom
fix/duration-type-generator
Mar 31, 2026
Merged

Fix generator for java.time.Duration default values#1736
Croway merged 1 commit intomainfrom
fix/duration-type-generator

Conversation

@Croway
Copy link
Copy Markdown
Contributor

@Croway Croway commented Mar 31, 2026

Summary

  • The auto-configuration generator assumed duration-type properties always use long/int Java types
  • Properties with javaType: "java.time.Duration" (e.g. embeddingStoreSchemaRegistrationTimeout from CAMEL-23255) got a bare int literal as initializer, causing incompatible types: int cannot be converted to java.time.Duration in the generated InfinispanRemoteComponentConfiguration.java
  • Fix: generate Duration.ofMillis(...) when the javaType is java.time.Duration

Context

Both Camel-Spring-Boot Daily/main (build #46) and Camel-Spring-Boot Daily (ppc64le)/main (build #1460) fail with this compilation error on camel-infinispan-starter.

Test plan

  • Generator plugin compiles
  • camel-infinispan-starter compiles with regenerated code (was failing before)
  • camel-infinispan-cluster-service-starter compiles
  • Generated file has correct Duration.ofMillis(60000) initializer with proper import

The auto-configuration generator assumed duration-type properties
always use long/int Java types. Properties with javaType
java.time.Duration (e.g. embeddingStoreSchemaRegistrationTimeout
from CAMEL-23255) got a bare int literal as initializer, causing
a compilation error in the generated configuration class.

Generate Duration.ofMillis(...) when the javaType is
java.time.Duration.
@Croway Croway merged commit 383d9c4 into main Mar 31, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant