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

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c10302cdffd87e81765e6839c961cad171c55f15
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Thu Jun 11 20:35:53 2020 +0200

    CAMEL-15178: Fix thread pool profile builder to skip settign null values.
---
 .../camel/builder/ThreadPoolProfileBuilder.java    | 32 ++++++++++++++++------
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git 
a/core/camel-core-engine/src/main/java/org/apache/camel/builder/ThreadPoolProfileBuilder.java
 
b/core/camel-core-engine/src/main/java/org/apache/camel/builder/ThreadPoolProfileBuilder.java
index b014ff7..974c63b 100644
--- 
a/core/camel-core-engine/src/main/java/org/apache/camel/builder/ThreadPoolProfileBuilder.java
+++ 
b/core/camel-core-engine/src/main/java/org/apache/camel/builder/ThreadPoolProfileBuilder.java
@@ -39,28 +39,40 @@ public class ThreadPoolProfileBuilder {
     }
 
     public ThreadPoolProfileBuilder defaultProfile(Boolean defaultProfile) {
-        this.profile.setDefaultProfile(defaultProfile);
+        if (defaultProfile != null) {
+            this.profile.setDefaultProfile(defaultProfile);
+        }
         return this;
     }
 
     public ThreadPoolProfileBuilder poolSize(Integer poolSize) {
-        profile.setPoolSize(poolSize);
+        if (poolSize != null) {
+            profile.setPoolSize(poolSize);
+        }
         return this;
     }
 
     public ThreadPoolProfileBuilder maxPoolSize(Integer maxPoolSize) {
-        profile.setMaxPoolSize(maxPoolSize);
+        if (maxPoolSize != null) {
+            profile.setMaxPoolSize(maxPoolSize);
+        }
         return this;
     }
 
     public ThreadPoolProfileBuilder keepAliveTime(Long keepAliveTime, TimeUnit 
timeUnit) {
-        profile.setKeepAliveTime(keepAliveTime);
-        profile.setTimeUnit(timeUnit);
+        if (keepAliveTime != null) {
+            profile.setKeepAliveTime(keepAliveTime);
+        }
+        if (timeUnit != null) {
+            profile.setTimeUnit(timeUnit);
+        }
         return this;
     }
 
     public ThreadPoolProfileBuilder keepAliveTime(Long keepAliveTime) {
-        profile.setKeepAliveTime(keepAliveTime);
+        if (keepAliveTime != null) {
+            profile.setKeepAliveTime(keepAliveTime);
+        }
         return this;
     }
 
@@ -72,12 +84,16 @@ public class ThreadPoolProfileBuilder {
     }
 
     public ThreadPoolProfileBuilder allowCoreThreadTimeOut(Boolean 
allowCoreThreadTimeOut) {
-        profile.setAllowCoreThreadTimeOut(allowCoreThreadTimeOut);
+        if (allowCoreThreadTimeOut != null) {
+            profile.setAllowCoreThreadTimeOut(allowCoreThreadTimeOut);
+        }
         return this;
     }
 
     public ThreadPoolProfileBuilder rejectedPolicy(ThreadPoolRejectedPolicy 
rejectedPolicy) {
-        profile.setRejectedPolicy(rejectedPolicy);
+        if (rejectedPolicy != null) {
+            profile.setRejectedPolicy(rejectedPolicy);
+        }
         return this;
     }
 

Reply via email to