Skip to content

Commit

Permalink
Comment the equals() and hashCode() methods in GeneratedConnector and…
Browse files Browse the repository at this point in the history
… GeneratedConnector (#5970)

From b/340910059: In order to document the behavior of the equals() and
hashCode() methods of the generated classes, these methods were added to
the GeneratedConnector and GeneratedOperation interfaces in the Android
Core SDK; however, adding these methods is a breaking change that
requires the implementing classes to explicitly define them, rather than
inheriting the (correct) default behavior from kotlin.Any. Since the
released codegen does not explicitly define these methods it fails to
compile. However, once the codegen that does define those methods is
sufficiently soaked, they should be uncommented.
  • Loading branch information
dconeybe authored May 15, 2024
1 parent 35bf5c4 commit f9b5dd9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,20 @@ public interface GeneratedConnector {
* @param other The object to compare to this for equality.
* @return `other === this`
*/
override fun equals(other: Any?): Boolean
// TODO: Uncomment equals() once the codegen changes in cl/634029357 are released in the latest
// firestore-tools for a month or so, as adding this method is a breaking change as it forces the
// generated classes to explicitly override this method.
// override fun equals(other: Any?): Boolean

/**
* Calculates and returns the hash code for this object.
*
* @return the hash code for this object.
*/
override fun hashCode(): Int
// TODO: Uncomment hashCode() once the codegen changes in cl/634029357 are released in the latest
// firestore-tools for a month or so, as adding this method is a breaking change as it forces the
// generated classes to explicitly override this method.
// override fun hashCode(): Int

/**
* Returns a string representation of this object, useful for debugging.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,20 @@ public interface GeneratedOperation<Connector : GeneratedConnector, Data, Variab
* @param other The object to compare to this for equality.
* @return `other === this`
*/
override fun equals(other: Any?): Boolean
// TODO: Uncomment equals() once the codegen changes in cl/634029357 are released in the latest
// firestore-tools for a month or so, as adding this method is a breaking change as it forces the
// generated classes to explicitly override this method.
// override fun equals(other: Any?): Boolean

/**
* Calculates and returns the hash code for this object.
*
* @return the hash code for this object.
*/
override fun hashCode(): Int
// TODO: Uncomment hashCode() once the codegen changes in cl/634029357 are released in the latest
// firestore-tools for a month or so, as adding this method is a breaking change as it forces the
// generated classes to explicitly override this method.
// override fun hashCode(): Int

/**
* Returns a string representation of this object, useful for debugging.
Expand Down

0 comments on commit f9b5dd9

Please sign in to comment.