in spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java [876:896]
private ElementType updateType(ElementType existingType, char ch, int index) {
if (existingType.isIndexed()) {
if (existingType == ElementType.NUMERICALLY_INDEXED && !isNumeric(ch)) {
return ElementType.INDEXED;
}
return existingType;
}
if (existingType == ElementType.EMPTY && isValidChar(ch, index)) {
return (index == 0) ? ElementType.UNIFORM : ElementType.NON_UNIFORM;
}
if (existingType == ElementType.UNIFORM && ch == '-') {
return ElementType.DASHED;
}
if (!isValidChar(ch, index)) {
if (existingType == ElementType.EMPTY && !isValidChar(Character.toLowerCase(ch), index)) {
return ElementType.EMPTY;
}
return ElementType.NON_UNIFORM;
}
return existingType;
}