The name of the variable propertyName in the PropertyPath class's constructor seems not following the JavaBeans Specification (8.8 Capitalization of inferred names.).
// PropertyPath Code: lines 73:
PropertyPath(String name, TypeInformation<?> owningType, List<PropertyPath> base) {
...
String propertyName = name.matches(ALL_UPPERCASE) ? name : StringUtils.uncapitalize(name);
...
}
The code means the first capital letter is changed to lowercase when the name doesn't matche ALL_UPPERCASE.
But the JavaBeans Specification says:
JavaBeans Specification
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: If I have a property named [MCount] in a class, the property name should be [MCount] according with JavaBeans Specification. But if I use [PropertyPath.from](which will call the PropertyPath constructor) as below to get the property, I'll get the following exception, because the property name was changed to [mCount].
PropertyPath property = PropertyPath.from("MCount", classType);
Exception: java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [mCount] on this ManagedType [class]...
Anyone has a good opinion? Thanks!