The code means the first capital letter is changed to lowercase when the name doesn't matche ALL_UPPERCASE.
But the JavaBeans Specification says:
Thus when we extract a property or event name from the middle of an existing Java name, we
normally convert the first character to lower case. However to support the occasional use of all
upper-case names, we check if the first two characters of the name are both upper case and if
so leave it alone. So for example,
“FooBah” becomes “fooBah”
“Z” becomes “z”
“URL” becomes “URL”
For example:
When I have a property named [MCount] in a class, I use PropertyPath.from to get the property, I'll get the following exception, because the property name was changed to [mCount].
lin opened DATACMNS-1009 and commented
The propertyName changing as below in the PropertyPath constructor doesn't follow the JavaBeans Specification (8.8 Capitalization of inferred names.).
The code means the first capital letter is changed to lowercase when the name doesn't matche ALL_UPPERCASE.
But the JavaBeans Specification says:
For example:
When I have a property named [MCount] in a class, I use PropertyPath.from to get the property, I'll get the following exception, because the property name was changed to [mCount].
Exception:
java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [mCount] on this ManagedType [class]...
Affects: 1.13.1 (Ingalls SR1)
Reference URL: http://stackoverflow.com/questions/43674116/why-the-propertyname-in-propertypath-constructor-doesnt-follow-the-javabeans-sp
The text was updated successfully, but these errors were encountered: