You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by gn...@apache.org on 2020/05/29 11:44:08 UTC

[camel-spring-boot] 01/02: [CAMEL-15130] Fix generation for duration

This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git

commit 60b3958c65884de16d3a39a558ff4ca129192865
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Fri May 29 10:17:10 2020 +0200

    [CAMEL-15130] Fix generation for duration
---
 .../camel/springboot/maven/SpringBootAutoConfigurationMojo.java       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootAutoConfigurationMojo.java b/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootAutoConfigurationMojo.java
index 47834f0..88cb32b 100644
--- a/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootAutoConfigurationMojo.java
+++ b/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootAutoConfigurationMojo.java
@@ -717,7 +717,7 @@ public class SpringBootAutoConfigurationMojo extends AbstractSpringBootGenerator
                 prop.getField().getJavaDoc().setFullText(desc);
             }
             if (!isBlank(option.getDefaultValue())) {
-                if ("java.lang.String".equals(option.getJavaType())) {
+                if ("java.lang.String".equals(option.getJavaType()) || "duration".equals(option.getType())) {
                     prop.getField().setStringInitializer(option.getDefaultValue().toString());
                 } else if ("long".equals(option.getJavaType()) || "java.lang.Long".equals(option.getJavaType())) {
                     // the value should be a Long number
@@ -754,7 +754,7 @@ public class SpringBootAutoConfigurationMojo extends AbstractSpringBootGenerator
             return false;
         }
         // all the object types are complex
-        return "object".equals(option.getType());
+        return "object".equals(option.getType()) || "duration".equals(option.getType());
     }
 
     private boolean isComplexType(DataFormatOptionModel option) {