Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Not A Bug
-
3.6.2
-
None
-
None
Description
By the design of Gremlin, an exception should be thrown when compared with NaN.
However, I found that when using ```is(predicate)``` to compare, the exception is always swallowed, and this issue occurs on all GDBs support Gremlin, such as "g.inject(Double.NaN).is(gt(3))"
public static final GremlinValueComparator COMPARABILITY = new GremlinValueComparator() { /** * Compare two Gremlin value objects per the Comparability semantics. Throws type errors for NaN comparison * and for cross-type comparison (including nulltype). * * Use this method for P.lt/lte/gt/gte. */ @Override public int compare(final Object f, final Object s) { // For Compare, NaN always produces ERROR if (eitherAreNaN(f, s)) throwTypeError(); // For Compare we do not cross type boundaries, including null if (!comparable(f, s)) throwTypeError(); // comparable(f, s) assures that type(f) == type(s) final Type type = Type.type(f); return comparator(type).compare(f, s); } ...