Program: 145383
Project: 145383
Buggy source:
private void validate(final String aDatasourceName,final List<Change> aLog,Consumer<Void> onSuccess,Consumer<Exception> onFailure,Scripts.Space aSpace){
  List<CallPoint> toBeCalled=new ArrayList<>();
  validators.keySet().stream().forEach((validatorName) -> {
    Collection<String> datasourcesUnderControl=validators.get(validatorName);
    if (((datasourcesUnderControl == null || datasourcesUnderControl.isEmpty()) && aDatasourceName == null) || (datasourcesUnderControl != null && datasourcesUnderControl.contains(aDatasourceName))) {
      try {
        JSObject module=createModule(validatorName,aSpace);
        if (module != null) {
          Object oValidate=module.getMember("String_Node_Str");
          if (oValidate instanceof JSObject) {
            JSObject validateFunction=(JSObject)oValidate;
            toBeCalled.add(new CallPoint(module,validateFunction));
          }
 else {
            Logger.getLogger(ScriptedDatabasesClient.class.getName()).log(Level.WARNING,"String_Node_Str",validatorName);
          }
        }
 else {
          Logger.getLogger(ScriptedDatabasesClient.class.getName()).log(Level.WARNING,"String_Node_Str",validatorName);
        }
      }
 catch (      Exception ex) {
        Logger.getLogger(ScriptedDatabasesClient.class.getName()).log(Level.SEVERE,null,ex);
      }
    }
  }
);
  if (onSuccess != null) {
    if (toBeCalled.isEmpty()) {
      onSuccess.accept(null);
    }
 else {
      ValidateProcess process=new ValidateProcess(toBeCalled.size(),onSuccess,onFailure);
      toBeCalled.stream().forEach((v) -> {
        v.function.call(v.module,new Object[]{aSpace.toJs(aLog.toArray()),aDatasourceName,new AbstractJSObject(){
          @Override public Object call(          final Object thiz,          final Object... args){
            process.complete(null);
            return null;
          }
        }
,new AbstractJSObject(){
          @Override public Object call(          final Object thiz,          final Object... args){
            if (args.length > 0) {
              if (args[0] instanceof Exception) {
                process.complete((Exception)args[0]);
              }
 else {
                process.complete(new Exception(String.valueOf(aSpace.toJava(args[0]))));
              }
            }
 else {
              process.complete(new Exception("String_Node_Str"));
            }
            return null;
          }
        }
});
      }
);
    }
  }
 else {
    toBeCalled.stream().forEach((v) -> {
      v.function.call(v.module,new Object[]{aSpace.toJs(aLog.toArray()),aDatasourceName});
    }
);
  }
}

Fixed version (ground truth):
private void validate(final String aDatasourceName,final List<Change> aLog,Consumer<Void> onSuccess,Consumer<Exception> onFailure,Scripts.Space aSpace){
  List<CallPoint> toBeCalled=new ArrayList<>();
  validators.keySet().stream().forEach((validatorName) -> {
    Collection<String> datasourcesUnderControl=validators.get(validatorName);
    if (((datasourcesUnderControl == null || datasourcesUnderControl.isEmpty()) && aDatasourceName == null) || (datasourcesUnderControl != null && datasourcesUnderControl.contains(aDatasourceName))) {
      try {
        JSObject module=createModule(validatorName,aSpace);
        if (module != null) {
          Object oValidate=module.getMember("String_Node_Str");
          if (oValidate instanceof JSObject) {
            JSObject validateFunction=(JSObject)oValidate;
            toBeCalled.add(new CallPoint(module,validateFunction));
          }
 else {
            Logger.getLogger(ScriptedDatabasesClient.class.getName()).log(Level.WARNING,"String_Node_Str",validatorName);
          }
        }
 else {
          Logger.getLogger(ScriptedDatabasesClient.class.getName()).log(Level.WARNING,"String_Node_Str",validatorName);
        }
      }
 catch (      Exception ex) {
        Logger.getLogger(ScriptedDatabasesClient.class.getName()).log(Level.SEVERE,null,ex);
      }
    }
  }
);
  if (onSuccess != null) {
    if (toBeCalled.isEmpty()) {
      onSuccess.accept(null);
    }
 else {
      ValidateProcess process=new ValidateProcess(toBeCalled.size(),onSuccess,onFailure);
      toBeCalled.stream().forEach((v) -> {
        try {
          v.function.call(v.module,new Object[]{aSpace.toJs(aLog.toArray()),aDatasourceName,new AbstractJSObject(){
            @Override public Object call(            final Object thiz,            final Object... args){
              process.complete(null);
              return null;
            }
          }
,new AbstractJSObject(){
            @Override public Object call(            final Object thiz,            final Object... args){
              if (args.length > 0) {
                if (args[0] instanceof Exception) {
                  process.complete((Exception)args[0]);
                }
 else {
                  process.complete(new Exception(String.valueOf(aSpace.toJava(args[0]))));
                }
              }
 else {
                process.complete(new Exception("String_Node_Str"));
              }
              return null;
            }
          }
});
        }
 catch (        ECMAException ex) {
          process.complete(ex);
        }
      }
);
    }
  }
 else {
    toBeCalled.stream().forEach((v) -> {
      v.function.call(v.module,new Object[]{aSpace.toJs(aLog.toArray()),aDatasourceName});
    }
);
  }
}