[jboss-jira] [JBoss JIRA] Resolved: (JBRULES-1459) parser/scanner bug: "unterminated literal"
Edson Tirelli (JIRA)
jira-events at lists.jboss.org
Wed Mar 12 15:20:57 EDT 2008
[ http://jira.jboss.com/jira/browse/JBRULES-1459?page=all ]
Edson Tirelli resolved JBRULES-1459.
------------------------------------
Fix Version/s: 4.0.5
5.0.0-M1
Resolution: Done
I was not able to reproduce the problem with latest 4.0.x code and mvel 1.2.21. So I assume it is fixed.
I added unit and integration tests to the codebase anyway.
> parser/scanner bug: "unterminated literal"
> ------------------------------------------
>
> Key: JBRULES-1459
> URL: http://jira.jboss.com/jira/browse/JBRULES-1459
> Project: JBoss Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 4.0.4
> Reporter: Godmar Back
> Assigned To: Edson Tirelli
> Fix For: 4.0.5, 5.0.0-M1
>
>
> The following test:
> package test;
> import java.util.Collections;
> import java.util.Map;
> import java.util.HashMap;
> dialect "mvel"
> rule "Rule #1"
> when
> then
> m = new HashMap();
> m.put("content", "hello ;=");
> insert(m);
> end
> rule "Rule #2"
> when
> s : Map (this["content"] matches "hello ;=")
> then
> System.out.println("found it " + s);
> end
> ----
> produces:
> Exception in thread "main" org.drools.rule.InvalidRulePackage: Unable to determine the used declarations.
> Failed to compile:
> [Error: unterminated literal]
> [Near: "' "hell'"] : [Rule name=Rule #2, agendaGroup=MAIN, salience=0, no-loop=false]
> at org.drools.rule.Package.checkValidity(Package.java:424)
> at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:384)
> ....
> but this test works:
> package test;
> import java.util.Collections;
> import java.util.Map;
> import java.util.HashMap;
> dialect "mvel"
> rule "Rule #1"
> when
> then
> m = new HashMap();
> m.put("content", "hello ;=");
> insert(m);
> end
> rule "Rule #2"
> when
> s : Map (this["content"] matches "hello ..")
> then
> System.out.println("found it " + s);
> end
> (The only difference between the two is that the right-hand side of "matches" was changed from "hello ;=" to "hello ..")
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list