File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
jacodb-ets/src/main/kotlin/org/jacodb/ets/model Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,31 @@ data class EtsClassSignature(
7979 }
8080 }
8181
82+ private val cachedHashCode: Int = run {
83+ var result = name.hashCode()
84+ result = 31 * result + file.hashCode()
85+ result = 31 * result + (namespace?.hashCode() ? : 0 )
86+ result
87+ }
88+
89+ override fun hashCode (): Int {
90+ return cachedHashCode
91+ }
92+
93+ override fun equals (other : Any? ): Boolean {
94+ if (this == = other) return true
95+ if (javaClass != other?.javaClass) return false
96+
97+ other as EtsClassSignature
98+
99+ if (cachedHashCode != other.cachedHashCode) return false
100+ if (name != other.name) return false
101+ if (file != other.file) return false
102+ if (namespace != other.namespace) return false
103+
104+ return true
105+ }
106+
82107 companion object {
83108 val UNKNOWN = EtsClassSignature (
84109 name = UNKNOWN_CLASS_NAME ,
You can’t perform that action at this time.
0 commit comments