Repository: camel
Updated Branches:
  refs/heads/master bdcbf6d2c -> a0f1a40a7


CAMEL-8113: Added noop stats to type converter registry to capture attempts 
that didnt need a conversion. Then attempt is actual conversion attempts, so we 
have a more precise stats of the usage.


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

Branch: refs/heads/master
Commit: a0f1a40a7275bcbd6fe4ca3faf50956a1bb0a125
Parents: bdcbf6d
Author: Claus Ibsen <davscl...@apache.org>
Authored: Fri Jan 2 17:12:41 2015 +0100
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Fri Jan 2 17:12:41 2015 +0100

----------------------------------------------------------------------
 .../camel/impl/converter/BaseTypeConverterRegistry.java      | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a0f1a40a/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java
 
b/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java
index 82a0982..e61a918 100644
--- 
a/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java
+++ 
b/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java
@@ -226,14 +226,14 @@ public abstract class BaseTypeConverterRegistry extends 
ServiceSupport implement
         }
 
         if (value == null) {
-            // lets avoid NullPointerException when converting to boolean for 
null values
-            if (boolean.class.isAssignableFrom(type)) {
-                return Boolean.FALSE;
-            }
             // no type conversion was needed
             if (statistics.isStatisticsEnabled()) {
                 noopCounter.incrementAndGet();
             }
+            // lets avoid NullPointerException when converting to boolean for 
null values
+            if (boolean.class.isAssignableFrom(type)) {
+                return Boolean.FALSE;
+            }
             return null;
         }
 

Reply via email to