forked from TuxCoding/FastLogin
Fix potential thread-safety issues in storing the profile
This commit is contained in:
@@ -113,7 +113,7 @@ public class StoredProfile extends Profile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public synchronized boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) return true;
|
||||||
if (!(o instanceof StoredProfile)) return false;
|
if (!(o instanceof StoredProfile)) return false;
|
||||||
if (!super.equals(o)) return false;
|
if (!super.equals(o)) return false;
|
||||||
@@ -123,7 +123,7 @@ public class StoredProfile extends Profile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public synchronized int hashCode() {
|
||||||
return Objects.hash(super.hashCode(), rowId, premium, lastIp, lastLogin);
|
return Objects.hash(super.hashCode(), rowId, premium, lastIp, lastLogin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user