[jboss-jira] [JBoss JIRA] (DROOLS-287) Rule names with non-alphabetic characters may lead to name clashes

Geoffrey De Smet (JIRA) jira-events at lists.jboss.org
Mon Oct 7 02:57:02 EDT 2013


    [ https://issues.jboss.org/browse/DROOLS-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12809645#comment-12809645 ] 

Geoffrey De Smet edited comment on DROOLS-287 at 10/7/13 2:55 AM:
------------------------------------------------------------------

That's probably because Java classnames can't contain "<" or ">" and the rules becomes java class files.

Solution A): a solution to this is *escaping*, for example with the "$" character:
"Rule_>" becomes "Rule_$gt$"
"Rule_<" becomes "Rule_$lt$"
"Rule_$" becomes "Rule_$dollar$"
"Rule_£" becomes "Rule_$u1245$" (presuming that 1245 is the unicode for £)
"Rule a" becomes "Rule$space$a"
"Rule  a" becomes "Rule$space$$space$a"
                
      was (Author: ge0ffrey):
    That's probably because Java classnames can't contain "<" or ">" and the rules becomes java class files.

A solution to this is *escaping*, for example with the "$" character:
"Rule_>" becomes "Rule_$gt$"
"Rule_<" becomes "Rule_$lt$"
"Rule_$" becomes "Rule_$dollar$"
"Rule_£" becomes "Rule_$u1245$" (presuming that 1245 is the unicode for £)
"Rule a" becomes "Rule$space$a"
"Rule  a" becomes "Rule$space$$space$a"
                  
> Rule names with non-alphabetic characters may lead to name clashes
> ------------------------------------------------------------------
>
>                 Key: DROOLS-287
>                 URL: https://issues.jboss.org/browse/DROOLS-287
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 5.5.0.Final,  6.0.0.CR4
>            Reporter: Davide Sottara
>            Assignee: Mark Proctor
>            Priority: Critical
>             Fix For: 5.5.1.Final, 6.0.0.CR5
>
>
> A KB with the two following rules will not compile:
> {code}
> rule "Rule_>"
> when then end
> rule "Rule_<"
> when then end
> {code}
> Here's a more realistic example:
> {code}
> rule "dollar > euro"
> when then end
> rule "dollar < euro"
> when then end
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the jboss-jira mailing list