Skip to content

Commit

Permalink
check for instance of the same class in equals()
Browse files Browse the repository at this point in the history
  • Loading branch information
angryziber committed Jan 7, 2025
1 parent 082c3d1 commit 3eceb59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion smtp/src/EmailContent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ open class EmailContent(val lang: String, val labelKey: String, val substitution
open val actionLabel get() = translate(lang, "emails.$labelKey.action", substitutions)
open val from: InternetAddress? get() = null

override fun equals(other: Any?) = other is EmailContent && lang == other.lang && labelKey == other.labelKey && substitutions == other.substitutions && actionUrl == other.actionUrl
override fun equals(other: Any?) = other is EmailContent && javaClass == other.javaClass && lang == other.lang && labelKey == other.labelKey && substitutions == other.substitutions && actionUrl == other.actionUrl
override fun hashCode() = Objects.hash(lang, labelKey, substitutions, actionUrl)
override fun toString() = "${this::class.simpleName}($lang, $labelKey, $substitutions, $actionUrl)"

Expand Down

0 comments on commit 3eceb59

Please sign in to comment.