Menu

#55 null in expression with conditional

closed-fixed
nobody
None
5
2004-09-04
2004-08-01
No

When using Expression Evaluator to evaluate:

null==null && "OIUO"!="edede"

I get:

net.janino.Java$CompileException: Line 1, Column 5:
Cannot compare "null" with primitive type "void"

Discussion

  • Arno Unkrig

    Arno Unkrig - 2004-09-04

    Logged In: YES
    user_id=865893

    Man... that was a subtle one! Generally, JANINO does not
    attempt to compile constant expressions like "null==null"
    into code, because it recognizes them as constant.
    Only in this case (an && expression with the LHS being a
    constantly false expression) it does so, and fails.
    "BinaryOperation.compileBoolean()" now checks whether "this"
    has a constant value.
    Will release in V 2.0.9.

     
  • Arno Unkrig

    Arno Unkrig - 2004-09-04
    • status: open --> open-fixed
     
  • Arno Unkrig

    Arno Unkrig - 2004-09-04
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.