I've just found another problem, that it's happening
I don't think the problem is in there. I think MVEL is tokenizing
the "in" in the end of your variable as the operator "in" and raising
the error. We need to open a bug for cbrock to fix, but we need an
isolated MVEL test case.
In case you or someone has the time to do it, just use one of the
tests here as an example:
http://github.com/mikebrock/mvel/blob/master/src/test/java/org/mvel2/tests/core/CoreConfidenceTests.java
And open a JIRA here:
http://jira.codehaus.org/browse/MVEL
Otherwise I will do it when I get the time.
Thanks,
Edson
2010/10/6 Wolfgang Laun <wolfgang.laun@gmail.com>:
> Still there.
>
> Perhaps a trim() in here?
>
> public class JavaModifyBlockDescr implements JavaBlockDescr {
> private int start;
> private int end;
> private String modifyExpression;
> private List<String> expressions;
>
> public JavaModifyBlockDescr( String modifyExpression ) {
> this.modifyExpression = modifyExpression.trim();
> this.expressions = new ArrayList<String>();
> }
>
>
> -W
>
>
> On 6 October 2010 15:10, Edson Tirelli <tirelli@post.com> wrote:
>>
>> Wolfgang,
>>
>> What version of MVEL are you using? can you check if you still
>> have the error with the latest version: 2.0.18?
>>
>> http://mvel.codehaus.org/Downloading+MVEL
>>
>> Please let us know.
>>
>> Thanks,
>> Edson
>>
>> 2010/10/6 Wolfgang Laun <wolfgang.laun@gmail.com>:
>> > 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
>> >
>> >
>> > _______________________________________________
>> > rules-dev mailing list
>> > rules-dev@lists.jboss.org
>> > https://lists.jboss.org/mailman/listinfo/rules-dev
>> >
>> >
>>
>>
>>
>> --
>> Edson Tirelli
>> JBoss Drools Core Development
>> JBoss by Red Hat @ www.jboss.com
>>
>> _______________________________________________
>> rules-dev mailing list
>> rules-dev@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
_______________________________________________
rules-dev mailing list
rules-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev