Skip to content

Commit d3974e9

Browse files
committed
tmp
1 parent 284a26d commit d3974e9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

utbot-framework/src/main/kotlin/org/utbot/framework/modifications/DirectAccessorsAnalyzer.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,22 @@ class DirectAccessorsAnalyzer {
1717
*/
1818
fun collectDirectAccesses(classIds: Set<ClassId>): Set<DirectFieldAccessId> =
1919
classIds
20-
.flatMap { classId -> collectFieldsInPackage(classId) }
20+
.flatMap { classId -> collectFields(classId) }
2121
.map { fieldId -> DirectFieldAccessId(fieldId.declaringClass, directSetterName(fieldId), fieldId) }
2222
.toSet()
2323

2424
/**
25-
* Collect all fields with different non-private modifiers from class [classId].
25+
* Collect all fields with different non-private modifiers
26+
* from class [classId] or it's base classes.
2627
*/
27-
private fun collectFieldsInPackage(classId: ClassId): Set<FieldId> {
28+
private fun collectFields(classId: ClassId): Set<FieldId> {
2829
var clazz = classId.jClass
2930

3031
val fieldIds = mutableSetOf<Field>()
3132
fieldIds += clazz.declaredFields.filterNot { Modifier.isPrivate(it.modifiers) }
3233
while (clazz.superclass != null) {
3334
clazz = clazz.superclass
34-
fieldIds += clazz.declaredFields.filter { Modifier.isPublic(it.modifiers) || Modifier.isProtected(it.modifiers) }
35+
fieldIds += clazz.declaredFields.filterNot { Modifier.isPrivate(it.modifiers) }
3536
}
3637

3738

0 commit comments

Comments
 (0)