Source:
<code>public void resolveComponentTypes() { componentBuildingDefinitionRegistry.ifPresent(buildingDefinitionRegistry -> { executeOnEveryComponentTree(componentModel -> { Optional<ComponentBuildingDefinition<?>> buildingDefinition = buildingDefinitionRegistry.getBuildingDefinition(componentModel.getIdentifier()); buildingDefinition.map(definition -> { ObjectTypeVisitor typeDefinitionVisitor = new ObjectTypeVisitor(componentModel); definition.getTypeDefinition().visit(typeDefinitionVisitor); componentModel.setType(typeDefinitionVisitor.getType()); return definition; }).orElseGet(() -> { String classParameter = componentModel.getRawParameters().get(CLASS_ATTRIBUTE); if (classParameter != null) { try { componentModel.setType(ClassUtils.loadClass(classParameter, currentThread().getContextClassLoader())); } catch (ClassNotFoundException e) { throw new RuntimeConfigurationException(createStaticMessage(e.getMessage()), e); } } return null; }); }); }); ReflectionCache reflectionCache = new ReflectionCache(); Map<ComponentIdentifier, MetadataTypeModelAdapter> registry = new HashMap(); extensionModelHelper.getExtensionsModels().stream().forEach(extensionModel -> extensionModel.getTypes().stream() <START> .filter(p -> IntrospectionUtils.isInstantiable(p, reflectionCache)) <END> .forEach(parameterType -> { registerTopLevelParameter(parameterType, reflectionCache, registry, extensionModel); })); executeOnEveryComponentTree(componentModel -> { if (registry.containsKey(componentModel.getIdentifier())) { componentModel.setMetadataTypeModelAdapter(registry.get(componentModel.getIdentifier())); } }); }</code><technical_language>static import</technical_language>

Target:
public void resolveComponentTypes() { componentBuildingDefinitionRegistry.ifPresent(buildingDefinitionRegistry -> { executeOnEveryComponentTree(componentModel -> { Optional<ComponentBuildingDefinition<?>> buildingDefinition = buildingDefinitionRegistry.getBuildingDefinition(componentModel.getIdentifier()); buildingDefinition.map(definition -> { ObjectTypeVisitor typeDefinitionVisitor = new ObjectTypeVisitor(componentModel); definition.getTypeDefinition().visit(typeDefinitionVisitor); componentModel.setType(typeDefinitionVisitor.getType()); return definition; }).orElseGet(() -> { String classParameter = componentModel.getRawParameters().get(CLASS_ATTRIBUTE); if (classParameter != null) { try { componentModel.setType(ClassUtils.loadClass(classParameter, currentThread().getContextClassLoader())); } catch (ClassNotFoundException e) { throw new RuntimeConfigurationException(createStaticMessage(e.getMessage()), e); } } return null; }); }); }); ReflectionCache reflectionCache = new ReflectionCache(); Map<ComponentIdentifier, MetadataTypeModelAdapter> registry = new HashMap(); extensionModelHelper.getExtensionsModels().stream().forEach(extensionModel -> extensionModel.getTypes().stream() .filter(p -> isInstantiable(p, reflectionCache)) .forEach(parameterType -> registerTopLevelParameter(parameterType, reflectionCache, registry, extensionModel))); executeOnEveryComponentTree(componentModel -> { if (registry.containsKey(componentModel.getIdentifier())) { componentModel.setMetadataTypeModelAdapter(registry.get(componentModel.getIdentifier())); } }); }