This commit is contained in:
Phillip Webb
2023-01-18 15:47:50 -08:00
parent 7c508fa324
commit 470a255b0d

View File

@@ -171,21 +171,17 @@ class TypeElementMembers {
if (this.isRecord && this.fields.containsKey(methodName)) {
return methodName;
}
String name;
if (methodName.startsWith("is")) {
name = methodName.substring(2);
return lowerCaseFirstCharacter(methodName.substring(2));
}
else if (methodName.startsWith("get")) {
name = methodName.substring(3);
if (methodName.startsWith("get") || methodName.startsWith("set")) {
return lowerCaseFirstCharacter(methodName.substring(3));
}
else if (methodName.startsWith("set")) {
name = methodName.substring(3);
}
else {
throw new AssertionError("methodName must start with 'is', 'get' or 'set', was '" + methodName + "'");
}
name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
return name;
throw new IllegalStateException("methodName must start with 'is', 'get' or 'set', was '" + methodName + "'");
}
private String lowerCaseFirstCharacter(String string) {
return Character.toLowerCase(string.charAt(0)) + string.substring(1);
}
private void processField(VariableElement field) {