[rules-dev] Bug report - a lucky catch if I ever saw one

Wolfgang Laun wolfgang.laun at gmail.com
Wed Oct 6 06:54:54 EDT 2010


5.1

rule "lucky"
when
   Putin: X()
then
   modify( Putin ){...}
end

crashes with:
Exception in thread "main" [Error: was expecting type: java.util.Collection;
but found type: null]
[Near : {... ( Putin  ....}]
                     ^
[Line: 1, Column: 9]
    at org.mvel2.util.CompilerTools.expectType(CompilerTools.java:295)
    at org.mvel2.ast.Fold.<init>(Fold.java:70)
    at org.mvel2.compiler.AbstractParser.nextToken(AbstractParser.java:961)
    at
org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:121)
    at
org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:68)
    at
org.drools.rule.builder.dialect.mvel.MVELExprAnalyzer.analyzeExpression(MVELExprAnalyzer.java:86)
    at
org.drools.rule.builder.dialect.mvel.MVELDialect.analyzeBlock(MVELDialect.java:494)
    at
org.drools.rule.builder.dialect.java.JavaConsequenceBuilder.rewriteModify(JavaConsequenceBuilder.java:224)
...

This is, of course, not due to using exactly *that* name; it occurs if
(1) the bound name matches /^.+in$/ and
(2) there is, in "modify", white space between "in" and ")"

-W
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20101006/2a4a3900/attachment.html 


More information about the rules-dev mailing list