Skip to content

Commit

Permalink
Merge pull request #331 from congyuluo/identifier_refactorings
Browse files Browse the repository at this point in the history
Refactored Identifiers
  • Loading branch information
Sunagatov authored Jul 1, 2024
2 parents 4411ff1 + b06e8ac commit 2686670
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/zufar/icedlatte/order/entity/Order.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public boolean equals(Object object) {
return true;
if (object == null || getClass() != object.getClass())
return false;
var that = (Order) object;
return Objects.equals(id, that.id);
var order = (Order) object;
return Objects.equals(id, order.id);
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/zufar/icedlatte/order/entity/OrderItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ public boolean equals(Object object) {
if (object == null || getClass() != object.getClass())
return false;

var that = (OrderItem) object;
var otherOrderItem = (OrderItem) object;

return new EqualsBuilder()
.append(id, that.id)
.append(productInfo, that.productInfo)
.append(id, otherOrderItem.id)
.append(productInfo, otherOrderItem.productInfo)
.isEquals();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public void reset(final String userEmail) {
userAccountLocker.unlockUserAccount(userEmail);

loginAttemptRepository.findByUserEmail(userEmail)
.ifPresent(loginAttempt -> {
.ifPresent(existingLoginAttempt -> {
LoginAttemptEntity newLoginAttempt = loginAttemptFactory.createInitialFailedLoggedAttemptEntity(userEmail);
newLoginAttempt.setId(loginAttempt.getId());
newLoginAttempt.setId(existingLoginAttempt.getId());

loginAttemptRepository.save(newLoginAttempt);
log.info("Login attempts reset for user {}.", userEmail);
Expand Down

0 comments on commit 2686670

Please sign in to comment.