File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -1276,10 +1276,19 @@ class SpringApplicationContext(
12761276 private val springInjectedClasses: Set <ClassId >
12771277 get() {
12781278 if (! areInjectedClassesInitialized) {
1279- springInjectedClassesStorage + = beanQualifiedNames
1280- .map { fqn -> utContext.classLoader.loadClass(fqn) }
1281- .filterNot { it.isAbstract || it.isInterface || it.isLocalClass || it.isMemberClass && ! it.isStatic }
1282- .mapTo(mutableSetOf ()) { it.id }
1279+ for (beanFqn in beanQualifiedNames) {
1280+ try {
1281+ val beanClass = utContext.classLoader.loadClass(beanFqn)
1282+ if (! beanClass.isAbstract && ! beanClass.isInterface &&
1283+ ! beanClass.isLocalClass && (! beanClass.isMemberClass || beanClass.isStatic)) {
1284+ springInjectedClassesStorage + = beanClass.id
1285+ }
1286+ } catch (e: ClassNotFoundException ) {
1287+ // For some Spring beans (e.g. with anonymous classes)
1288+ // it is possible to have problems with classes loading.
1289+ continue
1290+ }
1291+ }
12831292
12841293 // This is done to be sure that this storage is not empty after the first class loading iteration.
12851294 // So, even if all loaded classes were filtered out, we will not try to load them again.
You can’t perform that action at this time.
0 commit comments