Skip to content

Commit 627a3bf

Browse files
Allowing Query/CollectionReference and DocumentSnapshot/QueryDocumentSnapshot equality
1 parent 79f02eb commit 627a3bf

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

google-cloud-firestore/src/main/java/com/google/cloud/firestore/DocumentSnapshot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ public boolean equals(Object obj) {
423423
if (this == obj) {
424424
return true;
425425
}
426-
if (obj == null || getClass() != obj.getClass()) {
426+
if (obj == null || !(obj instanceof DocumentSnapshot)) {
427427
return false;
428428
}
429429
DocumentSnapshot that = (DocumentSnapshot) obj;

google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ public boolean equals(Object obj) {
10771077
if (this == obj) {
10781078
return true;
10791079
}
1080-
if (obj == null || getClass() != obj.getClass()) {
1080+
if (obj == null || !(obj instanceof Query)) {
10811081
return false;
10821082
}
10831083
Query query = (Query) obj;

0 commit comments

Comments
 (0)