mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -242,11 +242,13 @@ public class JWTValidator {
|
||||
* @throws ValidateException 验证异常
|
||||
*/
|
||||
@SuppressWarnings("SameParameterValue")
|
||||
private static void validateNotBefore(final String fieldName, final Date dateToCheck, final Date now, final long leeway) throws ValidateException {
|
||||
private static void validateNotBefore(final String fieldName, final Date dateToCheck, Date now, final long leeway) throws ValidateException {
|
||||
if (null == dateToCheck) {
|
||||
return;
|
||||
}
|
||||
now.setTime(now.getTime() - leeway * 1000);
|
||||
if(leeway > 0){
|
||||
now = DateUtil.date(now.getTime() - leeway * 1000);
|
||||
}
|
||||
if (dateToCheck.before(now)) {
|
||||
throw new ValidateException("'{}':[{}] is before now:[{}]",
|
||||
fieldName, DateUtil.date(dateToCheck), DateUtil.date(now));
|
||||
|
Reference in New Issue
Block a user