File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/util
utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api 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() {
1024
1024
return " $name ($args )$retType "
1025
1025
}
1026
1026
1027
+ fun describesSameMethodAs (other : ExecutableId ): Boolean {
1028
+ return classId == other.classId && signature == other.signature
1029
+ }
1030
+
1027
1031
override fun equals (other : Any? ): Boolean {
1028
1032
if (this == = other) return true
1029
1033
if (javaClass != other?.javaClass) return false
1030
1034
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 )
1037
1036
}
1038
1037
1039
1038
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 {
41
41
* Returns field of [this], such that [methodId] is a getter for it (or null if methodId doesn't represent a getter)
42
42
*/
43
43
internal fun ClassId.fieldThatIsGotWith (methodId : MethodId ): FieldId ? =
44
- allDeclaredFieldIds.singleOrNull { ! it.isStatic && it.getter == methodId }
44
+ allDeclaredFieldIds.singleOrNull { ! it.isStatic && it.getter.describesSameMethodAs( methodId) }
45
45
46
46
/* *
47
47
* Returns field of [this], such that [methodId] is a setter for it (or null if methodId doesn't represent a setter)
48
48
*/
49
49
internal 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