[jboss-jira] [JBoss JIRA] Created: (JBRULES-1459) parser/scanner bug: "unterminated literal"

Godmar Back (JIRA) jira-events at lists.jboss.org
Sat Feb 9 14:29:04 EST 2008


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



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