Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Apply review comments
  • Loading branch information
sergeypospelov committed Aug 15, 2022
commit db659ce57c897e34d5bb9bc0125a40d74d09bc43
11 changes: 9 additions & 2 deletions utbot-framework/src/main/kotlin/org/utbot/engine/Traverser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1790,11 +1790,18 @@ class Traverser(
return createdField
}

/**
* For now the field is `meaningful` if it is safe to set, that is, it is not an internal system field nor a
* synthetic field. This filter is needed to prohibit changing internal fields, which can break up our own
* code and which are useless for the user.
*
* @return `true` if the field is meaningful, `false` otherwise.
*/
private fun isStaticFieldMeaningful(field: SootField) =
!Modifier.isSynthetic(field.modifiers) &&
// we don't want to set fields from library classes
workaround(IGNORE_STATICS_FROM_TRUSTED_LIBRARIES) {
!ignoreStaticsFromTrustedLibraries || !field.declaringClass.isFromTrustedLibrary()
!workaround(IGNORE_STATICS_FROM_TRUSTED_LIBRARIES) {
ignoreStaticsFromTrustedLibraries && field.declaringClass.isFromTrustedLibrary()
}

/**
Expand Down