[rules-users] [MVEL] the data converter does not work

kapokfly ivan.jiang.ww at foxmail.com
Tue Dec 13 05:01:06 EST 2011


For this particular cases, if I modify the safeEquals method to be something
like this, the test case would success, what is the disadvantage to add
converters like this, any hint? 

    private static Boolean safeEquals(final Object val1, final Object val2)
{
        if (val1 != null) {
            if (DataConversion.canConvert(val2.getClass(), val1.getClass()))
{
                return val2.equals(DataConversion.convert(val1,
val2.getClass()));
            }
            return val1.equals(val2) ? Boolean.TRUE : Boolean.FALSE;
        }
        else return val2 == null || (val2.equals(val1) ? Boolean.TRUE :
Boolean.FALSE);
    }

-----
Ivan, your Panda, forever
--
View this message in context: http://drools.46999.n3.nabble.com/MVEL-the-data-converter-does-not-work-tp3581797p3581928.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list