Skip to content

Commit a043c33

Browse files
authored
Use unique mocking statement if all cases are equal (#2002)
1 parent 8321fc2 commit a043c33

File tree

8 files changed

+109
-93
lines changed

8 files changed

+109
-93
lines changed

utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api/Api.kt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,9 +1148,24 @@ class BuiltinConstructorId(
11481148
}
11491149
}
11501150

1151-
open class TypeParameters(val parameters: List<ClassId> = emptyList())
1151+
open class TypeParameters(val parameters: List<ClassId> = emptyList()) {
1152+
override fun equals(other: Any?): Boolean {
1153+
if (this === other) return true
1154+
if (javaClass != other?.javaClass) return false
1155+
1156+
other as TypeParameters
1157+
1158+
if (parameters != other.parameters) return false
1159+
1160+
return true
1161+
}
1162+
1163+
override fun hashCode(): Int {
1164+
return parameters.hashCode()
1165+
}
1166+
}
11521167

1153-
class WildcardTypeParameter : TypeParameters(emptyList())
1168+
object WildcardTypeParameter : TypeParameters(emptyList())
11541169

11551170
/**
11561171
* Describes the way to replace abstract types with concrete implementors.

0 commit comments

Comments
 (0)