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

bvahdat pushed a commit to branch ObjectHelper-cleanup
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/ObjectHelper-cleanup by this 
push:
     new af8eba2  simplify the ObjectHelper#isNaN impl
af8eba2 is described below

commit af8eba233575e1b727eea691f2a7b6d5e6a6f872
Author: Babak Vahdat <bvah...@apache.org>
AuthorDate: Tue Sep 14 00:04:53 2021 +0200

    simplify the ObjectHelper#isNaN impl
---
 core/camel-util/src/main/java/org/apache/camel/util/ObjectHelper.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/core/camel-util/src/main/java/org/apache/camel/util/ObjectHelper.java 
b/core/camel-util/src/main/java/org/apache/camel/util/ObjectHelper.java
index 905ea0d..5c94b92 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/ObjectHelper.java
+++ b/core/camel-util/src/main/java/org/apache/camel/util/ObjectHelper.java
@@ -1138,8 +1138,8 @@ public final class ObjectHelper {
      * @return       <tt>true</tt> if its a {@link Float#NaN} or {@link 
Double#NaN}.
      */
     public static boolean isNaN(Object value) {
-        return value instanceof Number
-                && (Float.isNaN(((Number) value).floatValue()) || 
Double.isNaN(((Number) value).doubleValue()));
+        return value instanceof Float && ((Float) value).isNaN()
+                || value instanceof Double && ((Double) value).isNaN();
     }
 
     /**

Reply via email to