From d319f562aab16ca40db3f006696f87b45f53836b Mon Sep 17 00:00:00 2001 From: ialbert Date: Mon, 30 Jun 2025 13:17:35 +0300 Subject: [PATCH] execution loading bugfix --- .../service/execution/ExecUploadKey.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/clearing-parent/clearing-service/src/main/java/ru/spcex/clearing/service/execution/ExecUploadKey.java b/clearing-parent/clearing-service/src/main/java/ru/spcex/clearing/service/execution/ExecUploadKey.java index de3290f73..3cfa3aed2 100644 --- a/clearing-parent/clearing-service/src/main/java/ru/spcex/clearing/service/execution/ExecUploadKey.java +++ b/clearing-parent/clearing-service/src/main/java/ru/spcex/clearing/service/execution/ExecUploadKey.java @@ -22,21 +22,17 @@ public record ExecUploadKey(LocalDate tradeDate, Long exchangeExecutionId, Strin @Override public boolean equals(Object o) { if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (!(o instanceof ExecUploadKey that)) return false; - ExecUploadKey that = (ExecUploadKey) o; - - if (!Objects.equals(tradeDate, that.tradeDate)) return false; - if (!Objects.equals(exchangeExecutionId, that.exchangeExecutionId)) - return false; - return Objects.equals(side, that.side); + return Objects.equals(side, that.side) && Objects.equals(market, that.market) && Objects.equals(tradeDate, that.tradeDate) && Objects.equals(exchangeExecutionId, that.exchangeExecutionId); } @Override public int hashCode() { - int result = tradeDate != null ? tradeDate.hashCode() : 0; - result = 31 * result + (exchangeExecutionId != null ? exchangeExecutionId.hashCode() : 0); - result = 31 * result + (side != null ? side.hashCode() : 0); + int result = Objects.hashCode(tradeDate); + result = 31 * result + Objects.hashCode(exchangeExecutionId); + result = 31 * result + Objects.hashCode(market); + result = 31 * result + Objects.hashCode(side); return result; } }