You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JsonNode intNode = IntNode.valueOf(1);
JsonNode longNode = LongNode.valueOf(1);
boolean same = JsonNumEquals.getInstance().equivalent(intNode, longNode);
// at this point same == false
Cause
In com.github.fge.jackson.JsonNumEquals#numEquals:
private static boolean numEquals(final JsonNode a, final JsonNode b)
{
/*
* If both numbers are integers, delegate to JsonNode.
*/
if (a.isIntegralNumber() && b.isIntegralNumber()) // this is true
return a.equals(b); // yet this is false
/*
* Otherwise, compare decimal values.
*/
return a.decimalValue().compareTo(b.decimalValue()) == 0;
}
The text was updated successfully, but these errors were encountered:
Problem
Cause
In
com.github.fge.jackson.JsonNumEquals#numEquals
:The text was updated successfully, but these errors were encountered: