Buggy code:
@ Component public class PowerAuthServiceImpl implements PowerAuthService { @ Autowired private PowerAuthRepository powerAuthRepository ; @ Autowired private MasterKeyPairRepository masterKeyPairRepository ; private final PowerAuthServerActivation powerAuthServerActivation = new PowerAuthServerActivation ( ) ; private final PowerAuthServerSignature powerAuthServerSignature = new PowerAuthServerSignature ( ) ; private final PowerAuthServerVault powerAuthServerVault = new PowerAuthServerVault ( ) ; private final KeyConversionUtils keyConversionUtilities = new KeyConversionUtils ( ) ; @ Override public GetActivationListForUserResponse getActivatioListForUser ( GetActivationListForUserRequest request ) throws Exception { } @ Override public GetActivationStatusResponse getActivationStatus ( GetActivationStatusRequest request ) throws Exception { } @ Override @ Transactional public InitActivationResponse initActivation ( InitActivationRequest request ) throws Exception { } @ Override @ Transactional public PrepareActivationResponse prepareActivation ( PrepareActivationRequest request ) throws Exception { } private VerifySignatureResponse verifySignatureImplNonTransaction ( VerifySignatureRequest request ) throws Exception { } @ Override @ Transactional public VerifySignatureResponse verifySignature ( VerifySignatureRequest request ) throws Exception { } @ Override @ Transactional public CommitActivationResponse commitActivation ( CommitActivationRequest request ) throws Exception { try { String activationId = request . getActivationId ( ) ; ActivationRecordEntity activation = powerAuthRepository . findFirstByActivationId ( activationId ) ; Date timestamp = new Date ( ) ; <START_BUG> if ( ( activation == null ) || ( ( ( timestamp . getTime ( ) ) - ( activation . getTimestampCreated ( ) . getTime ( ) ) ) < ( PowerAuthConstants . ACTIVATION_VALIDITY_BEFORE_ACTIVE ) ) ) { <END_BUG> activation . setActivationStatus ( REMOVED ) ; powerAuthRepository . save ( activation ) ; throw new GenericServiceException ( "ERROR_ACTIVATION_EXPIRED" , "This<seq2seq4repair_space>activation<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>expired." ) ; } boolean activated = false ; if ( activation != null ) { activated = true ; activation . setActivationStatus ( ACTIVE ) ; powerAuthRepository . save ( activation ) ; } CommitActivationResponse response = new CommitActivationResponse ( ) ; response . setActivationId ( activationId ) ; response . setActivated ( activated ) ; return response ; } catch ( GenericServiceException ex ) { Logger . getLogger ( PowerAuthServiceImpl . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; throw ex ; } catch ( Exception ex ) { Logger . getLogger ( PowerAuthServiceImpl . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; throw new GenericServiceException ( "Unknown<seq2seq4repair_space>exception<seq2seq4repair_space>has<seq2seq4repair_space>occurred" ) ; } } @ Override @ Transactional public RemoveActivationResponse removeActivation ( RemoveActivationRequest request ) throws Exception { } @ Override @ Transactional public BlockActivationResponse blockActivation ( BlockActivationRequest request ) throws Exception { } @ Override @ Transactional public UnblockActivationResponse unblockActivation ( UnblockActivationRequest request ) throws Exception { } @ Override @ Transactional public VaultUnlockResponse vaultUnlock ( VaultUnlockRequest request ) throws Exception { } }

Fix:
if ( ( activation == null ) || ( ( ( timestamp . getTime ( ) ) - ( activation . getTimestampCreated ( ) . getTime ( ) ) ) > ( PowerAuthConstants . ACTIVATION_VALIDITY_BEFORE_ACTIVE ) ) ) {