I've just found another problem, that it's happening<div>when you have something like:</div><div><br></div><div>with( $r = new Something() ) { </div><div> invoice = $somethingElse;</div><div>}</div><div><br></div>
<div>The "in" token seems to be bothering there too..</div><div>if I change it to ivoice.. it works..</div><div><br><br><div class="gmail_quote">On Wed, Oct 6, 2010 at 11:32 AM, Edson Tirelli <span dir="ltr"><<a href="mailto:tirelli@post.com">tirelli@post.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> I don't think the problem is in there. I think MVEL is tokenizing<br>
the "in" in the end of your variable as the operator "in" and raising<br>
the error. We need to open a bug for cbrock to fix, but we need an<br>
isolated MVEL test case.<br>
<br>
In case you or someone has the time to do it, just use one of the<br>
tests here as an example:<br>
<br>
<a href="http://github.com/mikebrock/mvel/blob/master/src/test/java/org/mvel2/tests/core/CoreConfidenceTests.java" target="_blank">http://github.com/mikebrock/mvel/blob/master/src/test/java/org/mvel2/tests/core/CoreConfidenceTests.java</a><br>
<br>
And open a JIRA here:<br>
<br>
<a href="http://jira.codehaus.org/browse/MVEL" target="_blank">http://jira.codehaus.org/browse/MVEL</a><br>
<br>
Otherwise I will do it when I get the time.<br>
<div><div></div><div class="h5"><br>
Thanks,<br>
Edson<br>
<br>
2010/10/6 Wolfgang Laun <<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>>:<br>
> Still there.<br>
><br>
> Perhaps a trim() in here?<br>
><br>
> public class JavaModifyBlockDescr implements JavaBlockDescr {<br>
> private int start;<br>
> private int end;<br>
> private String modifyExpression;<br>
> private List<String> expressions;<br>
><br>
> public JavaModifyBlockDescr( String modifyExpression ) {<br>
> this.modifyExpression = modifyExpression.trim();<br>
> this.expressions = new ArrayList<String>();<br>
> }<br>
><br>
><br>
> -W<br>
><br>
><br>
> On 6 October 2010 15:10, Edson Tirelli <<a href="mailto:tirelli@post.com">tirelli@post.com</a>> wrote:<br>
>><br>
>> Wolfgang,<br>
>><br>
>> What version of MVEL are you using? can you check if you still<br>
>> have the error with the latest version: 2.0.18?<br>
>><br>
>> <a href="http://mvel.codehaus.org/Downloading+MVEL" target="_blank">http://mvel.codehaus.org/Downloading+MVEL</a><br>
>><br>
>> Please let us know.<br>
>><br>
>> Thanks,<br>
>> Edson<br>
>><br>
>> 2010/10/6 Wolfgang Laun <<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>>:<br>
>> > 5.1<br>
>> ><br>
>> > rule "lucky"<br>
>> > when<br>
>> > Putin: X()<br>
>> > then<br>
>> > modify( Putin ){...}<br>
>> > end<br>
>> ><br>
>> > crashes with:<br>
>> > Exception in thread "main" [Error: was expecting type:<br>
>> > java.util.Collection;<br>
>> > but found type: null]<br>
>> > [Near : {... ( Putin ....}]<br>
>> > ^<br>
>> > [Line: 1, Column: 9]<br>
>> > at org.mvel2.util.CompilerTools.expectType(CompilerTools.java:295)<br>
>> > at org.mvel2.ast.Fold.<init>(Fold.java:70)<br>
>> > at<br>
>> > org.mvel2.compiler.AbstractParser.nextToken(AbstractParser.java:961)<br>
>> > at<br>
>> ><br>
>> > org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:121)<br>
>> > at<br>
>> ><br>
>> > org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:68)<br>
>> > at<br>
>> ><br>
>> > org.drools.rule.builder.dialect.mvel.MVELExprAnalyzer.analyzeExpression(MVELExprAnalyzer.java:86)<br>
>> > at<br>
>> ><br>
>> > org.drools.rule.builder.dialect.mvel.MVELDialect.analyzeBlock(MVELDialect.java:494)<br>
>> > at<br>
>> ><br>
>> > org.drools.rule.builder.dialect.java.JavaConsequenceBuilder.rewriteModify(JavaConsequenceBuilder.java:224)<br>
>> > ...<br>
>> ><br>
>> > This is, of course, not due to using exactly *that* name; it occurs if<br>
>> > (1) the bound name matches /^.+in$/ and<br>
>> > (2) there is, in "modify", white space between "in" and ")"<br>
>> ><br>
>> > -W<br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > rules-dev mailing list<br>
>> > <a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
>> > <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
>> ><br>
>> ><br>
>><br>
>><br>
>><br>
>> --<br>
>> Edson Tirelli<br>
>> JBoss Drools Core Development<br>
>> JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
>><br>
>> _______________________________________________<br>
>> rules-dev mailing list<br>
>> <a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
><br>
><br>
> _______________________________________________<br>
> rules-dev mailing list<br>
> <a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
><br>
><br>
<br>
<br>
<br>
--<br>
Edson Tirelli<br>
JBoss Drools Core Development<br>
JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> - CTO @ <a href="http://www.plugtree.com">http://www.plugtree.com</a> <br> - MyJourney @ <a href="http://salaboy.wordpress.com">http://salaboy.wordpress.com</a><br>
- Co-Founder @ <a href="http://www.jbug.com.ar">http://www.jbug.com.ar</a><br> <br> - Salatino "Salaboy" Mauricio -<br>
</div>