Use String::isEmpty instead of "".equals(arg) when arg is not null
This commit is contained in:
committed by
Juergen Hoeller
parent
4883b8aa03
commit
7dba79c7c1
@@ -162,7 +162,7 @@ public class SpringValidatorAdapter implements SmartValidator, javax.validation.
|
||||
// as necessary for Hibernate Validator compatibility (non-indexed set path in field)
|
||||
BindingResult bindingResult = (BindingResult) errors;
|
||||
String nestedField = bindingResult.getNestedPath() + field;
|
||||
if ("".equals(nestedField)) {
|
||||
if (nestedField.isEmpty()) {
|
||||
String[] errorCodes = bindingResult.resolveMessageCodes(errorCode);
|
||||
ObjectError error = new ObjectError(
|
||||
errors.getObjectName(), errorCodes, errorArgs, violation.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user