Program: 69228
Project: 69228
Buggy source:
private Flux<String> selectApplications(Target configTarget,Mono<String> orgIdMono,Mono<String> spaceIdMono){
  Flux<String> applicationsInSelection=null;
  if (configTarget.getApplicationRegex() == null && configTarget.getApplicationName() != null) {
    throw new InternalError("String_Node_Str");
  }
 else {
    Mono<ListApplicationsResponse> responseMono=Mono.zip(orgIdMono,spaceIdMono).flatMap(tuple -> this.cfAccessor.retrieveAllApplicationIdsInSpace(tuple.getT1(),tuple.getT2()));
    applicationsInSelection=responseMono.map(r -> {
      List<ApplicationResource> resources=r.getResources();
      if (resources == null) {
        log.error(String.format("String_Node_Str",configTarget.getOrgName(),configTarget.getSpaceName()));
        throw Exceptions.propagate(new InvalidResponseFromCFCloudConnector("String_Node_Str"));
      }
      return resources;
    }
).flatMapMany(resources -> {
      List<String> appNames=new LinkedList<>();
      for (      ApplicationResource ar : resources) {
        if (!isApplicationInScrapableState(ar.getEntity().getState())) {
          continue;
        }
        appNames.add(ar.getEntity().getName());
      }
      return Flux.fromIterable(appNames);
    }
).onErrorResume(__ -> Flux.empty());
  }
  Flux<String> filteredApplicationsInSpace=applicationsInSelection;
  if (configTarget.getApplicationRegex() != null) {
    final Pattern filterPattern=Pattern.compile(configTarget.getApplicationRegex());
    filteredApplicationsInSpace=applicationsInSelection.filter(appName -> {
      Matcher m=filterPattern.matcher(appName);
      return m.matches();
    }
);
  }
  return filteredApplicationsInSpace;
}

Fixed version (ground truth):
private Flux<String> selectApplications(Target configTarget,Mono<String> orgIdMono,Mono<String> spaceIdMono){
  Flux<String> applicationsInSelection=null;
  if (configTarget.getApplicationRegex() == null && configTarget.getApplicationName() != null) {
    throw new InternalError("String_Node_Str");
  }
 else {
    Mono<ListApplicationsResponse> responseMono=Mono.zip(orgIdMono,spaceIdMono).flatMap(tuple -> {
      return this.cfAccessor.retrieveAllApplicationIdsInSpace(tuple.getT1(),tuple.getT2());
    }
);
    applicationsInSelection=responseMono.map(r -> {
      List<ApplicationResource> resources=r.getResources();
      if (resources == null) {
        log.error(String.format("String_Node_Str",configTarget.getOrgName(),configTarget.getSpaceName()));
        throw Exceptions.propagate(new InvalidResponseFromCFCloudConnector("String_Node_Str"));
      }
      return resources;
    }
).flatMapMany(resources -> {
      List<String> appNames=new LinkedList<>();
      for (      ApplicationResource ar : resources) {
        if (!isApplicationInScrapableState(ar.getEntity().getState())) {
          continue;
        }
        appNames.add(ar.getEntity().getName());
      }
      return Flux.fromIterable(appNames);
    }
);
  }
  Flux<String> filteredApplicationsInSpace=applicationsInSelection;
  if (configTarget.getApplicationRegex() != null) {
    final Pattern filterPattern=Pattern.compile(configTarget.getApplicationRegex());
    filteredApplicationsInSpace=applicationsInSelection.filter(appName -> {
      Matcher m=filterPattern.matcher(appName);
      return m.matches();
    }
);
  }
  return filteredApplicationsInSpace;
}