@Nullable
  default T tryLoadProfileByNameOrPath(@Nullable String profileName, @Nullable String profilePath,
                                       @NotNull String configSource, @NotNull Consumer<@NotNull String> onFailure) {
    //fetch profile by name from project file (project profiles can be disabled)
    if (profileName != null && !profileName.isEmpty()) {
      T inspectionProfile = loadProfileByName(profileName);
      if (inspectionProfile == null) {
        onFailure.accept(InspectionsBundle.message("inspection.application.profile.was.not.found.by.name.0.1", profileName, configSource));
      }
      return inspectionProfile;
    }

    if (profilePath != null && !profilePath.isEmpty()) {
      T inspectionProfile = loadProfileByPath(profilePath);
      if (inspectionProfile == null) {
        onFailure.accept(InspectionsBundle.message("inspection.application.profile.failed.configure.by.path.0.1", profilePath, configSource));
      }
      return inspectionProfile;
    }
    return null;
  }
@Nullable
  default T tryLoadProfileByNameOrPath(@Nullable String profileName, @Nullable String profilePath,
                                       @NotNull String configSource, @NotNull Consumer<@NotNull String> onFailure)