Skip to content

Commit 4d88c95

Browse files
committed
Review feedback
1 parent 024e9fe commit 4d88c95

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/model/mutation/ArrayTransformOperation.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ public FieldValue applyToRemoteDocument(FieldValue previousValue, FieldValue tra
5151
}
5252

5353
@Override
54-
public final boolean equals(Object o) {
54+
@SuppressWarnings("EqualsGetClass") // subtype-sensitive equality is intended.
55+
public boolean equals(Object o) {
5556
if (this == o) {
5657
return true;
5758
}
58-
if (!(o instanceof ArrayTransformOperation)) {
59+
if (o == null || getClass() != o.getClass()) {
5960
return false;
6061
}
6162

firebase-firestore/src/testUtil/java/com/google/firebase/firestore/testutil/TestUtil.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,9 @@ public static PatchMutation patchMutation(
432432

433433
boolean merge = updateMask != null;
434434

435-
// We sort the fieldMaskPaths to make the order deterministic in tests.
435+
// We sort the fieldMaskPaths to make the order deterministic in tests. (Otherwise, when we
436+
// flatten a Set to a proto repeated field, we'll end up comparing in iterator order and
437+
// possibly consider {foo,bar} != {bar,foo}.)
436438
SortedSet<FieldPath> fieldMaskPaths = new TreeSet<>(merge ? updateMask : objectMask);
437439

438440
return new PatchMutation(

0 commit comments

Comments
 (0)