krlawrence commented on a change in pull request #1557:
URL: https://github.com/apache/tinkerpop/pull/1557#discussion_r802734087



##########
File path: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/translator/GroovyTranslator.java
##########
@@ -419,24 +426,30 @@ protected Script produceScript(final Vertex o) {
 
         @Override
         protected String getSyntax(final Number o) {
+            if (o instanceof Double || o instanceof Float) {
+                if (NumberHelper.isNaN(o))
+                    return "NaN";
+                if (NumberHelper.isPositiveInfinity(o))
+                    return "Infinity";
+                if (NumberHelper.isNegativeInfinity(o))
+                    return "-Infinity";
+
+                return o + (o instanceof Double ? "D" : "F");
+            }
             if (o instanceof Long)
                 return o + "L";
-            else if (o instanceof Double)
-                return o + "D";
-            else if (o instanceof Float)
-                return o + "F";
-            else if (o instanceof Integer)
+            if (o instanceof Integer)
                 return o + "I";
-            else if (o instanceof Byte)

Review comment:
       Just curious why the else's are removed - can "o" be more than one thing?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to