nus-yam/ex-repair huggingface dataset:
Program: 62391
Project: 62391
Buggy source:
public void newDoc(String content){
  WebView webView=webviewService.createWebView();
  WebEngine webEngine=webView.getEngine();
  webEngine.setConfirmHandler(param -> {
    if ("String_Node_Str".equals(param)) {
      JSObject window=(JSObject)webEngine.executeScript("String_Node_Str");
      window.setMember("String_Node_Str",controller);
      window.call("String_Node_Str",new Object[]{});
      Map<String,String> shortCuts=controller.getShortCuts();
      Set<String> keySet=shortCuts.keySet();
      for (      String key : keySet) {
        window.call("String_Node_Str",new Object[]{key,shortCuts.get(key)});
      }
      if (Objects.isNull(content))       return true;
      window.call("String_Node_Str",new Object[]{content});
      window.call("String_Node_Str");
    }
    return false;
  }
);
  AnchorPane anchorPane=new AnchorPane();
  MyTab tab=tabService.createTab();
  Node editorVBox=editorService.createEditorVBox(webView,tab);
  controller.fitToParent(editorVBox);
  anchorPane.getChildren().add(editorVBox);
  tab.setWebView(webView);
  tab.setContent(anchorPane);
  tab.setTabText("String_Node_Str");
  TabPane tabPane=controller.getTabPane();
  tabPane.getTabs().add(tab);
  tab.select();
  webView.requestFocus();
}

Fixed version (ground truth):
public void newDoc(String content){
  WebView webView=webviewService.createWebView();
  WebEngine webEngine=webView.getEngine();
  webEngine.setConfirmHandler(param -> {
    if ("String_Node_Str".equals(param)) {
      JSObject window=(JSObject)webEngine.executeScript("String_Node_Str");
      window.setMember("String_Node_Str",controller);
      window.call("String_Node_Str",new Object[]{});
      Map<String,String> shortCuts=controller.getShortCuts();
      Set<String> keySet=shortCuts.keySet();
      for (      String key : keySet) {
        window.call("String_Node_Str",new Object[]{key,shortCuts.get(key)});
      }
      if (Objects.nonNull(content))       window.call("String_Node_Str",new Object[]{content});
      window.call("String_Node_Str");
    }
    return false;
  }
);
  AnchorPane anchorPane=new AnchorPane();
  MyTab tab=tabService.createTab();
  Node editorVBox=editorService.createEditorVBox(webView,tab);
  controller.fitToParent(editorVBox);
  anchorPane.getChildren().add(editorVBox);
  tab.setWebView(webView);
  tab.setContent(anchorPane);
  tab.setTabText("String_Node_Str");
  TabPane tabPane=controller.getTabPane();
  tabPane.getTabs().add(tab);
  tab.select();
  webView.requestFocus();
}
Program: 62393
Project: 62393
Buggy source:
public void newDoc(String content){
  WebView webView=webviewService.createWebView();
  WebEngine webEngine=webView.getEngine();
  webEngine.setConfirmHandler(param -> {
    if ("String_Node_Str".equals(param)) {
      JSObject window=(JSObject)webEngine.executeScript("String_Node_Str");
      window.setMember("String_Node_Str",controller);
      window.call("String_Node_Str",new Object[]{});
      Map<String,String> shortCuts=controller.getShortCuts();
      Set<String> keySet=shortCuts.keySet();
      for (      String key : keySet) {
        window.call("String_Node_Str",new Object[]{key,shortCuts.get(key)});
      }
      if (Objects.isNull(content))       return true;
      window.call("String_Node_Str",new Object[]{content});
    }
    return false;
  }
);
  AnchorPane anchorPane=new AnchorPane();
  MyTab tab=tabService.createTab();
  Node editorVBox=editorService.createEditorVBox(webView,tab);
  controller.fitToParent(editorVBox);
  anchorPane.getChildren().add(editorVBox);
  tab.setWebView(webView);
  tab.setContent(anchorPane);
  tab.setTabText("String_Node_Str");
  TabPane tabPane=controller.getTabPane();
  tabPane.getTabs().add(tab);
  tab.select();
  webView.requestFocus();
}

Fixed version (ground truth):
public void newDoc(String content){
  WebView webView=webviewService.createWebView();
  WebEngine webEngine=webView.getEngine();
  webEngine.setConfirmHandler(param -> {
    if ("String_Node_Str".equals(param)) {
      JSObject window=(JSObject)webEngine.executeScript("String_Node_Str");
      window.setMember("String_Node_Str",controller);
      window.call("String_Node_Str",new Object[]{});
      Map<String,String> shortCuts=controller.getShortCuts();
      Set<String> keySet=shortCuts.keySet();
      for (      String key : keySet) {
        window.call("String_Node_Str",new Object[]{key,shortCuts.get(key)});
      }
      if (Objects.isNull(content))       return true;
      window.call("String_Node_Str",new Object[]{content});
      window.call("String_Node_Str");
    }
    return false;
  }
);
  AnchorPane anchorPane=new AnchorPane();
  MyTab tab=tabService.createTab();
  Node editorVBox=editorService.createEditorVBox(webView,tab);
  controller.fitToParent(editorVBox);
  anchorPane.getChildren().add(editorVBox);
  tab.setWebView(webView);
  tab.setContent(anchorPane);
  tab.setTabText("String_Node_Str");
  TabPane tabPane=controller.getTabPane();
  tabPane.getTabs().add(tab);
  tab.select();
  webView.requestFocus();
}
Program: 62395
Project: 62395
Buggy source:
@Override public void start(final Stage stage){
  final CmdlineConfig config=new CmdlineConfig();
  final CmdlineParser cp=new CmdlineParser(config);
  try {
    cp.parse(getParameters().getRaw().toArray(new String[0]));
  }
 catch (  final CmdlineParserException e) {
    System.err.println("String_Node_Str" + e.getMessage());
    System.exit(1);
  }
  if (config.help) {
    cp.usage();
    System.exit(0);
  }
  try {
    startApp(stage,config);
  }
 catch (  final Throwable e) {
    logger.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override public void start(final Stage stage){
  System.setProperty("String_Node_Str","String_Node_Str");
  final CmdlineConfig config=new CmdlineConfig();
  final CmdlineParser cp=new CmdlineParser(config);
  try {
    cp.parse(getParameters().getRaw().toArray(new String[0]));
  }
 catch (  final CmdlineParserException e) {
    System.err.println("String_Node_Str" + e.getMessage());
    System.exit(1);
  }
  if (config.help) {
    cp.usage();
    System.exit(0);
  }
  try {
    startApp(stage,config);
  }
 catch (  final Throwable e) {
    logger.error(e.getMessage(),e);
  }
}
Program: 62396
Project: 62396
Buggy source:
private void closeIt(){
  ThreadService.runTaskLater(() -> {
    ThreadService.runActionLater(() -> {
      if (!this.getTabText().equals("String_Node_Str")) {
        closedPaths.add(Optional.ofNullable(this.getPath()));
      }
      this.getTabPane().getTabs().remove(this);
      this.setPath(null);
      this.setOnClosed(null);
      this.setOnSelectionChanged(null);
      this.setUserData(null);
      this.getLabel().setOnMouseClicked(null);
      this.setOnCloseRequest(null);
      this.setWebView(null);
      this.setContent(null);
      this.setLabel(null);
      if (controller.getTabPane().getTabs().isEmpty()) {
        controller.newDoc(null);
      }
    }
);
  }
);
}

Fixed version (ground truth):
private void closeIt(){
  this.getTabPane().getTabs().remove(this);
  ThreadService.runTaskLater(() -> {
    ThreadService.runActionLater(() -> {
      if (!this.getTabText().equals("String_Node_Str")) {
        closedPaths.add(Optional.ofNullable(this.getPath()));
      }
      this.setPath(null);
      this.setOnClosed(null);
      this.setOnSelectionChanged(null);
      this.setUserData(null);
      this.getLabel().setOnMouseClicked(null);
      this.setOnCloseRequest(null);
      this.setWebView(null);
      this.setContent(null);
      this.setLabel(null);
    }
);
  }
);
}
Program: 62397
Project: 62397
Buggy source:
public void saveAndCloseCurrentTab(){
  this.saveDoc();
  tabPane.getTabs().remove(current.currentTab());
  if (this.getTabPane().getTabs().isEmpty()) {
    this.newDoc(null);
  }
}

Fixed version (ground truth):
public void saveAndCloseCurrentTab(){
  this.saveDoc();
  threadService.runActionLater(current.currentTab()::close);
}
Program: 62399
Project: 62399
Buggy source:
private Label getLabel(){
  return (Label)this.getGraphic();
}

Fixed version (ground truth):
public Label getLabel(){
  if (Objects.isNull(this.getGraphic()))   this.setGraphic(new Label());
  return (Label)this.getGraphic();
}
Program: 62400
Project: 62400
Buggy source:
private void closeIt(){
  this.getTabPane().getTabs().remove(this);
  ThreadService.runTaskLater(() -> {
    ThreadService.runActionLater(() -> {
      if (!this.getTabText().equals("String_Node_Str")) {
        closedPaths.add(Optional.ofNullable(this.getPath()));
      }
      this.setPath(null);
      this.setOnClosed(null);
      this.setOnSelectionChanged(null);
      this.setUserData(null);
      this.getLabel().setOnMouseClicked(null);
      this.setOnCloseRequest(null);
      this.setWebView(null);
      this.setContent(null);
      this.setLabel(null);
    }
);
  }
);
}

Fixed version (ground truth):
private void closeIt(){
  this.getTabPane().getTabs().remove(this);
  ThreadService.runTaskLater(() -> {
    ThreadService.runActionLater(() -> {
      if (!this.getTabText().equals("String_Node_Str")) {
        closedPaths.add(Optional.ofNullable(this.getPath()));
      }
      this.setPath(null);
      this.setOnClosed(null);
      this.setOnSelectionChanged(null);
      this.setUserData(null);
      this.getLabel().setOnMouseClicked(null);
      this.setOnCloseRequest(null);
      this.setWebView(null);
      this.setContent(null);
      this.setGraphic(null);
    }
);
  }
);
}
Program: 62402
Project: 62402
Buggy source:
public String appendFormula(String fileName,String formula){
  if (fileName.endsWith("String_Node_Str") || fileName.endsWith("String_Node_Str")) {
    WebEngine engine=controller.getMathjaxView().getEngine();
    engine.executeScript(String.format("String_Node_Str",fileName,formula));
    return "String_Node_Str" + fileName;
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
public String appendFormula(String fileName,String formula){
  if (fileName.endsWith("String_Node_Str") || fileName.endsWith("String_Node_Str")) {
    getWindow().call("String_Node_Str",new Object[]{fileName,formula});
    return "String_Node_Str" + fileName;
  }
  return "String_Node_Str";
}
Program: 62403
Project: 62403
Buggy source:
public void setTabText(String tabText){
  getLabel().setText(tabText);
  updateMarkup();
}

Fixed version (ground truth):
public void setTabText(String tabText){
  Label label=getLabel();
  label.setText(tabText);
  updateMarkup();
}
Program: 62404
Project: 62404
Buggy source:
private void closeIt(){
  this.getTabPane().getTabs().remove(this);
  ThreadService.runTaskLater(() -> {
    ThreadService.runActionLater(() -> {
      if (!this.getTabText().equals("String_Node_Str")) {
        closedPaths.add(Optional.ofNullable(this.getPath()));
      }
      this.setPath(null);
      this.setOnClosed(null);
      this.setOnSelectionChanged(null);
      this.setUserData(null);
      this.getLabel().setOnMouseClicked(null);
      this.setOnCloseRequest(null);
      this.setWebView(null);
      this.setContent(null);
      this.setGraphic(null);
    }
);
  }
);
}

Fixed version (ground truth):
private void closeIt(){
  ThreadService.runTaskLater(() -> {
    ThreadService.runActionLater(() -> {
      if (!this.getTabText().equals("String_Node_Str")) {
        closedPaths.add(Optional.ofNullable(this.getPath()));
      }
      this.getTabPane().getTabs().remove(this);
      this.setPath(null);
      this.setOnClosed(null);
      this.setOnSelectionChanged(null);
      this.setUserData(null);
      this.getLabel().setOnMouseClicked(null);
      this.setOnCloseRequest(null);
      this.setWebView(null);
      this.setContent(null);
    }
);
  }
);
}
Program: 62405
Project: 62405
Buggy source:
public String getTabText(){
  return getLabel().getText();
}

Fixed version (ground truth):
public String getTabText(){
  Label label=getLabel();
  return label.getText();
}
Program: 62406
Project: 62406
Buggy source:
private void closeIt(){
  this.getTabPane().getTabs().remove(this);
  ThreadService.runTaskLater(() -> {
    ThreadService.runActionLater(() -> {
      if (!this.getTabText().equals("String_Node_Str")) {
        closedPaths.add(Optional.ofNullable(this.getPath()));
      }
      this.setPath(null);
      this.setOnClosed(null);
      this.setOnSelectionChanged(null);
      this.setUserData(null);
      this.getLabel().setOnMouseClicked(null);
      this.setOnCloseRequest(null);
      this.setWebView(null);
      this.setContent(null);
    }
);
  }
);
}

Fixed version (ground truth):
private void closeIt(){
  Platform.runLater(() -> {
    this.getTabPane().getTabs().remove(this);
  }
);
}
Program: 62407
Project: 62407
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + path;
}

Fixed version (ground truth):
@Override public String toString(){
  return getTabText();
}
Program: 62409
Project: 62409
Buggy source:
@Override public void close(){
  super.close();
  if (controller.getTabPane().getTabs().isEmpty()) {
    controller.newDoc(null);
  }
}

Fixed version (ground truth):
@Override public void close(){
  if (Objects.nonNull(this.getPath()))   closedPaths.add(Optional.ofNullable(current.currentTab().getPath()));
  super.close();
  cleanRemovedTabs(this);
  Platform.runLater(() -> {
    ObservableList<Tab> tabs=controller.getTabPane().getTabs();
    if (tabs.isEmpty()) {
      controller.newDoc(null);
    }
  }
);
}
Program: 62411
Project: 62411
Buggy source:
public void completeCycle(){
  Platform.runLater(() -> {
    asciiDocController.getIndikator().setManaged(false);
  }
);
}

Fixed version (ground truth):
public void completeCycle(){
  Platform.runLater(() -> {
    asciiDocController.getIndikator().setManaged(false);
    asciiDocController.getIndikator().setVisible(false);
  }
);
}
Program: 62412
Project: 62412
Buggy source:
public void startCycle(){
  Platform.runLater(() -> {
    asciiDocController.getIndikator().setManaged(true);
  }
);
}

Fixed version (ground truth):
public void startCycle(){
  Platform.runLater(() -> {
    asciiDocController.getIndikator().setVisible(true);
    asciiDocController.getIndikator().setManaged(true);
  }
);
}
Program: 62413
Project: 62413
Buggy source:
public Optional<String> toImageBlock(List<File> dropFiles){
  if (!current.currentPath().isPresent())   asciiDocController.saveDoc();
  Path currentPath=current.currentPath().map(Path::getParent).get();
  IOHelper.createDirectories(currentPath.resolve("String_Node_Str"));
  List<Path> paths=dropFiles.stream().map(File::toPath).filter(pathResolver::isImage).collect(Collectors.toList());
  List<String> buffer=new LinkedList<>();
  for (  Path path : paths) {
    Path targetImage=currentPath.resolve("String_Node_Str").resolve(path.getFileName());
    IOHelper.copy(path,targetImage);
    buffer.add(String.format("String_Node_Str",path.getFileName()));
  }
  if (buffer.size() > 0)   return Optional.of(String.join("String_Node_Str",buffer));
  return Optional.empty();
}

Fixed version (ground truth):
public Optional<String> toImageBlock(List<File> dropFiles){
  if (!current.currentPath().isPresent())   asciiDocController.saveDoc();
  Path currentPath=current.currentPath().map(Path::getParent).get();
  IOHelper.createDirectories(currentPath.resolve("String_Node_Str"));
  List<Path> paths=dropFiles.stream().map(File::toPath).filter(pathResolver::isImage).collect(Collectors.toList());
  List<String> buffer=new LinkedList<>();
  for (  Path path : paths) {
    Path targetImage=currentPath.resolve("String_Node_Str").resolve(path.getFileName());
    if (!path.equals(targetImage))     IOHelper.copy(path,targetImage);
    buffer.add(String.format("String_Node_Str",path.getFileName()));
  }
  if (buffer.size() > 0)   return Optional.of(String.join("String_Node_Str",buffer));
  return Optional.empty();
}
Program: 62414
Project: 62414
Buggy source:
public Optional<String> toIncludeBlock(List<File> dropFiles){
  if (!current.currentPath().isPresent())   asciiDocController.saveDoc();
  Path currentPath=current.currentPath().map(Path::getParent).get();
  List<Path> files=dropFiles.stream().map(File::toPath).filter(pathResolver::isAsciidoc).collect(Collectors.toList());
  List<String> buffer=new LinkedList<>();
  for (  Path path : files) {
    IOHelper.copy(path,currentPath.resolve(path.getFileName()));
    buffer.add(String.format("String_Node_Str",path.getFileName()));
  }
  if (buffer.size() > 0)   return Optional.of(String.join("String_Node_Str",buffer));
  return Optional.empty();
}

Fixed version (ground truth):
public Optional<String> toIncludeBlock(List<File> dropFiles){
  if (!current.currentPath().isPresent())   asciiDocController.saveDoc();
  Path currentPath=current.currentPath().map(Path::getParent).get();
  List<Path> files=dropFiles.stream().map(File::toPath).filter(pathResolver::isAsciidoc).collect(Collectors.toList());
  List<String> buffer=new LinkedList<>();
  for (  Path path : files) {
    Path targetPath=currentPath.resolve(path.getFileName());
    if (!path.equals(targetPath))     IOHelper.copy(path,targetPath);
    buffer.add(String.format("String_Node_Str",path.getFileName()));
  }
  if (buffer.size() > 0)   return Optional.of(String.join("String_Node_Str",buffer));
  return Optional.empty();
}
Program: 62417
Project: 62417
Buggy source:
public void addTab(Path path){
  ObservableList<String> recentFiles=controller.getRecentFiles();
  if (Files.notExists(path)) {
    recentFiles.remove(path.toString());
    return;
  }
  AnchorPane anchorPane=new AnchorPane();
  WebView webView=webviewService.createWebView();
  WebEngine webEngine=webView.getEngine();
  webEngine.getLoadWorker().stateProperty().addListener((observableValue1,state,state2) -> {
    if (state2 == Worker.State.SUCCEEDED) {
      threadService.runTaskLater(() -> {
        String normalize=IOHelper.normalize(IOHelper.readFile(path));
        threadService.runActionLater(() -> {
          webEngine.executeScript(String.format("String_Node_Str",normalize));
        }
);
      }
);
    }
  }
);
  Node editorVBox=editorService.createEditorVBox(webView);
  controller.fitToParent(editorVBox);
  anchorPane.getChildren().add(editorVBox);
  MyTab tab=createTab();
  ((Label)tab.getGraphic()).setText(path.getFileName().toString());
  tab.setContent(anchorPane);
  tab.setPath(path);
  tab.setWebView(webView);
  TabPane tabPane=controller.getTabPane();
  tabPane.getTabs().add(tab);
  Tooltip tip=new Tooltip(path.toString());
  Tooltip.install(tab.getGraphic(),tip);
  Tab lastTab=tabPane.getTabs().get(tabPane.getTabs().size() - 1);
  tabPane.getSelectionModel().select(lastTab);
  recentFiles.remove(path.toString());
  recentFiles.add(0,path.toString());
  webView.requestFocus();
}

Fixed version (ground truth):
public void addTab(Path path){
  ObservableList<String> recentFiles=controller.getRecentFiles();
  if (Files.notExists(path)) {
    recentFiles.remove(path.toString());
    return;
  }
  AnchorPane anchorPane=new AnchorPane();
  WebView webView=webviewService.createWebView();
  WebEngine webEngine=webView.getEngine();
  webEngine.getLoadWorker().stateProperty().addListener((observableValue1,state,state2) -> {
    if (state2 == Worker.State.SUCCEEDED) {
      threadService.runTaskLater(() -> {
        String normalize=IOHelper.normalize(IOHelper.readFile(path));
        threadService.runActionLater(new Runnable(){
          @Override public void run(){
            try {
              webEngine.executeScript(String.format("String_Node_Str",normalize));
            }
 catch (            Exception e) {
              threadService.runActionLater(this);
            }
          }
        }
);
      }
);
    }
  }
);
  Node editorVBox=editorService.createEditorVBox(webView);
  controller.fitToParent(editorVBox);
  anchorPane.getChildren().add(editorVBox);
  MyTab tab=createTab();
  ((Label)tab.getGraphic()).setText(path.getFileName().toString());
  tab.setContent(anchorPane);
  tab.setPath(path);
  tab.setWebView(webView);
  TabPane tabPane=controller.getTabPane();
  tabPane.getTabs().add(tab);
  Tooltip tip=new Tooltip(path.toString());
  Tooltip.install(tab.getGraphic(),tip);
  Tab lastTab=tabPane.getTabs().get(tabPane.getTabs().size() - 1);
  tabPane.getSelectionModel().select(lastTab);
  recentFiles.remove(path.toString());
  recentFiles.add(0,path.toString());
  webView.requestFocus();
}
Program: 62420
Project: 62420
Buggy source:
public void keepClosedTab(Tab closedTab){
  MyTab tab=(MyTab)closedTab;
  Label closedTabLabel=(Label)closedTab.getGraphic();
  if (!closedTabLabel.getText().equals("String_Node_Str")) {
    closedPaths.add(Optional.ofNullable(tab.getPath()));
  }
  threadService.runTaskLater(task -> {
    threadService.runActionLater(run -> {
      tab.setOnClosed(null);
      tab.setOnSelectionChanged(null);
      tab.setPath(null);
      tab.setWebView(null);
      tab.setContent(null);
      tab.setUserData(null);
      tab.setOnCloseRequest(null);
    }
);
  }
);
}

Fixed version (ground truth):
public void keepClosedTab(Tab closedTab){
  MyTab tab=(MyTab)closedTab;
  Label closedTabLabel=(Label)closedTab.getGraphic();
  if (!closedTabLabel.getText().equals("String_Node_Str")) {
    closedPaths.add(Optional.ofNullable(tab.getPath()));
  }
  threadService.runTaskLater(task -> {
    threadService.runActionLater(run -> {
      tab.setOnClosed(null);
      tab.setOnSelectionChanged(null);
      tab.setPath(null);
      tab.setWebView(null);
      tab.setContent(null);
      tab.setUserData(null);
      tab.setOnCloseRequest(null);
      Label label=(Label)tab.getGraphic();
      label.setOnMouseClicked(null);
    }
);
  }
);
}
Program: 62421
Project: 62421
Buggy source:
public String plantUml(String uml,String type,String fileName) throws IOException {
  return plantUmlService.plantUml(uml,type,fileName);
}

Fixed version (ground truth):
public void plantUml(String uml,String type,String fileName) throws IOException {
  threadService.runTaskLater(task -> {
    plantUmlService.plantUml(uml,type,fileName);
  }
);
}
Program: 62422
Project: 62422
Buggy source:
public String createFileTree(String tree,String type,String fileName,String width,String height){
  return treeService.createFileTree(tree,type,fileName,width,height);
}

Fixed version (ground truth):
public void createFileTree(String tree,String type,String fileName,String width,String height){
  threadService.runTaskLater(task -> {
    treeService.createFileTree(tree,type,fileName,width,height);
  }
);
}
Program: 62423
Project: 62423
Buggy source:
public void svgToPng(String fileName,String svg,String formula,float width,float height){
  mathJaxService.svgToPng(fileName,svg,formula,width,height);
}

Fixed version (ground truth):
public void svgToPng(String fileName,String svg,String formula,float width,float height){
  threadService.runTaskLater(task -> {
    mathJaxService.svgToPng(fileName,svg,formula,width,height);
  }
);
}
Program: 62424
Project: 62424
Buggy source:
public static void writeToFile(Path path,byte[] content,StandardOpenOption... openOption){
  try {
    Files.write(path,content,openOption);
  }
 catch (  IOException e) {
    logger.info(e.toString());
  }
}

Fixed version (ground truth):
public static void writeToFile(Path path,byte[] content,StandardOpenOption... openOption){
  try {
    Files.write(path,content,openOption);
  }
 catch (  IOException e) {
    logger.info(e.getMessage(),e);
  }
}
Program: 62425
Project: 62425
Buggy source:
public static String readFile(Path path){
  String content="String_Node_Str";
  try (InputStream is=Files.newInputStream(path,StandardOpenOption.READ)){
    content=IOUtils.toString(is,"String_Node_Str");
  }
 catch (  IOException e) {
    logger.info(e.toString());
  }
  return content;
}

Fixed version (ground truth):
public static String readFile(Path path){
  String content="String_Node_Str";
  try (InputStream is=Files.newInputStream(path,StandardOpenOption.READ)){
    content=IOUtils.toString(is,"String_Node_Str");
  }
 catch (  IOException e) {
    logger.info(e.getMessage(),e);
  }
  return content;
}
Program: 62426
Project: 62426
Buggy source:
public static Path createTempFile(Path path,String prefix,String suffix){
  try {
    return Files.createTempFile(path,prefix,suffix);
  }
 catch (  IOException e) {
    logger.info(e.toString());
  }
  return null;
}

Fixed version (ground truth):
public static Path createTempFile(Path path,String prefix,String suffix){
  try {
    return Files.createTempFile(path,prefix,suffix);
  }
 catch (  IOException e) {
    logger.info(e.getMessage(),e);
  }
  return null;
}
Program: 62427
Project: 62427
Buggy source:
public static void createDirectories(Path path){
  try {
    Files.createDirectories(path);
  }
 catch (  IOException e) {
    logger.info(e.toString());
  }
}

Fixed version (ground truth):
public static void createDirectories(Path path){
  try {
    Files.createDirectories(path);
  }
 catch (  IOException e) {
    logger.info(e.getMessage(),e);
  }
}
Program: 62432
Project: 62432
Buggy source:
public void produceMobi(Path currentPath,String kindlegenDir){
  try {
    indikatorService.startCycle();
    ProcessExecutor processExecutor=new ProcessExecutor();
    processExecutor.readOutput(true);
    processExecutor.directory(new File(kindlegenDir));
    String message=processExecutor.command("String_Node_Str",currentPath.resolve("String_Node_Str").toString()).execute().outputUTF8();
    logger.info(message);
    indikatorService.completeCycle();
    Platform.runLater(() -> {
      asciiDocController.getRecentFiles().remove(currentPath.resolve("String_Node_Str").toString());
      asciiDocController.getRecentFiles().add(0,currentPath.resolve("String_Node_Str").toString());
    }
);
  }
 catch (  Exception e) {
    logger.error(e.getMessage(),e);
  }
 finally {
    indikatorService.hideIndikator();
  }
}

Fixed version (ground truth):
public void produceMobi(Path currentPath,String kindlegenDir){
  try {
    indikatorService.startCycle();
    ProcessExecutor processExecutor=new ProcessExecutor();
    processExecutor.readOutput(true);
    Path kindleGenPath=Paths.get(kindlegenDir);
    String message=processExecutor.command(kindleGenPath.resolve("String_Node_Str").toString(),currentPath.resolve("String_Node_Str").toString()).execute().outputUTF8();
    logger.info(message);
    indikatorService.completeCycle();
    Platform.runLater(() -> {
      asciiDocController.getRecentFiles().remove(currentPath.resolve("String_Node_Str").toString());
      asciiDocController.getRecentFiles().add(0,currentPath.resolve("String_Node_Str").toString());
    }
);
  }
 catch (  Exception e) {
    logger.error(e.getMessage(),e);
  }
 finally {
    indikatorService.hideIndikator();
  }
}
Program: 62435
Project: 62435
Buggy source:
public void onscroll(Object pos,Object max){
  if (Objects.isNull(pos) || Objects.isNull(max))   return;
  Number position=(Number)pos;
  Number maximum=(Number)max;
  double ratio=(position.doubleValue() * 100) / maximum.doubleValue();
  Integer browserMaxScroll=(Integer)previewEngine.executeScript("String_Node_Str");
  double browserScrollOffset=(Double.valueOf(browserMaxScroll) * ratio) / 100.0;
  previewEngine.executeScript(String.format("String_Node_Str",browserScrollOffset));
}

Fixed version (ground truth):
public void onscroll(Object pos,Object max){
  if (Objects.isNull(pos) || Objects.isNull(max))   return;
  Number position=(Number)pos;
  Number maximum=(Number)max;
  double currentY=(position.doubleValue() < 0) ? 0 : position.doubleValue();
  double ratio=(currentY * 100) / maximum.doubleValue();
  Integer browserMaxScroll=(Integer)previewEngine.executeScript("String_Node_Str");
  double browserScrollOffset=(Double.valueOf(browserMaxScroll) * ratio) / 100.0;
  previewEngine.executeScript(String.format("String_Node_Str",browserScrollOffset));
}
Program: 62436
Project: 62436
Buggy source:
public void htmlOnePage(){
  if (bookNames.contains(current.getCurrentTabText())) {
    generateHtml(null);
    return;
  }
  if (!current.currentPath().isPresent())   saveDoc();
  Path currentPath=current.currentPath().orElseGet(pathSaveSupplier);
  String asciidoc=current.currentEditorValue();
  String html=renderService.convertHtmlArticle(previewEngine,IOHelper.normalize(asciidoc));
  indikatorService.startCycle();
  runTaskLater(task -> {
    String tabText=current.getCurrentTabText().replace("String_Node_Str","String_Node_Str").trim();
    Path path=currentPath.getParent().resolve(tabText.concat("String_Node_Str"));
    IOHelper.writeToFile(path,html,CREATE,TRUNCATE_EXISTING,WRITE);
    runActionLater(run -> {
      indikatorService.hideIndikator();
      recentFiles.remove(path.toString());
      recentFiles.add(0,path.toString());
    }
);
  }
);
}

Fixed version (ground truth):
public void htmlOnePage(){
  if (bookNames.contains(current.getCurrentTabText())) {
    generateHtml(null);
    return;
  }
  if (!current.currentPath().isPresent())   saveDoc();
  Path currentPath=current.currentPath().orElseGet(pathSaveSupplier);
  String asciidoc=current.currentEditorValue();
  String html=renderService.convertHtmlArticle(previewEngine,asciidoc);
  indikatorService.startCycle();
  runTaskLater(task -> {
    String tabText=current.getCurrentTabText().replace("String_Node_Str","String_Node_Str").trim();
    Path path=currentPath.getParent().resolve(tabText.concat("String_Node_Str"));
    IOHelper.writeToFile(path,html,CREATE,TRUNCATE_EXISTING,WRITE);
    runActionLater(run -> {
      indikatorService.hideIndikator();
      recentFiles.remove(path.toString());
      recentFiles.add(0,path.toString());
    }
);
  }
);
}
Program: 62437
Project: 62437
Buggy source:
public synchronized String appendFormula(String fileName,String formula){
  if (fileName.endsWith("String_Node_Str")) {
    WebEngine engine=mathjaxView.getEngine();
    engine.executeScript(String.format("String_Node_Str",fileName,IOHelper.normalize(formula)));
    return "String_Node_Str" + fileName;
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
public String appendFormula(String fileName,String formula){
  if (fileName.endsWith("String_Node_Str")) {
    WebEngine engine=mathjaxView.getEngine();
    engine.executeScript(String.format("String_Node_Str",fileName,IOHelper.normalize(formula)));
    return "String_Node_Str" + fileName;
  }
  return "String_Node_Str";
}
Program: 62438
Project: 62438
Buggy source:
public synchronized void svgToPng(String fileName,String svg,String formula){
  if (!fileName.endsWith("String_Node_Str") || !svg.startsWith("String_Node_Str"))   return;
  Integer cacheHit=current.getCache().get(fileName);
  int hashCode=fileName.concat(formula).hashCode();
  if (Objects.nonNull(cacheHit))   if (hashCode == cacheHit)   return;
  current.getCache().put(fileName,hashCode);
  runSingleTaskLater(task -> {
    try {
      StringReader reader=new StringReader(svg);
      String uri="String_Node_Str";
      String parser=XMLResourceDescriptor.getXMLParserClassName();
      SAXSVGDocumentFactory f=new SAXSVGDocumentFactory(parser);
      SVGDocument doc=f.createSVGDocument(uri,reader);
      TranscoderInput transcoderInput=new TranscoderInput(doc);
      ByteArrayOutputStream ostream=new ByteArrayOutputStream();
      TranscoderOutput transcoderOutput=new TranscoderOutput(ostream);
      PNGTranscoder transcoder=new PNGTranscoder();
      transcoder.transcode(transcoderInput,transcoderOutput);
      ostream.flush();
      ostream.close();
      if (!current.currentPath().isPresent())       saveDoc();
      Path path=current.currentPathParent().get();
      Files.createDirectories(path.resolve("String_Node_Str"));
      Files.write(path.resolve("String_Node_Str").resolve(fileName),ostream.toByteArray(),CREATE,WRITE,TRUNCATE_EXISTING);
      lastRenderedChangeListener.changed(null,lastRendered.getValue(),lastRendered.getValue());
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
);
}

Fixed version (ground truth):
public void svgToPng(String fileName,String svg,String formula) throws IOException, TranscoderException {
  if (!fileName.endsWith("String_Node_Str") || !svg.startsWith("String_Node_Str"))   return;
  Integer cacheHit=current.getCache().get(fileName);
  int hashCode=fileName.concat(formula).hashCode();
  if (Objects.nonNull(cacheHit))   if (hashCode == cacheHit)   return;
  current.getCache().put(fileName,hashCode);
  StringReader reader=new StringReader(svg);
  String uri="String_Node_Str";
  String parser=XMLResourceDescriptor.getXMLParserClassName();
  SAXSVGDocumentFactory f=new SAXSVGDocumentFactory(parser);
  SVGDocument doc=f.createSVGDocument(uri,reader);
  try (ByteArrayOutputStream ostream=new ByteArrayOutputStream()){
    TranscoderInput transcoderInput=new TranscoderInput(doc);
    TranscoderOutput transcoderOutput=new TranscoderOutput(ostream);
    PNGTranscoder transcoder=new PNGTranscoder();
    transcoder.transcode(transcoderInput,transcoderOutput);
    if (!current.currentPath().isPresent())     saveDoc();
    Path path=current.currentPathParent().get();
    Files.createDirectories(path.resolve("String_Node_Str"));
    Files.write(path.resolve("String_Node_Str").resolve(fileName),ostream.toByteArray(),CREATE,WRITE,TRUNCATE_EXISTING);
    lastRenderedChangeListener.changed(null,lastRendered.getValue(),lastRendered.getValue());
  }
 }
Program: 62439
Project: 62439
Buggy source:
private WebView createWebView(){
  WebView webView=new WebView();
  WebEngine webEngine=webView.getEngine();
  webEngine.getLoadWorker().stateProperty().addListener((observable,oldValue,newValue) -> {
    if (newValue == Worker.State.SUCCEEDED) {
      JSObject window=(JSObject)webEngine.executeScript("String_Node_Str");
      if (Objects.isNull(window.getMember("String_Node_Str")))       ;
      window.setMember("String_Node_Str",this);
    }
  }
);
  webEngine.load(String.format("String_Node_Str",tomcatPort));
  return webView;
}

Fixed version (ground truth):
private WebView createWebView(){
  WebView webView=new WebView();
  WebEngine webEngine=webView.getEngine();
  webEngine.getLoadWorker().stateProperty().addListener((observable,oldValue,newValue) -> {
    JSObject window=(JSObject)webEngine.executeScript("String_Node_Str");
    if (Objects.isNull(window.getMember("String_Node_Str")))     ;
    window.setMember("String_Node_Str",this);
  }
);
  webEngine.load(String.format("String_Node_Str",tomcatPort));
  return webView;
}
Program: 62442
Project: 62442
Buggy source:
@FXML private void generatePdf(ActionEvent event) throws IOException, SAXException {
  Path currentPath=initialDirectory.map(path -> Files.isDirectory(path) ? path : path.getParent()).get();
  docBookController.generateDocbook(previewEngine,currentPath,false);
  Task<Boolean> task=new Task<Boolean>(){
    @Override protected Boolean call() throws Exception {
      fopServiceRunner.generate(currentPath,userHome);
      return null;
    }
  }
;
  new Thread(task).start();
}

Fixed version (ground truth):
@FXML private void generatePdf(ActionEvent event) throws IOException, SAXException {
  Path currentPath=initialDirectory.map(path -> Files.isDirectory(path) ? path : path.getParent()).get();
  docBookController.generateDocbook(previewEngine,currentPath,false);
  Task<Void> task=new Task<Void>(){
    @Override protected Void call() throws Exception {
      fopServiceRunner.generate(currentPath,userHome);
      return null;
    }
  }
;
  new Thread(task).start();
}
Program: 62443
Project: 62443
Buggy source:
@Override protected Boolean call() throws Exception {
  fopServiceRunner.generate(currentPath,userHome);
  return null;
}

Fixed version (ground truth):
@Override protected Void call() throws Exception {
  fopServiceRunner.generate(currentPath,userHome);
  return null;
}
Program: 62444
Project: 62444
Buggy source:
public static String normalize(String content){
  content=content.replace("String_Node_Str","String_Node_Str");
  content=content.replace("String_Node_Str","String_Node_Str");
  content=content.replace("String_Node_Str","String_Node_Str");
  content=content.replace("String_Node_Str","String_Node_Str");
  content=content.replace("String_Node_Str","String_Node_Str");
  return content;
}

Fixed version (ground truth):
public static String normalize(String content){
  content=content.replace("String_Node_Str","String_Node_Str");
  content=content.replace("String_Node_Str","String_Node_Str");
  content=content.replace("String_Node_Str","String_Node_Str");
  content=content.replace("String_Node_Str","String_Node_Str");
  content=content.replace("String_Node_Str","String_Node_Str");
  content=content.replace("String_Node_Str","String_Node_Str");
  return content;
}
Program: 62445
Project: 62445
Buggy source:
public String asciidocToDocbook(WebEngine webEngine,String text,boolean includeHeader){
  if (includeHeader)   webEngine.executeScript("String_Node_Str");
 else   webEngine.executeScript("String_Node_Str");
  webEngine.executeScript("String_Node_Str");
  String rendered=(String)webEngine.executeScript("String_Node_Str" + IOHelper.normalize(text) + "String_Node_Str");
  return rendered;
}

Fixed version (ground truth):
public String asciidocToDocbook(WebEngine webEngine,String text,boolean includeHeader){
  if (includeHeader)   webEngine.executeScript("String_Node_Str");
 else   webEngine.executeScript("String_Node_Str");
  webEngine.executeScript("String_Node_Str");
  String rendered=(String)webEngine.executeScript(String.format("String_Node_Str",IOHelper.normalize(text)));
  return rendered;
}
Program: 62446
Project: 62446
Buggy source:
@Override public void run(){
  if (result.isError()) {
    Log.e(TAG,"String_Node_Str",result.getThrowable());
    if (data.errorResId == Dali.NO_RESID) {
      imageView.setImageResource(data.errorResId);
    }
  }
 else {
    if (data.alphaFadeIn) {
      Drawable placeholder;
      if (imageView.getDrawable() != null) {
        placeholder=imageView.getDrawable();
      }
 else {
        placeholder=new ColorDrawable(Color.parseColor("String_Node_Str"));
      }
      final TransitionDrawable transition=new TransitionDrawable(new Drawable[]{placeholder,new BitmapDrawable(data.contextWrapper.getResources(),result.getBitmap())});
      imageView.setImageDrawable(transition);
      transition.startTransition(FADE_IN_MS);
    }
 else {
      imageView.setImageDrawable(new BitmapDrawable(data.contextWrapper.getResources(),result.getBitmap()));
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (result.isError()) {
    Log.e(TAG,"String_Node_Str",result.getThrowable());
    if (data.errorResId == Dali.NO_RESID) {
      imageView.setImageResource(data.errorResId);
    }
  }
 else {
    if (data.alphaFadeIn) {
      Drawable placeholder;
      Drawable oldDrawable=imageView.getDrawable();
      if (oldDrawable != null) {
        if (oldDrawable instanceof LayerDrawable) {
          LayerDrawable oldLayerDrawable=(LayerDrawable)oldDrawable;
          placeholder=oldLayerDrawable.getDrawable(0);
        }
 else {
          placeholder=imageView.getDrawable();
        }
      }
 else {
        placeholder=new ColorDrawable(Color.parseColor("String_Node_Str"));
      }
      final TransitionDrawable transition=new TransitionDrawable(new Drawable[]{placeholder,new BitmapDrawable(data.contextWrapper.getResources(),result.getBitmap())});
      imageView.setImageDrawable(transition);
      transition.startTransition(FADE_IN_MS);
    }
 else {
      imageView.setImageDrawable(new BitmapDrawable(data.contextWrapper.getResources(),result.getBitmap()));
    }
  }
}
Program: 62447
Project: 62447
Buggy source:
public JobDescription into(final ImageView imageView){
  if (data.placeholder != Dali.NO_RESID) {
    imageView.setImageResource(data.placeholder);
  }
  return start(new BlurWorker.BlurWorkerListener(){
    @Override public void onResult(    final BlurWorker.Result result){
      uiThreadHandler.post(new Runnable(){
        @Override public void run(){
          if (result.isError()) {
            Log.e(TAG,"String_Node_Str",result.getThrowable());
            if (data.errorResId == Dali.NO_RESID) {
              imageView.setImageResource(data.errorResId);
            }
          }
 else {
            if (data.alphaFadeIn) {
              Drawable placeholder;
              if (imageView.getDrawable() != null) {
                placeholder=imageView.getDrawable();
              }
 else {
                placeholder=new ColorDrawable(Color.parseColor("String_Node_Str"));
              }
              final TransitionDrawable transition=new TransitionDrawable(new Drawable[]{placeholder,new BitmapDrawable(data.contextWrapper.getResources(),result.getBitmap())});
              imageView.setImageDrawable(transition);
              transition.startTransition(FADE_IN_MS);
            }
 else {
              imageView.setImageDrawable(new BitmapDrawable(data.contextWrapper.getResources(),result.getBitmap()));
            }
          }
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
public JobDescription into(final ImageView imageView){
  if (data.placeholder != Dali.NO_RESID) {
    imageView.setImageResource(data.placeholder);
  }
  return start(new BlurWorker.BlurWorkerListener(){
    @Override public void onResult(    final BlurWorker.Result result){
      uiThreadHandler.post(new Runnable(){
        @Override public void run(){
          if (result.isError()) {
            Log.e(TAG,"String_Node_Str",result.getThrowable());
            if (data.errorResId == Dali.NO_RESID) {
              imageView.setImageResource(data.errorResId);
            }
          }
 else {
            if (data.alphaFadeIn) {
              Drawable placeholder;
              Drawable oldDrawable=imageView.getDrawable();
              if (oldDrawable != null) {
                if (oldDrawable instanceof LayerDrawable) {
                  LayerDrawable oldLayerDrawable=(LayerDrawable)oldDrawable;
                  placeholder=oldLayerDrawable.getDrawable(0);
                }
 else {
                  placeholder=imageView.getDrawable();
                }
              }
 else {
                placeholder=new ColorDrawable(Color.parseColor("String_Node_Str"));
              }
              final TransitionDrawable transition=new TransitionDrawable(new Drawable[]{placeholder,new BitmapDrawable(data.contextWrapper.getResources(),result.getBitmap())});
              imageView.setImageDrawable(transition);
              transition.startTransition(FADE_IN_MS);
            }
 else {
              imageView.setImageDrawable(new BitmapDrawable(data.contextWrapper.getResources(),result.getBitmap()));
            }
          }
        }
      }
);
    }
  }
);
}
Program: 62448
Project: 62448
Buggy source:
@Override public void onResult(final BlurWorker.Result result){
  uiThreadHandler.post(new Runnable(){
    @Override public void run(){
      if (result.isError()) {
        Log.e(TAG,"String_Node_Str",result.getThrowable());
        if (data.errorResId == Dali.NO_RESID) {
          imageView.setImageResource(data.errorResId);
        }
      }
 else {
        if (data.alphaFadeIn) {
          Drawable placeholder;
          if (imageView.getDrawable() != null) {
            placeholder=imageView.getDrawable();
          }
 else {
            placeholder=new ColorDrawable(Color.parseColor("String_Node_Str"));
          }
          final TransitionDrawable transition=new TransitionDrawable(new Drawable[]{placeholder,new BitmapDrawable(data.contextWrapper.getResources(),result.getBitmap())});
          imageView.setImageDrawable(transition);
          transition.startTransition(FADE_IN_MS);
        }
 else {
          imageView.setImageDrawable(new BitmapDrawable(data.contextWrapper.getResources(),result.getBitmap()));
        }
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void onResult(final BlurWorker.Result result){
  uiThreadHandler.post(new Runnable(){
    @Override public void run(){
      if (result.isError()) {
        Log.e(TAG,"String_Node_Str",result.getThrowable());
        if (data.errorResId == Dali.NO_RESID) {
          imageView.setImageResource(data.errorResId);
        }
      }
 else {
        if (data.alphaFadeIn) {
          Drawable placeholder;
          Drawable oldDrawable=imageView.getDrawable();
          if (oldDrawable != null) {
            if (oldDrawable instanceof LayerDrawable) {
              LayerDrawable oldLayerDrawable=(LayerDrawable)oldDrawable;
              placeholder=oldLayerDrawable.getDrawable(0);
            }
 else {
              placeholder=imageView.getDrawable();
            }
          }
 else {
            placeholder=new ColorDrawable(Color.parseColor("String_Node_Str"));
          }
          final TransitionDrawable transition=new TransitionDrawable(new Drawable[]{placeholder,new BitmapDrawable(data.contextWrapper.getResources(),result.getBitmap())});
          imageView.setImageDrawable(transition);
          transition.startTransition(FADE_IN_MS);
        }
 else {
          imageView.setImageDrawable(new BitmapDrawable(data.contextWrapper.getResources(),result.getBitmap()));
        }
      }
    }
  }
);
}
Program: 62449
Project: 62449
Buggy source:
/** 
 * Constructor.
 * @param thing           the thing the coordinator should be created for
 * @param audioHTTPServer server for hosting audio streams
 * @param callbackUrl     url to be used to tell the Chromecast which host to call for audio urls
 */
public ChromecastHandler(final Thing thing,AudioHTTPServer audioHTTPServer,String callbackUrl){
  super(thing);
  this.audioHTTPServer=audioHTTPServer;
  this.callbackUrl=callbackUrl;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param thing the thing the coordinator should be created for
 * @param audioHTTPServer server for hosting audio streams
 * @param callbackUrl url to be used to tell the Chromecast which host to call for audio urls
 */
public ChromecastHandler(final Thing thing,AudioHTTPServer audioHTTPServer,String callbackUrl){
  super(thing);
  this.audioHTTPServer=audioHTTPServer;
  this.callbackUrl=callbackUrl;
}
Program: 62450
Project: 62450
Buggy source:
public void handleCommand(final ChannelUID channelUID,final Command command){
  if (chromeCast == null) {
    return;
  }
  if (command instanceof RefreshType) {
    handleRefresh();
    return;
  }
switch (channelUID.getId()) {
case CHANNEL_CONTROL:
    handleControl(command);
  break;
case CHANNEL_VOLUME:
handleVolume(command);
break;
case CHANNEL_MUTE:
handleMute(command);
break;
case CHANNEL_PLAY_URI:
handlePlayUri(command);
break;
default :
logger.debug("String_Node_Str",command,channelUID);
break;
}
}

Fixed version (ground truth):
public void handleCommand(final ChannelUID channelUID,final Command command){
  if (chromeCast == null) {
    return;
  }
  if (command instanceof RefreshType) {
    scheduler.scheduleRefresh();
    return;
  }
switch (channelUID.getId()) {
case CHANNEL_CONTROL:
    handleControl(command);
  break;
case CHANNEL_VOLUME:
handleVolume(command);
break;
case CHANNEL_MUTE:
handleMute(command);
break;
case CHANNEL_PLAY_URI:
handlePlayUri(command);
break;
default :
logger.debug("String_Node_Str",command,channelUID);
break;
}
}
Program: 62451
Project: 62451
Buggy source:
public void cancelRefresh(){
  logger.debug("String_Node_Str");
  if (refreshFuture != null) {
    refreshFuture.cancel(true);
  }
}

Fixed version (ground truth):
public synchronized void cancelRefresh(){
  logger.debug("String_Node_Str");
  if (refreshFuture != null) {
    refreshFuture.cancel(true);
  }
}
Program: 62452
Project: 62452
Buggy source:
private void cancelConnect(){
  logger.debug("String_Node_Str");
  if (connectFuture != null) {
    connectFuture.cancel(true);
    connectFuture=null;
  }
}

Fixed version (ground truth):
private synchronized void cancelConnect(){
  logger.debug("String_Node_Str");
  if (connectFuture != null) {
    connectFuture.cancel(true);
    connectFuture=null;
  }
}
Program: 62453
Project: 62453
Buggy source:
public void destroy(){
  cancelConnect();
  cancelRefresh();
}

Fixed version (ground truth):
public synchronized void destroy(){
  cancelConnect();
  cancelRefresh();
}
Program: 62454
Project: 62454
Buggy source:
public void scheduleRefresh(){
  cancelRefresh();
  logger.debug("String_Node_Str",refreshRate);
  refreshFuture=scheduler.scheduleAtFixedRate(refreshRunnable,0,refreshRate,SECONDS);
}

Fixed version (ground truth):
public synchronized void scheduleRefresh(){
  cancelRefresh();
  logger.debug("String_Node_Str",refreshRate);
  refreshFuture=scheduler.scheduleWithFixedDelay(refreshRunnable,1,refreshRate,SECONDS);
}