Nice going, Mario, like a hot knife through butter ;-)
Wolfgang
On 7 October 2011 20:38, Mario Fusco (Commented) (JIRA)
<jira-events(a)lists.jboss.org> wrote:
[
https://issues.jboss.org/browse/JBRULES-3134?page=com.atlassian.jira.plug...
]
Mario Fusco commented on JBRULES-3134:
--------------------------------------
This is a MVEL bug that should be fixed with this pull request:
https://github.com/mvel/mvel/pull/23
> Parenthesized class name causes NPE in RuleBuilder (MVEL)
> ---------------------------------------------------------
>
> Key: JBRULES-3134
> URL:
https://issues.jboss.org/browse/JBRULES-3134
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 5.2.0.Final
> Reporter: Wolfgang Laun
> Assignee: Mario Fusco
> Fix For: 5.2.1.Final
>
>
> declare Foo
> clazz : Class
> end
> rule testFoo
> when
> Foo( clazz == (java.lang.Object) )
> then
> System.out.println( "Foo is Object" );
> end
> causes
> Exception in thread "main" [Error: not a statement, or badly formed
structure]
> [Near : {... (java.lang.Object) ....}]
> ^
> [Line: 1, Column: 19]
> at org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:307)
> at org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:69)
> at org.mvel2.MVEL.analysisCompile(MVEL.java:668)
> at org.mvel2.MVEL.analysisCompile(MVEL.java:672)
> at org.drools.rule.builder.PatternBuilder.setInputs(PatternBuilder.java:779)
> at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:540)
> at
org.drools.rule.builder.PatternBuilder.processConstraintsAndBinds(PatternBuilder.java:349)
> at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:264)
> at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:122)
> at
org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:65)
> at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:81)
> at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1889)
> at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:755)
> at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:365)
> at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:543)
> at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
> at listofthree.Main.setup(Main.java:55)
> at listofthree.Main.main(Main.java:107)
> Caused by: java.lang.NullPointerException
> at java.lang.Class.isAssignableFrom(Native Method)
> at org.mvel2.DataConversion.canConvert(DataConversion.java:104)
> at org.mvel2.ast.TypeCast.<init>(TypeCast.java:47)
> at org.mvel2.compiler.AbstractParser.nextToken(AbstractParser.java:1034)
> at org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:135)
> ... 17 more
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira