Merge branch '5.2.x'
This commit is contained in:
@@ -218,7 +218,7 @@ public abstract class AbstractResourceBasedMessageSource extends AbstractMessage
|
||||
* a non-classpath location.
|
||||
*/
|
||||
public void setCacheSeconds(int cacheSeconds) {
|
||||
this.cacheMillis = (cacheSeconds * 1000);
|
||||
this.cacheMillis = cacheSeconds * 1000L;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -146,7 +146,7 @@ public abstract class ExecutorConfigurationSupport extends CustomizableThreadFac
|
||||
* @see java.util.concurrent.ExecutorService#awaitTermination
|
||||
*/
|
||||
public void setAwaitTerminationSeconds(int awaitTerminationSeconds) {
|
||||
this.awaitTerminationMillis = awaitTerminationSeconds * 1000;
|
||||
this.awaitTerminationMillis = awaitTerminationSeconds * 1000L;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -105,7 +105,7 @@ public abstract class AbstractBindingResult extends AbstractErrors implements Bi
|
||||
public void rejectValue(@Nullable String field, String errorCode, @Nullable Object[] errorArgs,
|
||||
@Nullable String defaultMessage) {
|
||||
|
||||
if ("".equals(getNestedPath()) && !StringUtils.hasLength(field)) {
|
||||
if (!StringUtils.hasLength(getNestedPath()) && !StringUtils.hasLength(field)) {
|
||||
// We're at the top of the nested object hierarchy,
|
||||
// so the present level is not a field but rather the top object.
|
||||
// The best we can do is register a global error here...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -311,7 +311,7 @@ public class SpringValidatorAdapter implements SmartValidator, javax.validation.
|
||||
@Nullable
|
||||
protected Object getRejectedValue(String field, ConstraintViolation<Object> violation, BindingResult bindingResult) {
|
||||
Object invalidValue = violation.getInvalidValue();
|
||||
if (!"".equals(field) && !field.contains("[]") &&
|
||||
if (!field.isEmpty() && !field.contains("[]") &&
|
||||
(invalidValue == violation.getLeafBean() || field.contains("[") || field.contains("."))) {
|
||||
// Possibly a bean constraint with property path: retrieve the actual property value.
|
||||
// However, explicitly avoid this for "address[]" style paths that we can't handle.
|
||||
|
||||
Reference in New Issue
Block a user