File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
utbot-framework/src/main/kotlin/org/utbot/framework/assemble Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -100,8 +100,7 @@ class AssembleModelGenerator(private val packageName: String) {
100
100
* Note: Two identity equal [UtModel]s are represented by one instance model.
101
101
*/
102
102
fun createAssembleModels (models : List <UtModel >): IdentityHashMap <UtModel , UtModel > {
103
- val allModelsAreLocatedInPackage = models.all { it.classId.packageName.startsWith(packageName)}
104
- if (! UtSettings .useAssembleModelGenerator || ! allModelsAreLocatedInPackage) {
103
+ if (! UtSettings .useAssembleModelGenerator) {
105
104
return IdentityHashMap <UtModel , UtModel >().apply { models.forEach { put(it, it) } }
106
105
}
107
106
@@ -172,7 +171,13 @@ class AssembleModelGenerator(private val packageName: String) {
172
171
private fun assembleModel (utModel : UtModel ): UtModel {
173
172
val collectedCallChain = callChain.toMutableList()
174
173
175
- // we cannot create an assemble model for an anonymous class instance
174
+ // We cannot create an assemble model for a class located out of
175
+ // the package that generator is instantiated for
176
+ if (utModel.classId.packageName.startsWith(packageName)) {
177
+ return utModel
178
+ }
179
+
180
+ // We cannot create an assemble model for an anonymous class instance
176
181
if (utModel.classId.isAnonymous) {
177
182
return utModel
178
183
}
You can’t perform that action at this time.
0 commit comments