enh: use isEmpty() instead of length()

This commit is contained in:
ali dandach 2024-03-04 23:05:11 +02:00 committed by Juergen Hoeller
parent 79c54098ab
commit 1cb2dfa459
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ public abstract class AbstractErrors implements Errors, Serializable {
nestedPath = "";
}
nestedPath = canonicalFieldName(nestedPath);
if (nestedPath.length() > 0 && !nestedPath.endsWith(NESTED_PATH_SEPARATOR)) {
if (!nestedPath.isEmpty() && !nestedPath.endsWith(NESTED_PATH_SEPARATOR)) {
nestedPath += NESTED_PATH_SEPARATOR;
}
this.nestedPath = nestedPath;