diff options
author | Vitaly Takmazov | 2023-02-22 02:14:18 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-02-22 02:14:43 +0300 |
commit | 2c8032aa075e9aaa73746429b05546a48c7e007e (patch) | |
tree | da1468c70625469a35918ce0a6361178933232a0 /src/main/java/com/juick/model | |
parent | 64e6b703b7fa50a31dc0b73ec85230aa99c77bd5 (diff) |
Fix memory issues when using Reaction
Diffstat (limited to 'src/main/java/com/juick/model')
-rw-r--r-- | src/main/java/com/juick/model/Reaction.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/com/juick/model/Reaction.java b/src/main/java/com/juick/model/Reaction.java index 4b3501d4..3f666cf6 100644 --- a/src/main/java/com/juick/model/Reaction.java +++ b/src/main/java/com/juick/model/Reaction.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2020, Juick + * Copyright (C) 2008-2023, Juick * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -20,6 +20,7 @@ package com.juick.model; import org.apache.commons.lang3.builder.ToStringBuilder; import java.io.Serializable; +import java.util.Objects; public class Reaction implements Serializable { @@ -41,6 +42,16 @@ public class Reaction implements Serializable { .append("count", count) .build(); } + @Override + public boolean equals(Object o) { + return o == this || + (o instanceof Reaction) && Objects.equals(id, ((Reaction) o).id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } public String getDescription() { return description; |