File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1461,6 +1461,7 @@ class SpringApplicationContext(
1461
1461
}
1462
1462
1463
1463
private var areInjectedClassesInitialized : Boolean = false
1464
+ private var areAllInjectedTypesInitialized: Boolean = false
1464
1465
1465
1466
// Classes representing concrete types that are actually used in Spring application
1466
1467
private val springInjectedClasses: Set <ClassId >
@@ -1493,9 +1494,18 @@ class SpringApplicationContext(
1493
1494
return springInjectedClassesStorage
1494
1495
}
1495
1496
1496
- private val allInjectedTypes: Set <ClassId > by lazy {
1497
- springInjectedClasses.flatMap { it.allSuperTypes() }.toSet()
1498
- }
1497
+ private val allInjectedTypes: Set <ClassId >
1498
+ get() {
1499
+ if (! areAllInjectedTypesInitialized) {
1500
+ allInjectedTypesStorage = springInjectedClasses.flatMap { it.allSuperTypes() }.toSet()
1501
+ areAllInjectedTypesInitialized = true
1502
+ }
1503
+
1504
+ return allInjectedTypesStorage
1505
+ }
1506
+
1507
+ // imitates `by lazy` (we can't use actual `by lazy` because communication via RD breaks it)
1508
+ private var allInjectedTypesStorage: Set <ClassId > = emptySet()
1499
1509
1500
1510
// This is a service field to model the lazy behavior of [springInjectedClasses].
1501
1511
// Do not call it outside the getter.
You can’t perform that action at this time.
0 commit comments