Integer vs Long comparison
A type mismatch in comparison operands exists in method isSuccess
in CaptchaServiceImpl
class:
private boolean isSuccess(CaptchaDto captchaDto, Date sendingDate) {
return this.serverConfigurationService.getCaptchaAppPackageName().equals(captchaDto.getAppPackageName()) && Math.abs(
sendingDate.getTime() - captchaDto.getChallengeTimestamp().getTime()) <= this.serverConfigurationService
.getCaptchaChallengeTimestampTolerance() * 1000;
}
Math.abs(sendingDate.getTime() - captchaDto.getChallengeTimestamp().getTime())
is of type long
this.serverConfigurationService.getCaptchaChallengeTimestampTolerance() * 1000
is of type int
Convert 1000 to long or change the response type to long for the method getCaptchaChallengeTimestampTolerance
in interface IServerConfigurationService
to avoid the problem.