Details
-
Bug
-
Resolution: Won't Do
-
Major
-
6.3.0.Final
-
None
-
Workaround Exists
-
-
NEW
-
NEW
Description
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.
public class I18nPerson implements Serializable { private 住所 住所; // "address" in Japanese public 住所 get住所() { return 住所; } ....
when p : I18nPerson( 住所 != null )
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.
public class Person implements Serializable { private Address address; public Address getAddress() { return address; } ....
when p : I18nPerson( Address != null )
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.