[jboss-jira] [JBoss JIRA] (DROOLS-1015) Wrong MvelConstraint compilation with Unicode class name and the same name property

Toshiya Kobayashi (JIRA) issues at jboss.org
Thu Dec 24 04:00:01 EST 2015


Toshiya Kobayashi created DROOLS-1015:
-----------------------------------------

             Summary: Wrong MvelConstraint compilation with Unicode class name and the same name property
                 Key: DROOLS-1015
                 URL: https://issues.jboss.org/browse/DROOLS-1015
             Project: Drools
          Issue Type: Bug
          Components: core engine
    Affects Versions: 6.3.0.Final
            Reporter: Toshiya Kobayashi
            Assignee: Mario Fusco


If a fact has a property of Unicode class name (e.g. 住所) and the property name is the same (住所), constraint is not correctly compiled by MVEL. Internally, AbstractParser.createPropertyToken() misunderstands the property as a class name literal.
{code:java}
public class I18nPerson implements Serializable {
    private 住所 住所; // "address" in Japanese
    public 住所 get住所() {
        return 住所;
    }
    ....
{code}
{noformat}
when
  p : I18nPerson( 住所 != null )
{noformat}

This constraint is always evaluated to "true".

Essentially, this is not only a problem of Unicode. We can reproduce the issue by a capitalized property name.

{code:java}
public class Person implements Serializable {
    private Address address;
    public Address getAddress() {
        return address;
    }
    ....
{code}
{noformat}
when
  p : I18nPerson( Address != null )
{noformat}

Of course we should use lower case letters here from JavaBeans point of view so we don't hit this issue with English usually. But some languages like Japanese cannot express "lower case/upper case" so result in this issue.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)



More information about the jboss-jira mailing list