Janino

ExpressionEvaluator.createFastExpressionEvaluator calls setReturnType

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

Originally posted by Wilfred van der Deijl 2007-07-21

Hi,

I'm new to Janino and am trying to use ExpressionEvaluator.createFastExpressionEvaluator(String expression, Class interfaceToImplement, String[] parameterNames, ClassLoader optionalParentClassLoader) in version 2.5.8

I run into the following runtime error:
Exception in thread "main" java.lang.RuntimeException: Don't call "setReturnType(Class)" on an ExpressionEvaluator, use "setExpressionType(Class)" instead
at org.codehaus.janino.ExpressionEvaluator.setReturnType(ExpressionEvaluator.java)
at org.codehaus.janino.ScriptEvaluator.createFastEvaluator(ScriptEvaluator.java)
at org.codehaus.janino.ScriptEvaluator.createFastEvaluator(ScriptEvaluator.java)
at org.codehaus.janino.ExpressionEvaluator.createFastExpressionEvaluator(ExpressionEvaluator.java)
at com.commit.consulting.janino.Client.main(Client.java:55)
As it turns out, ScriptEvaluator.createFastEvaluator calls setReturnType, which is not allowed on a ExpressionEvaluator.

Is it me doing something wrong or is this a bug in Janino?
If it's a bug, I'm happy to submit a bug report in Jira, but I didn't want to clutter Jira with something that might be my own error.

Regards,
Wilfred

Activity

Hide
Arno Unkrig added a comment -

Hi Wilfred,

it's definitely a bug (since JANINO 2.4.5). I will fix it and release version 2.5.9 tonight.

CU

Arno

Show
Arno Unkrig added a comment - Hi Wilfred, it's definitely a bug (since JANINO 2.4.5). I will fix it and release version 2.5.9 tonight. CU Arno

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: