Skip to content

Commit 3bd2859

Browse files
Kamenev YuryDamtev
Kamenev Yury
authored andcommitted
Small refactoring
1 parent 0be6fcb commit 3bd2859

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

utbot-framework/src/main/kotlin/org/utbot/engine/util/statics/concrete/EnumConcreteUtils.kt

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,17 @@ fun SootMethod.isTouchingExternalStatics(
195195
val leftOp = it.leftOp
196196
val rightOp = it.rightOp
197197

198-
val assigningOuterStatics =
199-
isExternalStaticField(leftOp, currentClassImplementedInterfaces, currentClass)
200-
201-
val assignmentFromOuterStatics =
202-
isExternalStaticField(rightOp, currentClassImplementedInterfaces, currentClass)
198+
val assigningOuterStatics = isExternalStaticField(
199+
leftOp,
200+
currentClassImplementedInterfaces,
201+
currentClass
202+
)
203+
204+
val assignmentFromOuterStatics = isExternalStaticField(
205+
rightOp,
206+
currentClassImplementedInterfaces,
207+
currentClass
208+
)
203209

204210
assigningOuterStatics || assignmentFromOuterStatics
205211
}
@@ -233,8 +239,7 @@ private fun isExternalStaticField(
233239

234240
val declaringClass = fieldRef.field.declaringClass
235241

236-
val classInImplementedInterfaces =
237-
declaringClass.type in currentClassImplementedInterfaces
242+
val classInImplementedInterfaces = declaringClass.type in currentClassImplementedInterfaces
238243

239-
return !(classInImplementedInterfaces || declaringClass == currentClass)
244+
return !classInImplementedInterfaces && declaringClass != currentClass
240245
}

0 commit comments

Comments
 (0)