jamsesso / json-logic-java

A pure Java implementation of JsonLogic without using the Nashorn JS engine
MIT License
99 stars 50 forks source link

Incorrect result while comparing string and double #8

Closed patmonfort closed 5 years ago

patmonfort commented 5 years ago

Hello, The following rule { "==" : ["", 0] } evaluates to true as per http://jsonlogic.com/play.html but evaluates to false using the lib. (version 1.0.2). To me, this comes from the method 'compareNumberToString" located in EqualityExpression class. It catches the exception while parsing the empty string to a double and so returns false instead of true in this specific scenario. Could you please check this and indicates if you think there is a workaround ? Thanks a lot.