File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
utbot-framework/src/main/kotlin/org/utbot/engine Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -203,12 +203,18 @@ class Mocker(
203
203
return false
204
204
}
205
205
206
+ val sootField = sootDeclaringClass.getFieldByName(mockInfo.fieldId.name)
207
+ val sootFieldType = sootField.type
208
+
206
209
return when {
207
- declaringClass .packageName.startsWith(" java.lang" ) -> false
208
- ! mockInfo.fieldId.type.isRefType -> false // mocks are allowed for ref fields only
209
- else -> return strategy.eligibleToMock(mockInfo.fieldId.type , classUnderTest) // if we have a field with Integer type, we should not mock it
210
+ sootDeclaringClass .packageName.startsWith(" java.lang" ) -> false
211
+ sootFieldType !is RefType -> false // mocks are allowed for ref fields only
212
+ else -> strategy.eligibleToMock(sootFieldType.id , classUnderTest) // if we have a field with Integer type, we should not mock it
210
213
}
211
214
}
215
+
216
+ // Note that eligibleToMock can use information retrieved from jClass
217
+ // Therefore, such classes should be already processed at this point
212
218
return strategy.eligibleToMock(type.id, classUnderTest) // strategy to decide
213
219
}
214
220
You can’t perform that action at this time.
0 commit comments