/** * Get the last component of the path. Also works if not nested. * * @param bw BeanWrapper to work on * @param nestedPath property path we know is nested * @return last component of the path (the property on the target bean) */ private String getFinalPath(BeanWrapper bw, String nestedPath) { if (bw == this) { return nestedPath; } return nestedPath.substring( PropertyAccessorUtils.getLastNestedPropertySeparatorIndex(nestedPath) + 1); }