Program: 39866
Project: 39866
Buggy source:
private void processParent(ParentType type,String result,String urlOrMsg){
  removeParent();
switch (type) {
case GROUP:
    container.setPadding(new Insets(0));
  try {
    XmlV xmlV=new XmlMapper().readValue(result,XmlV.class);
    if (!xmlV.isCssEmpty()) {
      File cssFile=Res.getTempFile(directory,"String_Node_Str");
      BufferedWriter fos=new BufferedWriter(new FileWriter(cssFile));
      fos.write(xmlV.getCss().getCss());
      fos.flush();
      fos.close();
      container.getStylesheets().clear();
      container.getStylesheets().add(cssFile.toURI().toString());
    }
    Map<String,String> resources=super.parsePreloadString(xmlV.generateResources());
    Group group=new Group();
    ProgressBar progressBar=new ProgressBar();
    Label label=new Label("String_Node_Str");
    progressBar.prefWidthProperty().bind(container.widthProperty().multiply(0.8));
    label.layoutYProperty().bind(progressBar.layoutYProperty().add(progressBar.heightProperty()));
    label.layoutXProperty().bind(progressBar.layoutXProperty().add(progressBar.widthProperty()).subtract(label.widthProperty()));
    group.getChildren().addAll(progressBar,label);
    parent=group;
    loadingTask=new Task(){
      @Override protected Object call() throws Exception {
        Platform.runLater(() -> progressBar.setProgress(0));
        for (int i=0; i < downloadList.size(); i++) {
          String url=downloadList.get(i);
          Res.downLoadFromUrl(url,Res.getDefaultDirectory(),url.replaceFirst("String_Node_Str","String_Node_Str"),label.textProperty());
          double progress=i + 1;
          Platform.runLater(() -> progressBar.setProgress(progress / downloadList.size() * 0.5));
        }
        Platform.runLater(() -> progressBar.setProgress(0.5));
        for (        String key : resources.keySet()) {
          String value=resources.get(key);
          String filename=value.replaceFirst("String_Node_Str","String_Node_Str");
          String uri=Paths.get(Res.getDefaultDirectory() + File.separator + filename).toUri().toString();
          if (resources.get(key).endsWith("String_Node_Str") || resources.get(key).endsWith("String_Node_Str")) {
            preload.put(key,new Media(uri));
          }
 else           if (resources.get(key).endsWith("String_Node_Str")) {
            preload.put(key,new AudioClip(uri));
          }
 else {
            preload.put(key,new Image(uri));
          }
          Platform.runLater(() -> progressBar.setProgress(((double)preload.size()) / resources.size() * 0.5 + 0.5));
        }
        return null;
      }
    }
;
    loadingTask.setOnSucceeded(value -> {
      if (xmlV.getScripts() != null && xmlV.getScripts().length > 0) {
        String script=xmlV.getScripts()[0].getType();
        script=script == null ? "String_Node_Str" : script;
        scriptEngine=Main.scriptEngineManager.getEngineByName(script);
      }
      try {
        parent=xmlV.generateNode(this).getNode();
        if (xmlV.getClasses() != null && xmlV.getClasses().length > 0) {
          for (          Class clazz : xmlV.getClasses()) {
            URL url=new URL(clazz.getUrl());
            URLClassLoader urlClassLoader=new URLClassLoader(new URL[]{url});
            java.lang.Class<?> targetClass=urlClassLoader.loadClass(clazz.getName());
            Object object=targetClass.getDeclaredConstructor().newInstance();
            Object returnValue=targetClass.getDeclaredMethod(clazz.getFunction(),null).invoke(object);
            System.out.println(returnValue);
          }
        }
        if (xmlV.getScripts() != null && xmlV.getScripts().length > 0) {
          for (          Script script : xmlV.getScripts()) {
            scriptEngine.put("String_Node_Str",this);
            scriptEngine.put("String_Node_Str",preload);
            scriptEngine.eval(script.getScript());
          }
        }
        container.getChildren().clear();
        container.getChildren().add(0,parent);
        container.requestFocus();
      }
 catch (      Exception e) {
        handleExceptionMessage(e);
      }
    }
);
    Thread thread=new Thread(loadingTask);
    thread.setDaemon(true);
    thread.start();
  }
 catch (  Throwable e) {
    handleExceptionMessage(e,result);
    return;
  }
break;
case ERROR_MESSAGE:
TextArea errorMsg=new TextArea();
errorMsg.setPrefHeight(container.getHeight() - 20);
errorMsg.setText(result + "String_Node_Str" + urlOrMsg);
container.setPadding(new Insets(10));
parent=errorMsg;
tab.textProperty().unbind();
tab.setText(urlOrMsg);
break;
default :
container.setPadding(new Insets(0));
if (webView == null) {
webView=new WebView();
}
webView.getEngine().loadContent(result);
tab.textProperty().unbind();
tab.textProperty().bind(webView.getEngine().titleProperty());
webView.getEngine().load(urlOrMsg);
parent=webView;
break;
}
urlInput.setText(urlOrMsg);
container.getChildren().add(0,parent);
container.requestFocus();
}

Fixed version (ground truth):
private void processParent(ParentType type,String result,String urlOrMsg){
  removeParent();
switch (type) {
case GROUP:
    container.setPadding(new Insets(0));
  try {
    XmlV xmlV=new XmlMapper().readValue(result,XmlV.class);
    if (!xmlV.isCssEmpty()) {
      File cssFile=Res.getTempFile(directory,"String_Node_Str");
      BufferedWriter fos=new BufferedWriter(new FileWriter(cssFile));
      fos.write(xmlV.getCss().getCss());
      fos.flush();
      fos.close();
      container.getStylesheets().clear();
      container.getStylesheets().add(cssFile.toURI().toString());
    }
    Map<String,String> resources=super.parsePreloadString(xmlV.generateResources());
    Group group=new Group();
    ProgressBar progressBar=new ProgressBar();
    Label label=new Label("String_Node_Str");
    progressBar.prefWidthProperty().bind(container.widthProperty().multiply(0.8));
    label.layoutYProperty().bind(progressBar.layoutYProperty().add(progressBar.heightProperty()));
    label.layoutXProperty().bind(progressBar.layoutXProperty().add(progressBar.widthProperty()).subtract(label.widthProperty()));
    group.getChildren().addAll(progressBar,label);
    parent=group;
    loadingTask=new Task(){
      @Override protected Object call() throws Exception {
        Platform.runLater(() -> progressBar.setProgress(0));
        for (int i=0; i < downloadList.size(); i++) {
          String url=downloadList.get(i);
          Res.downLoadFromUrl(url,Res.getDefaultDirectory(),url.replaceFirst("String_Node_Str","String_Node_Str"),label.textProperty());
          double progress=i + 1;
          Platform.runLater(() -> progressBar.setProgress(progress / downloadList.size() * 0.5));
        }
        Platform.runLater(() -> progressBar.setProgress(0.5));
        for (        String key : resources.keySet()) {
          String value=resources.get(key);
          String filename=value.replaceFirst("String_Node_Str","String_Node_Str");
          String uri=Paths.get(Res.getDefaultDirectory() + File.separator + filename).toUri().toString();
          if (resources.get(key).endsWith("String_Node_Str") || resources.get(key).endsWith("String_Node_Str")) {
            preload.put(key,new Media(uri));
          }
 else           if (resources.get(key).endsWith("String_Node_Str")) {
            preload.put(key,new AudioClip(uri));
          }
 else {
            preload.put(key,new Image(uri));
          }
          Platform.runLater(() -> progressBar.setProgress(((double)preload.size()) / resources.size() * 0.5 + 0.5));
        }
        return null;
      }
    }
;
    loadingTask.setOnSucceeded(value -> {
      try {
        context.clear();
        parent=xmlV.generateNode(this).getNode();
        if (xmlV.getClasses() != null && xmlV.getClasses().length > 0) {
          for (          Class clazz : xmlV.getClasses()) {
            URL url=new URL(clazz.getUrl());
            URLClassLoader urlClassLoader=new URLClassLoader(new URL[]{url});
            java.lang.Class<?> targetClass=urlClassLoader.loadClass(clazz.getName());
            Object object=targetClass.getDeclaredConstructor().newInstance();
            Object returnValue=targetClass.getDeclaredMethod(clazz.getFunction(),null).invoke(object);
            System.out.println(returnValue);
          }
        }
        if (xmlV.getScripts() != null && xmlV.getScripts().length > 0) {
          for (          Script script : xmlV.getScripts()) {
            String scriptType=script.getType();
            scriptType=scriptType == null ? "String_Node_Str" : scriptType;
            scriptEngine=Main.scriptEngineManager.getEngineByName(scriptType);
            for (            String id : context.keySet()) {
              scriptEngine.put(id,context.get(id));
            }
            scriptEngine.put("String_Node_Str",this);
            scriptEngine.put("String_Node_Str",preload);
            scriptEngine.eval(script.getScript());
          }
        }
        container.getChildren().clear();
        container.getChildren().add(0,parent);
        container.requestFocus();
      }
 catch (      Exception e) {
        handleExceptionMessage(e);
      }
    }
);
    Thread thread=new Thread(loadingTask);
    thread.setDaemon(true);
    thread.start();
  }
 catch (  Throwable e) {
    handleExceptionMessage(e,result);
    return;
  }
break;
case ERROR_MESSAGE:
TextArea errorMsg=new TextArea();
errorMsg.setPrefHeight(container.getHeight() - 20);
errorMsg.setText(result + "String_Node_Str" + urlOrMsg);
container.setPadding(new Insets(10));
parent=errorMsg;
tab.textProperty().unbind();
tab.setText(urlOrMsg);
break;
default :
container.setPadding(new Insets(0));
if (webView == null) {
webView=new WebView();
}
webView.getEngine().loadContent(result);
tab.textProperty().unbind();
tab.textProperty().bind(webView.getEngine().titleProperty());
webView.getEngine().load(urlOrMsg);
parent=webView;
break;
}
urlInput.setText(urlOrMsg);
container.getChildren().add(0,parent);
container.requestFocus();
}