File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/util Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -1024,16 +1024,15 @@ sealed class ExecutableId : StatementId() {
10241024 return " $name ($args )$retType "
10251025 }
10261026
1027+ fun describesSameMethodAs (other : ExecutableId ): Boolean {
1028+ return classId == other.classId && signature == other.signature
1029+ }
1030+
10271031 override fun equals (other : Any? ): Boolean {
10281032 if (this == = other) return true
10291033 if (javaClass != other?.javaClass) return false
10301034
1031- other as ExecutableId
1032-
1033- if (classId != other.classId) return false
1034- if (signature != other.signature) return false
1035-
1036- return true
1035+ return describesSameMethodAs(other as ExecutableId )
10371036 }
10381037
10391038 override fun hashCode (): Int {
Original file line number Diff line number Diff line change @@ -41,10 +41,10 @@ infix fun ClassId.isAccessibleFrom(packageName: String): Boolean {
4141 * Returns field of [this], such that [methodId] is a getter for it (or null if methodId doesn't represent a getter)
4242 */
4343internal fun ClassId.fieldThatIsGotWith (methodId : MethodId ): FieldId ? =
44- allDeclaredFieldIds.singleOrNull { ! it.isStatic && it.getter == methodId }
44+ allDeclaredFieldIds.singleOrNull { ! it.isStatic && it.getter.describesSameMethodAs( methodId) }
4545
4646/* *
4747 * Returns field of [this], such that [methodId] is a setter for it (or null if methodId doesn't represent a setter)
4848 */
4949internal fun ClassId.fieldThatIsSetWith (methodId : MethodId ): FieldId ? =
50- allDeclaredFieldIds.singleOrNull { ! it.isStatic && it.setter == methodId }
50+ allDeclaredFieldIds.singleOrNull { ! it.isStatic && it.setter.describesSameMethodAs( methodId) }
You can’t perform that action at this time.
0 commit comments