Janino:脚本不会编译(烹饪),如果!使用运算符

时间:2015-09-16 10:21:36

标签: janino

我在Janino脚本之后编译(烹饪)时出现问题。

(((sfv1.equals(a_p))))&&(((sfv2.equals(a_ac))))&&(((!(a_d~~bfv3))))  

我传递[sfv1,a_p,sfv2,a_ac,a_d ~~ bfv3]的参数类型,其中a_d ~~ bfv3是布尔类型,其余是字符串。
当我尝试烹饪脚本时,我看到了以下错误。

org.codehaus.commons.compiler.CompileException: Line 1, Column 0: ')' expected (compiler.err.expected)

我尝试将脚本更改为以下内容,结果相同:

(((sfv1.equals(a_p))))&&(((sfv2.equals(a_ac))))&&(((!(a_d~~bfv3==true))))

我想知道Janino是否不支持布尔类型参数。 任何人都能帮助我吗?

1 个答案:

答案 0 :(得分:0)

'〜'是Janino中的预定义运算符。这就是错误的原因。当'〜'被发现时,Janino期待匹配')'为'('。

用“__”替换“~~”为我解决了这个问题。