File tree Expand file tree Collapse file tree 3 files changed +5
-14
lines changed
utbot-framework/src/main/kotlin/org/utbot/engine
utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api Expand file tree Collapse file tree 3 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -806,9 +806,6 @@ enum class FieldIdStrategyValues {
806
806
*/
807
807
open class FieldId (val declaringClass : ClassId , val name : String ) {
808
808
809
- init {
810
- // assert(declaringClass.jClass.declaredFields.any { it.name == name })
811
- }
812
809
object Strategy {
813
810
var value: FieldIdStrategyValues = FieldIdStrategyValues .Soot
814
811
}
Original file line number Diff line number Diff line change @@ -290,7 +290,7 @@ fun ClassId.fieldOrNull(fieldId: FieldId): Field? {
290
290
return null
291
291
return try {
292
292
fieldId.field
293
- } catch (e: Exception ) {
293
+ } catch (e: IllegalStateException ) {
294
294
null
295
295
}
296
296
}
Original file line number Diff line number Diff line change @@ -28,17 +28,11 @@ class Hierarchy(private val typeRegistry: TypeRegistry) {
28
28
type as ? RefType ? : error(" $type is not a refType" )
29
29
30
30
val realType = typeRegistry.findRealType(type) as RefType
31
+ val realFieldDeclaringClass = typeRegistry.findRealType(field.declaringClass.type) as RefType
31
32
32
-
33
- /* val ancestorType = field.declaringClass
34
- val ancestorType2 = ancestors(realType.sootClass.id).firstOrNull { it.declaresField(field.subSignature) }?.type
35
- ?: error("No such field ${field.subSignature} found in ${realType.sootClass.name}")*/
36
- val ancestorType = if (field.declaringClass in ancestors(realType.sootClass.id))
37
- field.declaringClass
38
- else
39
- ancestors(realType.sootClass.id).firstOrNull { it.declaresField(field.subSignature) }?.type
40
- ? : error(" No such field ${field.subSignature} found in ${realType.sootClass.name} " )
41
- return ChunkId (" $ancestorType " , field.name)
33
+ if (realFieldDeclaringClass.sootClass !in ancestors(realType.sootClass.id))
34
+ error(" No such field ${field.subSignature} found in ${realType.sootClass.name} " )
35
+ return ChunkId (" $realFieldDeclaringClass " , field.name)
42
36
}
43
37
44
38
/* *
You can’t perform that action at this time.
0 commit comments