[janino-dev] [jira] Created: (JANINO-126) ExpressionEvaluator isn't handling NaN correctly

View: New views
1 Messages — Rating Filter:   Alert me  

[janino-dev] [jira] Created: (JANINO-126) ExpressionEvaluator isn't handling NaN correctly

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ExpressionEvaluator isn't handling NaN correctly
------------------------------------------------

                 Key: JANINO-126
                 URL: http://jira.codehaus.org/browse/JANINO-126
             Project: Janino
          Issue Type: Bug
    Affects Versions: 2.5.14, 2.5.13, 2.5.12, 2.5.15
         Environment: Windows jdk5
            Reporter: mark zeldis
            Assignee: Arno Unkrig


NaN is not working within the ExpressionEvaluator.  All evaluations involving NaN should be false.  Here is an example:

import org.codehaus.janino.*;

public class TestTest {

    public static void main(String args[]){
        try {
            ExpressionEvaluator advancedFilter= new ExpressionEvaluator(
                    "x>5",                        // expression
                    Boolean.class,                // expressionType
                    new String[]{"x"},            // parameterNames
                    new Class[]{Double.class}     // parameterTypes
            );

            System.err.println(advancedFilter.evaluate(new Double[]{Double.NaN}));
            System.err.println(Double.NaN>5);
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
}


--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


LightInTheBox - Buy quality products at wholesale price!