Committed by
Gerrit Code Review
Change applicationId's equality checking and hashing method
Application id in applicationId class is transient. So it would be better to use application name to check equality. Change-Id: I5f6807054e9a882316ff0a88242cb752eb78bcb9
Showing
1 changed file
with
2 additions
and
2 deletions
... | @@ -58,7 +58,7 @@ public class DefaultApplicationId implements ApplicationId { | ... | @@ -58,7 +58,7 @@ public class DefaultApplicationId implements ApplicationId { |
58 | 58 | ||
59 | @Override | 59 | @Override |
60 | public int hashCode() { | 60 | public int hashCode() { |
61 | - return Short.hashCode(id); | 61 | + return Objects.hash(name); |
62 | } | 62 | } |
63 | 63 | ||
64 | @Override | 64 | @Override |
... | @@ -68,7 +68,7 @@ public class DefaultApplicationId implements ApplicationId { | ... | @@ -68,7 +68,7 @@ public class DefaultApplicationId implements ApplicationId { |
68 | } | 68 | } |
69 | if (obj instanceof DefaultApplicationId) { | 69 | if (obj instanceof DefaultApplicationId) { |
70 | DefaultApplicationId other = (DefaultApplicationId) obj; | 70 | DefaultApplicationId other = (DefaultApplicationId) obj; |
71 | - return Objects.equals(this.id, other.id); | 71 | + return Objects.equals(this.name, other.name); |
72 | } | 72 | } |
73 | return false; | 73 | return false; |
74 | } | 74 | } | ... | ... |
-
Please register or login to post a comment