Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-1459

parser/scanner bug: "unterminated literal"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.0.4
    • Fix Version/s: 4.0.5, 5.0.0.M1
    • Component/s: None
    • Labels:
      None

      Description

      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 ..")

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                tirelli Edson Tirelli
                Reporter:
                godmar Godmar Back
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: