File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
usvm-ts/src/main/kotlin/org/usvm/util Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 11package org.usvm.util
22
3+ import mu.KotlinLogging
34import org.jacodb.ets.model.EtsClass
45import org.jacodb.ets.model.EtsClassType
56import org.jacodb.ets.model.EtsField
@@ -12,6 +13,8 @@ import org.jacodb.ets.utils.CONSTRUCTOR_NAME
1213import org.jacodb.ets.utils.UNKNOWN_CLASS_NAME
1314import org.usvm.machine.TsContext
1415
16+ private val logger = KotlinLogging .logger {}
17+
1518fun TsContext.resolveEtsField (
1619 instance : EtsLocal ? ,
1720 field : EtsFieldSignature ,
@@ -68,10 +71,12 @@ private fun tryGetSingleField(
6871 val clazz = classes.single()
6972 val fields = clazz.getAllFields(hierarchy).filter { it.name == fieldName }
7073 if (fields.isEmpty()) {
71- error(" No field with name '$fieldName ' in class '${clazz.name} '" )
74+ // logger.warn { "No field with name '$fieldName' in class '${clazz.name}'" }
75+ return null
7276 }
7377 if (fields.size > 1 ) {
74- error(" Multiple fields with name '$fieldName ' in class '${clazz.name} ': $fields " )
78+ logger.warn { " Multiple fields with name '$fieldName ' in class '${clazz.name} ': $fields " }
79+ return null
7580 }
7681 return fields.single()
7782 }
You can’t perform that action at this time.
0 commit comments