fixed equals() method in ModifyAware collections.

This commit is contained in:
Roland Praml
2019-05-08 16:45:02 +02:00
parent 2648423930
commit 662f9cdeb3
3 changed files with 22 additions and 9 deletions
@@ -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