You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/07/04 11:36:58 UTC

camel git commit: Optimise - Do faster check for boolean type

Repository: camel
Updated Branches:
  refs/heads/master b28c4da09 -> b515840bd


Optimise - Do faster check for boolean type


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b515840b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b515840b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b515840b

Branch: refs/heads/master
Commit: b515840bdb25cd0038aaee871864601f455be756
Parents: b28c4da
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Jul 4 13:35:45 2017 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Jul 4 13:35:45 2017 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/impl/DefaultMessage.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b515840b/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
index 06040ba..e226de0 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultMessage.java
@@ -93,7 +93,7 @@ public class DefaultMessage extends MessageSupport {
         Object value = getHeader(name);
         if (value == null) {
             // lets avoid NullPointerException when converting to boolean for null values
-            if (boolean.class.isAssignableFrom(type)) {
+            if (boolean.class == type) {
                 return (T) Boolean.FALSE;
             }
             return null;
@@ -118,7 +118,7 @@ public class DefaultMessage extends MessageSupport {
         Object value = getHeader(name, defaultValue);
         if (value == null) {
             // lets avoid NullPointerException when converting to boolean for null values
-            if (boolean.class.isAssignableFrom(type)) {
+            if (boolean.class == type) {
                 return (T) Boolean.FALSE;
             }
             return null;
@@ -146,7 +146,7 @@ public class DefaultMessage extends MessageSupport {
         Object value = getHeader(name, defaultValueSupplier);
         if (value == null) {
             // lets avoid NullPointerException when converting to boolean for null values
-            if (boolean.class.isAssignableFrom(type)) {
+            if (boolean.class == type) {
                 return (T) Boolean.FALSE;
             }
             return null;