private @Nullable <E extends JpsElement> Element loadComponentData(@NotNull JpsElementExtensionSerializerBase<E> serializer, @NotNull Path configFile) {
    String componentName = serializer.getComponentName();
    Element component = loadComponent(configFile, componentName);
    if (!(serializer instanceof JpsProjectExtensionWithExternalDataSerializer) || myExternalConfigurationDirectory == null) {
      return component;
    }
    JpsProjectExtensionWithExternalDataSerializer externalDataSerializer = (JpsProjectExtensionWithExternalDataSerializer)serializer;
    Path externalConfigFile = myExternalConfigurationDirectory.resolve(externalDataSerializer.getExternalConfigFilePath());
    if (!Files.exists(externalConfigFile)) {
      return component;
    }
    
    Element externalData = null;
    String externalComponentName = externalDataSerializer.getExternalComponentName();
    for (Element child : JDOMUtil.getChildren(loadRootElement(externalConfigFile))) {
      // be ready to handle both original name and prefixed
      if (child.getName().equals(externalComponentName) || JDomSerializationUtil.isComponent(externalComponentName, child) ||
          child.getName().equals(componentName) || JDomSerializationUtil.isComponent(componentName, child)) {
        externalData = child;
        break;
      }
    }
    if (externalData == null) {
      return component;
    }
    if (component == null) {
      return externalData;
    }
    externalDataSerializer.mergeExternalData(component, externalData);
    return component;
  }
private @Nullable <E extends JpsElement> Element loadComponentData(@NotNull JpsElementExtensionSerializerBase<E> serializer, @NotNull Path configFile)