From 36337f7feb1b6d44af2a6f7f529084ab69c44417 Mon Sep 17 00:00:00 2001 From: games647 Date: Fri, 14 Jan 2022 12:50:07 +0100 Subject: [PATCH] Fix potential thread-safety issues in storing the profile --- .../com/github/games647/fastlogin/core/StoredProfile.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/github/games647/fastlogin/core/StoredProfile.java b/core/src/main/java/com/github/games647/fastlogin/core/StoredProfile.java index 19522a12..54cdbda5 100644 --- a/core/src/main/java/com/github/games647/fastlogin/core/StoredProfile.java +++ b/core/src/main/java/com/github/games647/fastlogin/core/StoredProfile.java @@ -113,7 +113,7 @@ public class StoredProfile extends Profile { } @Override - public boolean equals(Object o) { + public synchronized boolean equals(Object o) { if (this == o) return true; if (!(o instanceof StoredProfile)) return false; if (!super.equals(o)) return false; @@ -123,7 +123,7 @@ public class StoredProfile extends Profile { } @Override - public int hashCode() { + public synchronized int hashCode() { return Objects.hash(super.hashCode(), rowId, premium, lastIp, lastLogin); }