Optimise - Small optimisation in type converter
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b4f21f90 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b4f21f90 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b4f21f90 Branch: refs/heads/master Commit: b4f21f9037a61fe47036e7baf3c09499f32e589a Parents: 710e9b3 Author: Claus Ibsen <davscl...@apache.org> Authored: Sat Jun 24 09:46:41 2017 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Sat Jun 24 09:46:41 2017 +0200 ---------------------------------------------------------------------- .../org/apache/camel/impl/converter/BaseTypeConverterRegistry.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/b4f21f90/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 5e0ccf0..6e4a1b1 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 @@ -272,7 +272,7 @@ public abstract class BaseTypeConverterRegistry extends ServiceSupport implement } // special for NaN numbers, which we can only convert for floating numbers - if (value.equals(Float.NaN) || value.equals(Double.NaN) ) { + if (value instanceof Number && (value.equals(Float.NaN) || value.equals(Double.NaN))) { // no type conversion was needed if (statistics.isStatisticsEnabled()) { noopCounter.increment();