mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
fixed equals() method in ModifyAware collections.
This commit is contained in:
@@ -36,9 +36,13 @@ public class ModifyAwareList<E> implements List<E>, ModifyAwareOwner {
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof ModifyAwareList)) return false;
|
||||
ModifyAwareList<?> that = (ModifyAwareList<?>) o;
|
||||
return Objects.equals(list, that.list);
|
||||
if (o instanceof ModifyAwareList) {
|
||||
ModifyAwareList<?> that = (ModifyAwareList<?>) o;
|
||||
return Objects.equals(list, that.list);
|
||||
}
|
||||
if (!(o instanceof List)) return false;
|
||||
List<?> that = (List<?>) o;
|
||||
return Objects.equals(list, that);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,6 +2,7 @@ package io.ebeaninternal.json;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
@@ -38,9 +39,13 @@ public class ModifyAwareMap<K, V> implements Map<K, V>, ModifyAwareOwner {
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof ModifyAwareMap)) return false;
|
||||
ModifyAwareMap<?, ?> that = (ModifyAwareMap<?, ?>) o;
|
||||
return Objects.equals(map, that.map);
|
||||
if (o instanceof ModifyAwareMap) {
|
||||
ModifyAwareMap<?,?> that = (ModifyAwareMap<?,?>) o;
|
||||
return Objects.equals(map, that.map);
|
||||
}
|
||||
if (!(o instanceof Map)) return false;
|
||||
Map<?,?> that = (Map<?,?>) o;
|
||||
return Objects.equals(map, that);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -55,9 +55,13 @@ public class ModifyAwareSet<E> implements Set<E>, ModifyAwareOwner {
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof ModifyAwareSet)) return false;
|
||||
ModifyAwareSet<?> that = (ModifyAwareSet<?>) o;
|
||||
return Objects.equals(set, that.set);
|
||||
if (o instanceof ModifyAwareSet) {
|
||||
ModifyAwareSet<?> that = (ModifyAwareSet<?>) o;
|
||||
return Objects.equals(set, that.set);
|
||||
}
|
||||
if (!(o instanceof Set)) return false;
|
||||
Set<?> that = (Set<?>) o;
|
||||
return Objects.equals(set, that);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user