nus-yam/ex-repair huggingface dataset:
Program: 38746
Project: 38746
Buggy source:
/** 
 * You should not need to care about this method. In the unlikely case where you actually want all the cells of your ListView to actually be the same one, it is left protected and not private so you can override it and avoid the warnings being spouted at you. Else, the idea is that a set of cells is created and they share the elements one after another during scrolling and JavaFX might generate more of them later so we should just not make any assumption and expect all of them to be different and not singletons.
 */
protected void ensureCorrectSpringScoping(){
synchronized (HAS_CHECKED_BEAN_DEFINITIONS) {
    if (HAS_CHECKED_BEAN_DEFINITIONS.get())     return;
    final ConfigurableListableBeanFactory beanFactory=applicationContext.getBeanFactory();
    Stream.of(ComponentCellFxmlController.class,ComponentListCell.class).map(beanFactory::getBeanNamesForType).flatMap(Arrays::stream).forEach(pBean -> {
      final String effectiveScope=beanFactory.getBeanDefinition(pBean).getScope();
      if (ConfigurableBeanFactory.SCOPE_PROTOTYPE.equals(effectiveScope)) {
        LOG.warn("String_Node_Str" + "String_Node_Str" + "String_Node_Str",pBean);
      }
    }
);
    HAS_CHECKED_BEAN_DEFINITIONS.set(true);
  }
}

Fixed version (ground truth):
/** 
 * You should not need to care about this method. In the unlikely case where you actually want all the cells of your ListView to actually be the same one, it is left protected and not private so you can override it and avoid the warnings being spouted at you. Else, the idea is that a set of cells is created and they share the elements one after another during scrolling and JavaFX might generate more of them later so we should just not make any assumption and expect all of them to be different and not singletons.
 */
protected void ensureCorrectSpringScoping(){
synchronized (HAS_CHECKED_BEAN_DEFINITIONS) {
    if (HAS_CHECKED_BEAN_DEFINITIONS.get())     return;
    final ConfigurableListableBeanFactory beanFactory=applicationContext.getBeanFactory();
    Stream.of(ComponentCellFxmlController.class,ComponentListCell.class).map(beanFactory::getBeanNamesForType).flatMap(Arrays::stream).forEach(pBean -> {
      final String effectiveScope=beanFactory.getBeanDefinition(pBean).getScope();
      if (!ConfigurableBeanFactory.SCOPE_PROTOTYPE.equals(effectiveScope)) {
        LOG.warn("String_Node_Str" + "String_Node_Str" + "String_Node_Str",pBean);
      }
    }
);
    HAS_CHECKED_BEAN_DEFINITIONS.set(true);
  }
}
Program: 38748
Project: 38748
Buggy source:
@Test public void getAll(){
  this.instanceManager.registerSingle(PARENT,ACTUAL_1);
  this.instanceManager.registerSingle(PARENT,ACTUAL_2);
  this.instanceManager.registerMultiple(PARENT,SEL_1,ACTUAL_1);
  this.instanceManager.registerMultiple(PARENT,SEL_2,ACTUAL_2);
  final List<Object> all=this.instanceManager.getAll(PARENT);
  assertThat(all).containsExactlyInAnyOrder(ACTUAL_1,ACTUAL_2,ACTUAL_2);
}

Fixed version (ground truth):
@Test public void getAll(){
  this.instanceManager.registerSingle(PARENT,ACTUAL_1);
  this.instanceManager.registerSingle(PARENT,ACTUAL_2);
  this.instanceManager.registerMultiple(PARENT,SEL_1,ACTUAL_1);
  this.instanceManager.registerMultiple(PARENT,SEL_2,ACTUAL_2);
  final List<String> all=this.instanceManager.getAll(PARENT);
  assertThat(all).containsExactlyInAnyOrder(ACTUAL_1,ACTUAL_2,ACTUAL_2);
}
Program: 38749
Project: 38749
Buggy source:
@Before public void setUp(){
  this.instanceManager=new AbstractInstanceManager<Object,Object,Object>(){
  }
;
}

Fixed version (ground truth):
@Before public void setUp(){
  this.instanceManager=new AbstractInstanceManager<String,String>(){
  }
;
}
Program: 38750
Project: 38750
Buggy source:
/** 
 * This method gets the   {@link Path} associated to a classpath-located file.
 * @param resourceRelativePath The path from the root of the classpath (target/classes/ in a maven project)
 * @return The path associated with resource at said relative path to classpath.
 */
@SuppressWarnings("String_Node_Str") public static Try<URL> getResourceURL(final String resourceRelativePath){
  final ClassLoader classLoader=Resources.class.getClassLoader();
  return Try.of(() -> classLoader).map(cl -> cl.getResource(resourceRelativePath)).map(Objects::requireNonNull).mapFailure(Case($(err -> err instanceof NullPointerException | err instanceof NoSuchFileException),err -> new IllegalArgumentException("String_Node_Str" + getBaseURL().toExternalForm() + resourceRelativePath,err)));
}

Fixed version (ground truth):
/** 
 * This method gets the   {@link Path} associated to a classpath-located file.
 * @param resourceRelativePath The path from the root of the classpath (target/classes/ in a maven project)
 * @return The path associated with resource at said relative path to classpath.
 */
@SuppressWarnings("String_Node_Str") public static Try<URL> getResourceURL(final String resourceRelativePath){
  final ClassLoader classLoader=Resources.class.getClassLoader();
  return Try.of(() -> classLoader).map(cl -> cl.getResource(resourceRelativePath)).map(Objects::requireNonNull).mapFailure(Case($(err -> err instanceof NullPointerException || err instanceof NoSuchFileException),err -> new IllegalArgumentException("String_Node_Str" + getBaseURL().toExternalForm() + resourceRelativePath,err)));
}
Program: 38751
Project: 38751
Buggy source:
private Resources(){
}

Fixed version (ground truth):
private Resources(){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 38752
Project: 38752
Buggy source:
private void pushClipboardTestData(Clipboard clipboard){
  clipboard.setContents(new Transferable(){
    private final String value="String_Node_Str";
    @Override public DataFlavor[] getTransferDataFlavors(){
      return new DataFlavor[]{DataFlavor.stringFlavor};
    }
    @Override public boolean isDataFlavorSupported(    DataFlavor flavor){
      return flavor.equals(DataFlavor.stringFlavor);
    }
    @Override public Object getTransferData(    DataFlavor flavor){
      return value;
    }
  }
,(t,co) -> {
  }
);
}

Fixed version (ground truth):
private void pushClipboardTestData(Clipboard clipboard){
  clipboard.setContents(new Transferable(){
    @Override public DataFlavor[] getTransferDataFlavors(){
      return new DataFlavor[]{DataFlavor.stringFlavor};
    }
    @Override public boolean isDataFlavorSupported(    DataFlavor flavor){
      return flavor.equals(DataFlavor.stringFlavor);
    }
    @Override public Object getTransferData(    DataFlavor flavor){
      return TEST_CB_VALUE;
    }
  }
,(t,co) -> {
  }
);
}
Program: 38753
Project: 38753
Buggy source:
@Override public Object getTransferData(DataFlavor flavor){
  return value;
}

Fixed version (ground truth):
@Override public Object getTransferData(DataFlavor flavor){
  return TEST_CB_VALUE;
}
Program: 38754
Project: 38754
Buggy source:
@SuppressWarnings("String_Node_Str") @Test public void asyncAwtRunnableWithRequirement(){
  AwtUtils.asyncAwtRunnableWithRequirement(Toolkit.getDefaultToolkit()::getSystemClipboard,this::pushClipboardTestData);
  final CompletionStage<Try<Object>> asyncCb=AwtUtils.asyncAwtCallbackWithRequirement(Toolkit.getDefaultToolkit()::getSystemClipboard,cb -> Try.of(() -> cb.getData(DataFlavor.stringFlavor)));
  final Try<Object> clipboardLoad=Try.of(asyncCb.toCompletableFuture()::get);
  assertThat(clipboardLoad.isSuccess()).isTrue();
  assertThat(((Try<Object>)clipboardLoad.get()).get()).isEqualTo("String_Node_Str");
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test public void asyncAwtRunnableWithRequirement(){
  AwtUtils.asyncAwtRunnableWithRequirement(Toolkit.getDefaultToolkit()::getSystemClipboard,this::pushClipboardTestData);
  final CompletionStage<Try<Object>> asyncCb=AwtUtils.asyncAwtCallbackWithRequirement(Toolkit.getDefaultToolkit()::getSystemClipboard,cb -> Try.of(() -> cb.getData(DataFlavor.stringFlavor)));
  final Try<Object> clipboardLoad=Try.of(asyncCb.toCompletableFuture()::get);
  assertThat(clipboardLoad.isSuccess()).isTrue();
  assertThat(((Try<Object>)clipboardLoad.get()).get()).isEqualTo(TEST_CB_VALUE);
}
Program: 38755
Project: 38755
Buggy source:
public static void main(final String... args){
  final SpringApplicationBuilder sab=new SpringApplicationBuilder(__main_stub.class).headless(false).web(WebApplicationType.NONE);
  try (ConfigurableApplicationContext ctx=sab.run(args)){
    LOG.info("String_Node_Str");
    ctx.close();
    throw new IllegalStateException("String_Node_Str");
  }
 }

Fixed version (ground truth):
public static void main(final String... args){
  final SpringApplicationBuilder sab=new SpringApplicationBuilder(__main_stub.class).headless(false).web(WebApplicationType.NONE);
  final ConfigurableApplicationContext ctx=sab.run(args);
  LOG.info("String_Node_Str");
  ctx.close();
  throw new IllegalStateException("String_Node_Str");
}
Program: 38756
Project: 38756
Buggy source:
@Test(expected=RuntimeException.class) public void main(){
  __main_stub.main();
}

Fixed version (ground truth):
@Test(expected=IllegalStateException.class) public void main(){
  __main_stub.main();
}
Program: 38757
Project: 38757
Buggy source:
@Test public void getCssContent() throws IOException {
  final FxmlStylesheet stylesheet=this.stylesheetLoading.getOrElseThrow(IOException::new);
  assertThat(stylesheet.getCssContent()).isEqualTo(TEST_STYLE_CONTENT);
}

Fixed version (ground truth):
@Test public void getCssContent() throws IOException {
  final FxmlStylesheet stylesheet=this.stylesheetLoading.getOrElseThrow(IOException::new);
  assertThat(stylesheet.getCssContent()).isEqualToIgnoringWhitespace(TEST_STYLE_CONTENT);
}
Program: 38758
Project: 38758
Buggy source:
@Autowired public BrowserSupport(Desktop desktop){
  this.desktop=desktop;
}

Fixed version (ground truth):
@Autowired public BrowserSupport(final Desktop desktop){
  this.desktop=desktop;
}
Program: 38759
Project: 38759
Buggy source:
private void browse(final URI uri){
  try {
    this.desktop.browse(uri);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private void browse(final URI uri){
  try {
    this.desktop.browse(uri);
  }
 catch (  final IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 38760
Project: 38760
Buggy source:
@Autowired public SystemTraySupport(SystemTray awtSystemTray,Toolkit awtToolkit){
  this.awtSystemTray=new AtomicReference<>(awtSystemTray);
  this.awtToolkit=awtToolkit;
}

Fixed version (ground truth):
@Autowired public SystemTraySupport(final SystemTray awtSystemTray,final Toolkit awtToolkit){
  this.awtSystemTray=new AtomicReference<>(awtSystemTray);
  this.awtToolkit=awtToolkit;
}
Program: 38761
Project: 38761
Buggy source:
public static CompletableFuture<Stage> displayExceptionPane(final String title,final String readable,final Throwable exception){
  final Pane exceptionPane=new ExceptionHandler(exception).asPane(readable);
  final CompletableFuture<Stage> exceptionStage=StageUtils.stageOf(title,exceptionPane);
  return exceptionStage.thenCompose(StageUtils::scheduleDisplaying);
}

Fixed version (ground truth):
public static CompletionStage<Stage> displayExceptionPane(final String title,final String readable,final Throwable exception){
  final Pane exceptionPane=new ExceptionHandler(exception).asPane(readable);
  final CompletionStage<Stage> exceptionStage=StageUtils.stageOf(title,exceptionPane);
  return exceptionStage.thenCompose(StageUtils::scheduleDisplaying);
}
Program: 38762
Project: 38762
Buggy source:
private Option<FxmlController> makeControllerForNode(FxmlNode node){
  return node.getControllerClass().map(this.context::getBean);
}

Fixed version (ground truth):
private Option<FxmlController> makeControllerForNode(final FxmlNode node){
  return node.getControllerClass().map(this.context::getBean);
}
Program: 38763
Project: 38763
Buggy source:
/** 
 * This method acts just like   {@link #loadNode(FxmlNode)} but with noautoconfiguration of controller binding and stylesheet application.
 */
protected <T extends Node>Try<T> loadNodeImpl(final FxmlLoader fxmlLoader,final FxmlNode fxmlNode){
  final String filePath=this.filePath(fxmlNode);
  fxmlLoader.setLocation(getUrlForResource(filePath));
  Try<T> loadResult=Try.of(fxmlLoader::load);
  loadResult.onSuccess(fxmlLoader::onSuccess).onFailure(fxmlLoader::onFailure);
  return this.applyStylesheetIfNeeded(fxmlNode,loadResult);
}

Fixed version (ground truth):
/** 
 * This method acts just like   {@link #loadNode(FxmlNode)} but with noautoconfiguration of controller binding and stylesheet application.
 */
protected <T extends Node>Try<T> loadNodeImpl(final FxmlLoader fxmlLoader,final FxmlNode fxmlNode){
  final String filePath=this.filePath(fxmlNode);
  fxmlLoader.setLocation(getUrlForResource(filePath));
  final Try<T> loadResult=Try.of(fxmlLoader::load);
  loadResult.onSuccess(fxmlLoader::onSuccess).onFailure(fxmlLoader::onFailure);
  return this.applyStylesheetIfNeeded(fxmlNode,loadResult);
}
Program: 38764
Project: 38764
Buggy source:
public void setOnSuccess(Runnable onSuccess){
  this.onSuccess=onSuccess;
}

Fixed version (ground truth):
public void setOnSuccess(final Runnable onSuccess){
  this.onSuccess=onSuccess;
}
Program: 38765
Project: 38765
Buggy source:
public void onSuccess(Object loadResult){
  this.onSuccess.run();
}

Fixed version (ground truth):
public void onSuccess(final Object loadResult){
  this.onSuccess.run();
}
Program: 38766
Project: 38766
Buggy source:
public static CompletableFuture<Stage> stageOf(final String title,final Pane rootPane){
  final CompletableFuture<Stage> upcomingStage=new CompletableFuture<>();
  Platform.runLater(() -> {
    final Stage stage=new Stage(StageStyle.DECORATED);
    stage.setTitle(title);
    stage.setScene(new Scene(rootPane));
    upcomingStage.complete(stage);
  }
);
  return upcomingStage;
}

Fixed version (ground truth):
public static CompletionStage<Stage> stageOf(final String title,final Pane rootPane){
  final CompletableFuture<Stage> upcomingStage=new CompletableFuture<>();
  Platform.runLater(() -> {
    final Stage stage=new Stage(StageStyle.DECORATED);
    stage.setTitle(title);
    stage.setScene(new Scene(rootPane));
    upcomingStage.complete(stage);
  }
);
  return upcomingStage;
}
Program: 38767
Project: 38767
Buggy source:
public static CompletableFuture<Stage> scheduleHiding(final Stage stage){
  LOG.debug("String_Node_Str",stage,stage.getTitle());
  return asyncStageOperation(stage,Stage::hide);
}

Fixed version (ground truth):
public static CompletionStage<Stage> scheduleHiding(final Stage stage){
  LOG.debug("String_Node_Str",stage,stage.getTitle());
  return asyncStageOperation(stage,Stage::hide);
}
Program: 38768
Project: 38768
Buggy source:
public static CompletableFuture<Stage> scheduleDisplaying(final Stage stage){
  LOG.debug("String_Node_Str",stage,stage.getTitle());
  return asyncStageOperation(stage,Stage::show);
}

Fixed version (ground truth):
public static CompletionStage<Stage> scheduleDisplaying(final Stage stage){
  LOG.debug("String_Node_Str",stage,stage.getTitle());
  return asyncStageOperation(stage,Stage::show);
}
Program: 38769
Project: 38769
Buggy source:
public static CompletableFuture<Stage> asyncStageOperation(final Stage stage,final Consumer<Stage> asyncOp){
  final CompletableFuture<Stage> onAsyncOpDone=new CompletableFuture<>();
  Platform.runLater(() -> {
    asyncOp.accept(stage);
    onAsyncOpDone.complete(stage);
  }
);
  return onAsyncOpDone;
}

Fixed version (ground truth):
public static CompletionStage<Stage> asyncStageOperation(final Stage stage,final Consumer<Stage> asyncOp){
  final CompletableFuture<Stage> onAsyncOpDone=new CompletableFuture<>();
  Platform.runLater(() -> {
    asyncOp.accept(stage);
    onAsyncOpDone.complete(stage);
  }
);
  return onAsyncOpDone;
}
Program: 38770
Project: 38770
Buggy source:
@Before public void ensureNotCi(){
  final String envProperty=System.getProperty("String_Node_Str");
  if (envProperty != null) {
    assumeFalse(System.getProperty("String_Node_Str").equals("String_Node_Str"));
  }
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
@Before public void ensureNotCi(){
  final String envProperty=System.getProperty("String_Node_Str");
  if (envProperty != null) {
    assumeFalse("String_Node_Str".equals(System.getProperty("String_Node_Str")));
  }
  System.out.println("String_Node_Str");
}
Program: 38771
Project: 38771
Buggy source:
@Override public void start(Stage stage){
  this.EXCEPTION_TEXT="String_Node_Str";
  this.EXCEPTION_TEXT_READABLE="String_Node_Str";
  this.EXCEPTION=new Exception(this.EXCEPTION_TEXT);
  this.ERR_PANE=new ExceptionHandler(this.EXCEPTION).asPane();
  this.ERR_PANE_READBLE=new ExceptionHandler(this.EXCEPTION).asPane(this.EXCEPTION_TEXT_READABLE);
}

Fixed version (ground truth):
@Override public void start(final Stage stage){
  this.EXCEPTION_TEXT="String_Node_Str";
  this.EXCEPTION_TEXT_READABLE="String_Node_Str";
  this.EXCEPTION=new Exception(this.EXCEPTION_TEXT);
  this.ERR_PANE=new ExceptionHandler(this.EXCEPTION).asPane();
  this.ERR_PANE_READBLE=new ExceptionHandler(this.EXCEPTION).asPane(this.EXCEPTION_TEXT_READABLE);
}
Program: 38772
Project: 38772
Buggy source:
@Test public void displayExceptionPane() throws ExecutionException, InterruptedException {
  final CompletableFuture<Stage> displayedStage=ExceptionHandler.displayExceptionPane(this.EXCEPTION_TEXT,this.EXCEPTION_TEXT_READABLE,this.EXCEPTION);
  final Stage stage=displayedStage.get();
  assertThat(stage.isShowing()).isTrue();
}

Fixed version (ground truth):
@Test public void displayExceptionPane(){
  final CompletionStage<Stage> displayedStage=ExceptionHandler.displayExceptionPane(this.EXCEPTION_TEXT,this.EXCEPTION_TEXT_READABLE,this.EXCEPTION);
  displayedStage.thenAccept(stage -> assertThat(stage.isShowing()));
}
Program: 38773
Project: 38773
Buggy source:
@Override public void start(Stage stage){
}

Fixed version (ground truth):
@Override public void start(final Stage stage){
}
Program: 38774
Project: 38774
Buggy source:
private Pane assertTestPaneLoadedCorrectly(Supplier<Try<Pane>> paneLoadingSupplier){
  final Try<Pane> testPaneLoadResult=paneLoadingSupplier.get();
  assertThat(testPaneLoadResult.isSuccess());
  final Pane testPane=testPaneLoadResult.get();
  assertThat(testPane.getChildren()).hasSize(1);
  assertThat(testPane.getChildren().get(0).getClass()).isEqualTo(Button.class);
  return testPane;
}

Fixed version (ground truth):
private Pane assertTestPaneLoadedCorrectly(final Supplier<Try<Pane>> paneLoadingSupplier){
  final Try<Pane> testPaneLoadResult=paneLoadingSupplier.get();
  assertThat(testPaneLoadResult.isSuccess());
  final Pane testPane=testPaneLoadResult.get();
  assertThat(testPane.getChildren()).hasSize(1);
  assertThat(testPane.getChildren().get(0).getClass()).isEqualTo(Button.class);
  return testPane;
}
Program: 38775
Project: 38775
Buggy source:
void FXMLNODES(FxmlFile fxmlFile,Option<Class<? extends FxmlController>> controllerClass,Option<FxmlStylesheet> stylesheet){
  this.fxmlFile=fxmlFile;
  this.controllerClass=controllerClass;
  this.stylesheet=stylesheet;
}

Fixed version (ground truth):
void FXMLNODES(final FxmlFile fxmlFile,final Option<Class<? extends FxmlController>> controllerClass,final Option<FxmlStylesheet> stylesheet){
  this.fxmlFile=fxmlFile;
  this.controllerClass=controllerClass;
  this.stylesheet=stylesheet;
}
Program: 38776
Project: 38776
Buggy source:
@Override public void start(Stage stage){
  this.testButton=new Button();
  this.testPane=new AnchorPane(this.testButton);
  stage.setScene(new Scene(this.testPane,200,200));
  stage.show();
}

Fixed version (ground truth):
@Override public void start(final Stage stage){
  this.testButton=new Button();
  final AnchorPane testPane=new AnchorPane(this.testButton);
  stage.setScene(new Scene(testPane,WIDTH_PANE,HEIGHT_PANE));
  stage.show();
}
Program: 38777
Project: 38777
Buggy source:
@Test public void stageOf(){
  final CompletableFuture<Stage> stageReq=StageUtils.stageOf(STAGE_TITLE,STAGE_PANE);
  stageReq.thenAccept(stage -> {
    assertThat(stage.getScene().getRoot()).isEqualTo(STAGE_PANE);
    assertThat(stage.getTitle()).isEqualTo(STAGE_TITLE);
  }
);
}

Fixed version (ground truth):
@Test public void stageOf(){
  final CompletionStage<Stage> stageReq=StageUtils.stageOf(STAGE_TITLE,STAGE_PANE);
  stageReq.thenAccept(stage -> {
    assertThat(stage.getScene().getRoot()).isEqualTo(STAGE_PANE);
    assertThat(stage.getTitle()).isEqualTo(STAGE_TITLE);
  }
);
}
Program: 38778
Project: 38778
Buggy source:
@Override public void start(Stage stage){
  Platform.setImplicitExit(false);
  STAGE_TITLE="String_Node_Str";
  STAGE_TITLE_2="String_Node_Str";
  STAGE_PANE=new Pane();
  TEST_STAGE=stage;
  stage.show();
  stage.hide();
}

Fixed version (ground truth):
@Override public void start(final Stage stage){
  Platform.setImplicitExit(false);
  STAGE_TITLE="String_Node_Str";
  STAGE_TITLE_2="String_Node_Str";
  STAGE_PANE=new Pane();
  TEST_STAGE=stage;
  stage.show();
  stage.hide();
}
Program: 38779
Project: 38779
Buggy source:
/** 
 * Import existing projects into the workspace
 * @param srcWS The source location of the project (all projects must be located in the same folder)
 * @param projectNames The names of the projects to import
 * @param copyProjects Whether project contents should be copied into the workspace or not
 * @throws CoreException
 */
public static void importProjects(IPath srcWS,String[] projectNames,boolean copyProjects) throws CoreException {
  IPath srcPath=resourceFolder.append(srcWS);
  if (!copyProjects) {
    IPath tmpPath=new Path(System.getProperty("String_Node_Str"));
    tmpPath=tmpPath.append("String_Node_Str");
    try {
      ServerTestUtil.copyProjects(srcPath,projectNames,tmpPath);
    }
 catch (    IOException e) {
      throw new CoreException(new Status(IStatus.ERROR,Activator.PLUGIN_ID,e.getMessage(),e));
    }
    srcPath=tmpPath;
  }
  ServerTestUtil.importProjects(srcPath,projectNames,copyProjects);
}

Fixed version (ground truth):
/** 
 * Import existing projects into the workspace
 * @param srcWS The source location of the project (all projects must be located in the same folder)
 * @param projectNames The names of the projects to import
 * @param copyProjects Whether project contents should be copied into the workspace or not
 * @throws CoreException
 */
public static void importProjects(IPath srcWS,String[] projectNames,boolean copyProjects) throws CoreException {
  IPath srcPath=resourceFolder.append(srcWS);
  if (!copyProjects) {
    IPath tmpPath=new Path(System.getProperty("String_Node_Str"));
    tmpPath=tmpPath.append("String_Node_Str");
    if (tmpPath.toFile().exists()) {
      try {
        FileUtil.deleteDirectory(tmpPath.toOSString(),true);
      }
 catch (      IOException e) {
        print("String_Node_Str" + tmpPath.toOSString());
      }
    }
    try {
      ServerTestUtil.copyProjects(srcPath,projectNames,tmpPath);
    }
 catch (    IOException e) {
      throw new CoreException(new Status(IStatus.ERROR,Activator.PLUGIN_ID,e.getMessage(),e));
    }
    srcPath=tmpPath;
  }
  ServerTestUtil.importProjects(srcPath,projectNames,copyProjects);
}
Program: 38781
Project: 38781
Buggy source:
public static List<LocalAppFileSystemConfig> load(PlatformConfig platformConfig){
  List<LocalAppFileSystemConfig> configs=new ArrayList<>();
  ModuleConfig moduleConfig=platformConfig.getModuleConfigIfExists("String_Node_Str");
  if (moduleConfig != null) {
    if (moduleConfig.hasProperty("String_Node_Str") && moduleConfig.hasProperty("String_Node_Str")) {
      String driveName=moduleConfig.getStringProperty("String_Node_Str");
      boolean remotelyAccessible=moduleConfig.getBooleanProperty("String_Node_Str",DEFAULT_REMOTELY_ACCESSIBLE);
      Path rootDir=moduleConfig.getPathProperty("String_Node_Str");
      configs.add(new LocalAppFileSystemConfig(driveName,remotelyAccessible,rootDir));
    }
    int maxAdditionalDriveCount=moduleConfig.getIntProperty("String_Node_Str",0);
    for (int i=0; i < maxAdditionalDriveCount; i++) {
      if (moduleConfig.hasProperty("String_Node_Str" + i) && moduleConfig.hasProperty("String_Node_Str" + i)) {
        String driveName=moduleConfig.getStringProperty("String_Node_Str" + i);
        boolean remotelyAccessible=moduleConfig.getBooleanProperty("String_Node_Str" + i,DEFAULT_REMOTELY_ACCESSIBLE);
        Path rootDir=moduleConfig.getPathProperty("String_Node_Str" + i);
        configs.add(new LocalAppFileSystemConfig(driveName,remotelyAccessible,rootDir));
      }
    }
  }
 else {
    for (    Path rootDir : platformConfig.getFileSystem().getRootDirectories()) {
      configs.add(new LocalAppFileSystemConfig(rootDir.toString(),false,rootDir));
    }
  }
  return configs;
}

Fixed version (ground truth):
public static List<LocalAppFileSystemConfig> load(PlatformConfig platformConfig){
  List<LocalAppFileSystemConfig> configs=new ArrayList<>();
  ModuleConfig moduleConfig=platformConfig.getModuleConfigIfExists("String_Node_Str");
  if (moduleConfig != null) {
    load(moduleConfig,OptionalInt.empty(),configs);
    int maxAdditionalDriveCount=moduleConfig.getIntProperty("String_Node_Str",0);
    for (int i=0; i < maxAdditionalDriveCount; i++) {
      load(moduleConfig,OptionalInt.of(i),configs);
    }
  }
 else {
    for (    Path rootDir : platformConfig.getFileSystem().getRootDirectories()) {
      if (Files.isDirectory(rootDir)) {
        configs.add(new LocalAppFileSystemConfig(rootDir.toString(),false,rootDir));
      }
    }
  }
  return configs;
}
Program: 38782
Project: 38782
Buggy source:
private LocalFolder scanFolder(Path path,boolean useCache){
  LocalFolder folder=null;
  if (Files.isReadable(path)) {
    if (useCache && folderCache.containsKey(path)) {
      folder=folderCache.get(path);
    }
 else {
      LocalFolderScannerContext context=new LocalFolderScannerContext(rootDir,fileSystemName,computationManager);
      for (      LocalFolderScanner folderScanner : folderScanners) {
        folder=folderScanner.scanFolder(path,context);
        if (folder != null) {
          break;
        }
      }
      folderCache.put(path,folder);
    }
  }
  return folder;
}

Fixed version (ground truth):
private LocalFolder scanFolder(Path path,boolean useCache){
  LocalFolder folder=null;
  if (Files.isReadable(path) && Files.isExecutable(path)) {
    if (useCache && folderCache.containsKey(path)) {
      folder=folderCache.get(path);
    }
 else {
      LocalFolderScannerContext context=new LocalFolderScannerContext(rootDir,fileSystemName,computationManager);
      for (      LocalFolderScanner folderScanner : folderScanners) {
        folder=folderScanner.scanFolder(path,context);
        if (folder != null) {
          break;
        }
      }
      folderCache.put(path,folder);
    }
  }
  return folder;
}
Program: 38783
Project: 38783
Buggy source:
void traverse(BusTerminal terminal,VoltageLevel.TopologyTraverser traverser,Set<Terminal> traversedTerminals){
  Objects.requireNonNull(terminal);
  Objects.requireNonNull(traverser);
  Objects.requireNonNull(traversedTerminals);
  if (traversedTerminals.contains(terminal)) {
    return;
  }
  List<TerminalExt> nextTerminals=new ArrayList<>();
  if (traverser.traverse(terminal,terminal.isConnected())) {
    traversedTerminals.add(terminal);
    addNextTerminals(terminal,nextTerminals);
    int v=getVertex(terminal.getConnectableBusId(),true);
    ConfiguredBus bus=graph.getVertexObject(v);
    bus.getTerminals().stream().filter(t -> t != terminal).filter(t -> traverser.traverse(t,t.isConnected())).forEach(t -> addNextTerminals(t,nextTerminals));
    graph.traverse(v,(v1,e,v2) -> {
      SwitchImpl aSwitch=graph.getEdgeObject(e);
      ConfiguredBus otherBus=graph.getVertexObject(v2);
      if (traverser.traverse(aSwitch)) {
        for (        BusTerminal otherTerminal : otherBus.getTerminals()) {
          if (traverser.traverse(otherTerminal,otherTerminal.isConnected())) {
            traversedTerminals.add(otherTerminal);
            addNextTerminals(otherTerminal,nextTerminals);
            return TraverseResult.CONTINUE;
          }
          return TraverseResult.TERMINATE;
        }
        return TraverseResult.CONTINUE;
      }
      return TraverseResult.TERMINATE;
    }
);
    nextTerminals.forEach(t -> t.traverse(traverser,traversedTerminals));
  }
}

Fixed version (ground truth):
void traverse(BusTerminal terminal,VoltageLevel.TopologyTraverser traverser,Set<Terminal> traversedTerminals){
  Objects.requireNonNull(terminal);
  Objects.requireNonNull(traverser);
  Objects.requireNonNull(traversedTerminals);
  if (traversedTerminals.contains(terminal)) {
    return;
  }
  List<TerminalExt> nextTerminals=new ArrayList<>();
  if (traverser.traverse(terminal,terminal.isConnected())) {
    traversedTerminals.add(terminal);
    addNextTerminals(terminal,nextTerminals);
    int v=getVertex(terminal.getConnectableBusId(),true);
    ConfiguredBus bus=graph.getVertexObject(v);
    bus.getTerminals().stream().filter(t -> t != terminal).filter(t -> traverser.traverse(t,t.isConnected())).forEach(t -> addNextTerminals(t,nextTerminals));
    graph.traverse(v,(v1,e,v2) -> {
      SwitchImpl aSwitch=graph.getEdgeObject(e);
      ConfiguredBus otherBus=graph.getVertexObject(v2);
      if (traverser.traverse(aSwitch)) {
        if (otherBus.getTerminalCount() == 0) {
          return TraverseResult.CONTINUE;
        }
        BusTerminal otherTerminal=otherBus.getTerminals().get(0);
        if (traverser.traverse(otherTerminal,otherTerminal.isConnected())) {
          traversedTerminals.add(otherTerminal);
          addNextTerminals(otherTerminal,nextTerminals);
          return TraverseResult.CONTINUE;
        }
      }
      return TraverseResult.TERMINATE;
    }
);
    nextTerminals.forEach(t -> t.traverse(traverser,traversedTerminals));
  }
}
Program: 38784
Project: 38784
Buggy source:
private void updateCache(){
  if (states.get().cache != null) {
    return;
  }
  Map<String,MergedBus> mergedBuses=new LinkedHashMap<>();
  Map<ConfiguredBus,MergedBus> mapping=new IdentityHashMap<>();
  boolean[] encountered=new boolean[graph.getMaxVertex()];
  Arrays.fill(encountered,false);
  int busNum=0;
  for (  int v : graph.getVertices()) {
    if (!encountered[v]) {
      final Set<ConfiguredBus> busSet=new LinkedHashSet<>(1);
      busSet.add(graph.getVertexObject(v));
      graph.traverse(v,(v1,e,v2) -> {
        SwitchImpl aSwitch=graph.getEdgeObject(e);
        if (aSwitch.isOpen()) {
          return TraverseResult.TERMINATE;
        }
 else {
          busSet.add(graph.getVertexObject(v2));
          return TraverseResult.CONTINUE;
        }
      }
,encountered);
      if (isBusValid(busSet)) {
        String mergedBusId=BusBreakerVoltageLevel.this.id + "String_Node_Str" + busNum++;
        MergedBus mergedBus=new MergedBus(mergedBusId,busSet);
        mergedBuses.put(mergedBus.getId(),mergedBus);
        for (        ConfiguredBus bus : busSet) {
          mapping.put(bus,mergedBus);
        }
      }
    }
  }
  states.get().cache=new BusCache(mergedBuses,mapping);
}

Fixed version (ground truth):
private void updateCache(){
  if (states.get().cache != null) {
    return;
  }
  Map<String,MergedBus> mergedBuses=new LinkedHashMap<>();
  Map<ConfiguredBus,MergedBus> mapping=new IdentityHashMap<>();
  boolean[] encountered=new boolean[graph.getMaxVertex()];
  Arrays.fill(encountered,false);
  int busNum=0;
  for (  int v : graph.getVertices()) {
    if (!encountered[v]) {
      final Set<ConfiguredBus> busSet=new LinkedHashSet<>(1);
      busSet.add(graph.getVertexObject(v));
      graph.traverse(v,(v1,e,v2) -> {
        SwitchImpl aSwitch=graph.getEdgeObject(e);
        if (aSwitch.isOpen()) {
          return TraverseResult.TERMINATE;
        }
 else {
          busSet.add(graph.getVertexObject(v2));
          return TraverseResult.CONTINUE;
        }
      }
,encountered);
      if (isBusValid(busSet)) {
        String mergedBusId=BusBreakerVoltageLevel.this.id + "String_Node_Str" + busNum++;
        MergedBus mergedBus=new MergedBus(mergedBusId,busSet);
        mergedBuses.put(mergedBus.getId(),mergedBus);
        busSet.forEach(bus -> mapping.put(bus,mergedBus));
      }
    }
  }
  states.get().cache=new BusCache(mergedBuses,mapping);
}
Program: 38785
Project: 38785
Buggy source:
private StateImpl(StateImpl other){
}

Fixed version (ground truth):
private StateImpl(){
}
Program: 38787
Project: 38787
Buggy source:
@Override public StateImpl copy(){
  return new StateImpl(this);
}

Fixed version (ground truth):
@Override public StateImpl copy(){
  return new StateImpl();
}
Program: 38788
Project: 38788
Buggy source:
@Override public void add(){
  if (node1 == null) {
    throw new ValidationException(this,"String_Node_Str");
  }
  if (node2 == null) {
    throw new ValidationException(this,"String_Node_Str");
  }
  int e=graph.addEdge(node1,node2,null);
  invalidateCache();
}

Fixed version (ground truth):
@Override public void add(){
  if (node1 == null) {
    throw new ValidationException(this,"String_Node_Str");
  }
  if (node2 == null) {
    throw new ValidationException(this,"String_Node_Str");
  }
  graph.addEdge(node1,node2,null);
  invalidateCache();
}
Program: 38789
Project: 38789
Buggy source:
private Integer getEdge(String switchId,boolean throwException){
  Integer edge=switches.get(switchId);
  if (throwException && edge == null) {
    throw new PowsyblException("String_Node_Str" + switchId + "String_Node_Str");
  }
  return edge;
}

Fixed version (ground truth):
private Integer getEdge(String switchId,boolean throwException){
  Integer edge=switches.get(switchId);
  if (throwException && edge == null) {
    throw createSwitchNotFoundException(switchId);
  }
  return edge;
}
Program: 38791
Project: 38791
Buggy source:
public DependencyCache(ProjectFile projectFile,String dependencyName,Class<T> dependencyClass){
  this.projectFile=Objects.requireNonNull(projectFile);
  this.dependencyName=Objects.requireNonNull(dependencyName);
  this.dependencyClass=Objects.requireNonNull(dependencyClass);
  projectFile.addListener(new DefaultProjectFileListener(){
    @Override public void dependencyChanged(    String name){
      if (dependencyName.equals(name)) {
        invalidate();
      }
    }
  }
);
}

Fixed version (ground truth):
public DependencyCache(ProjectFile projectFile,String dependencyName,Class<T> dependencyClass){
  this.projectFile=Objects.requireNonNull(projectFile);
  this.dependencyName=Objects.requireNonNull(dependencyName);
  this.dependencyClass=Objects.requireNonNull(dependencyClass);
  projectFile.addListener(l);
}
Program: 38792
Project: 38792
Buggy source:
protected ProjectFile(ProjectFileCreationContext context,int codeVersion,FileIcon icon){
  super(context,codeVersion,true);
  this.icon=Objects.requireNonNull(icon);
  storage.addListener(this,eventList -> {
    for (    NodeEvent event : eventList.getEvents()) {
      if (event.getId().equals(getId())) {
switch (event.getType()) {
case DEPENDENCY_ADDED:
case DEPENDENCY_REMOVED:
          listeners.notify(listener -> listener.dependencyChanged(((DependencyEvent)event).getDependencyName()));
        break;
case BACKWARD_DEPENDENCY_ADDED:
case BACKWARD_DEPENDENCY_REMOVED:
      listeners.notify(listener -> listener.backwardDependencyChanged(((DependencyEvent)event).getDependencyName()));
    break;
default :
  break;
}
}
}
}
);
}

Fixed version (ground truth):
protected ProjectFile(ProjectFileCreationContext context,int codeVersion,FileIcon icon){
  super(context,codeVersion,true);
  this.icon=Objects.requireNonNull(icon);
  storage.addListener(l);
}
Program: 38793
Project: 38793
Buggy source:
public void removeListener(ProjectFileListener listener){
  listeners.remove(this,listener);
}

Fixed version (ground truth):
public void removeListener(ProjectFileListener listener){
  listeners.remove(listener);
}
Program: 38794
Project: 38794
Buggy source:
public void addListener(ProjectFileListener listener){
  listeners.add(this,listener);
}

Fixed version (ground truth):
public void addListener(ProjectFileListener listener){
  listeners.add(listener);
}
Program: 38795
Project: 38795
Buggy source:
public void removeAllListeners(){
  listeners.removeAll(this);
}

Fixed version (ground truth):
public void removeAllListeners(){
  listeners.removeAll();
}
Program: 38796
Project: 38796
Buggy source:
public void removeListener(ProjectFolderListener listener){
  listeners.remove(this,listener);
}

Fixed version (ground truth):
public void removeListener(ProjectFolderListener listener){
  listeners.remove(listener);
}
Program: 38797
Project: 38797
Buggy source:
public ProjectFolder(ProjectFileCreationContext context){
  super(context,VERSION,true);
  storage.addListener(this,eventList -> {
    for (    NodeEvent event : eventList.getEvents()) {
switch (event.getType()) {
case NODE_CREATED:
        if (getId().equals(((NodeCreated)event).getParentId())) {
          listeners.notify(listener -> listener.childAdded(event.getId()));
        }
      break;
case NODE_REMOVED:
    if (getId().equals(((NodeRemoved)event).getParentId())) {
      listeners.notify(listener -> listener.childRemoved(event.getId()));
    }
  break;
default :
break;
}
}
}
);
}

Fixed version (ground truth):
public ProjectFolder(ProjectFileCreationContext context){
  super(context,VERSION,true);
  storage.addListener(l);
}
Program: 38798
Project: 38798
Buggy source:
public void addListener(ProjectFolderListener listener){
  listeners.add(this,listener);
}

Fixed version (ground truth):
public void addListener(ProjectFolderListener listener){
  listeners.add(listener);
}
Program: 38800
Project: 38800
Buggy source:
public AbstractModificationScript(ProjectFileCreationContext context,int codeVersion,FileIcon icon,String scriptContentName){
  super(context,codeVersion,icon);
  this.scriptContentName=Objects.requireNonNull(scriptContentName);
  storage.addListener(this,eventList -> processEvents(eventList.getEvents(),info.getId(),listeners));
}

Fixed version (ground truth):
public AbstractModificationScript(ProjectFileCreationContext context,int codeVersion,FileIcon icon,String scriptContentName){
  super(context,codeVersion,icon);
  this.scriptContentName=Objects.requireNonNull(scriptContentName);
  storage.addListener(l);
}
Program: 38801
Project: 38801
Buggy source:
@Override public void removeListeners(Object target){
  listeners.removeAll(target);
}

Fixed version (ground truth):
@Override public void removeListeners(){
  listeners.removeAll();
}
Program: 38802
Project: 38802
Buggy source:
@Override public void flush(){
  super.flush();
  lock.lock();
  try {
    listeners.notify(l -> l.onEvents(eventList));
    eventList=new NodeEventList();
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
@Override public void flush(){
  super.flush();
  lock.lock();
  try {
    listeners.log();
    listeners.notify(l -> l.onEvents(eventList));
    eventList=new NodeEventList();
  }
  finally {
    lock.unlock();
  }
}
Program: 38803
Project: 38803
Buggy source:
@Override public void addListener(Object target,AppStorageListener l){
  listeners.add(target,l);
}

Fixed version (ground truth):
@Override public void addListener(AppStorageListener l){
  listeners.add(l);
}
Program: 38804
Project: 38804
Buggy source:
void removeListeners(Object target);

Fixed version (ground truth):
void removeListeners();
Program: 38805
Project: 38805
Buggy source:
void addListener(Object target,AppStorageListener l);

Fixed version (ground truth):
void addListener(AppStorageListener l);
Program: 38806
Project: 38806
Buggy source:
@Before public void setUp() throws Exception {
  eventStack=new LinkedBlockingQueue<>();
  AppStorage storage=createStorage();
  if (storage instanceof ListenableAppStorage) {
    this.storage=(ListenableAppStorage)storage;
  }
 else {
    this.storage=new DefaultListenableAppStorage(storage);
  }
  this.storage.addListener(this,eventList -> eventStack.addAll(eventList.getEvents()));
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  eventStack=new LinkedBlockingQueue<>();
  AppStorage storage=createStorage();
  if (storage instanceof ListenableAppStorage) {
    this.storage=(ListenableAppStorage)storage;
  }
 else {
    this.storage=new DefaultListenableAppStorage(storage);
  }
  this.storage.addListener(l);
}
Program: 38807
Project: 38807
Buggy source:
@Before public void setUp(){
  AppStorage storage=Mockito.mock(AppStorage.class);
  Mockito.when(storage.createNode(Mockito.anyString(),Mockito.anyString(),Mockito.anyString(),Mockito.anyString(),Mockito.anyInt(),Mockito.any(NodeGenericMetadata.class))).thenReturn(new NodeInfo("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",0,0,0,new NodeGenericMetadata()));
  Mockito.when(storage.deleteNode("String_Node_Str")).thenReturn("String_Node_Str");
  Mockito.when(storage.writeBinaryData(Mockito.anyString(),Mockito.anyString())).thenReturn(new ByteArrayOutputStream());
  listenableStorage=new DefaultListenableAppStorage(storage);
  listenableStorage.addListener(this,eventList -> lastEventList=eventList);
}

Fixed version (ground truth):
@Before public void setUp(){
  AppStorage storage=Mockito.mock(AppStorage.class);
  Mockito.when(storage.createNode(Mockito.anyString(),Mockito.anyString(),Mockito.anyString(),Mockito.anyString(),Mockito.anyInt(),Mockito.any(NodeGenericMetadata.class))).thenReturn(new NodeInfo("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",0,0,0,new NodeGenericMetadata()));
  Mockito.when(storage.deleteNode("String_Node_Str")).thenReturn("String_Node_Str");
  Mockito.when(storage.writeBinaryData(Mockito.anyString(),Mockito.anyString())).thenReturn(new ByteArrayOutputStream());
  listenableStorage=new DefaultListenableAppStorage(storage);
  listenableStorage.addListener(l);
}
Program: 38808
Project: 38808
Buggy source:
@After public void tearDown(){
  listenableStorage.removeListeners(this);
}

Fixed version (ground truth):
@After public void tearDown(){
  listenableStorage.removeListeners();
}
Program: 38809
Project: 38809
Buggy source:
private UUID deleteNode(UUID nodeUuid){
  checkNodeExists(nodeUuid);
  if (nodeUuid.toString().equals(rootNodeVar.get().getId())) {
    throw new AfsStorageException("String_Node_Str");
  }
  for (  UUID childNodeUuid : childNodesMap.get(nodeUuid)) {
    deleteNode(childNodeUuid);
  }
  NodeInfo nodeInfo=nodeInfoMap.remove(nodeUuid);
  for (  String dataName : dataNamesMap.get(nodeUuid)) {
    dataMap.remove(new NamedLink(nodeUuid,dataName));
  }
  dataNamesMap.remove(nodeUuid);
  childNodesMap.remove(nodeUuid);
  UUID parentNodeUuid=parentNodeMap.remove(nodeUuid);
  removeFromList(childNodesMap,parentNodeUuid,nodeUuid);
  childNodeMap.remove(new NamedLink(parentNodeUuid,nodeInfo.getName()));
  for (  NamedLink link : dependencyNodesMap.get(nodeUuid)) {
    dependencyNodesByNameMap.remove(new NamedLink(nodeUuid,link.getName()));
    removeFromList(backwardDependencyNodesMap,link.getNodeUuid(),nodeUuid);
  }
  dependencyNodesMap.remove(nodeUuid);
  return parentNodeUuid;
}

Fixed version (ground truth):
private UUID deleteNode(UUID nodeUuid){
  checkNodeExists(nodeUuid);
  if (nodeUuid.toString().equals(rootNodeVar.get().getId())) {
    throw new AfsStorageException("String_Node_Str");
  }
  for (  UUID childNodeUuid : childNodesMap.get(nodeUuid)) {
    deleteNode(childNodeUuid);
  }
  NodeInfo nodeInfo=nodeInfoMap.remove(nodeUuid);
  for (  String dataName : dataNamesMap.get(nodeUuid)) {
    dataMap.remove(new NamedLink(nodeUuid,dataName));
  }
  dataNamesMap.remove(nodeUuid);
  childNodesMap.remove(nodeUuid);
  UUID parentNodeUuid=parentNodeMap.remove(nodeUuid);
  removeFromList(childNodesMap,parentNodeUuid,nodeUuid);
  childNodeMap.remove(new NamedLink(parentNodeUuid,nodeInfo.getName()));
  for (  UUID otherNodeUuid : backwardDependencyNodesMap.get(nodeUuid)) {
    List<NamedLink> linksToRemove=new ArrayList<>();
    for (    NamedLink link : dependencyNodesMap.get(otherNodeUuid)) {
      if (link.getNodeUuid().equals(nodeUuid)) {
        linksToRemove.add(link);
      }
    }
    for (    NamedLink linkToRemove : linksToRemove) {
      removeFromList(dependencyNodesMap,otherNodeUuid,linkToRemove);
      dependencyNodesByNameMap.remove(new NamedLink(otherNodeUuid,linkToRemove.getName()));
    }
  }
  for (  NamedLink link : dependencyNodesMap.get(nodeUuid)) {
    dependencyNodesByNameMap.remove(new NamedLink(nodeUuid,link.getName()));
    removeFromList(backwardDependencyNodesMap,link.getNodeUuid(),nodeUuid);
  }
  dependencyNodesMap.remove(nodeUuid);
  return parentNodeUuid;
}
Program: 38810
Project: 38810
Buggy source:
@Test public void parentChangeTest() throws IOException, InterruptedException {
  NodeInfo rootFolderInfo=storage.createRootNodeIfNotExists(storage.getFileSystemName(),FOLDER_PSEUDO_CLASS);
  NodeInfo folder1Info=storage.createNode(rootFolderInfo.getId(),"String_Node_Str",FOLDER_PSEUDO_CLASS,"String_Node_Str",0,new NodeGenericMetadata());
  NodeInfo folder2Info=storage.createNode(rootFolderInfo.getId(),"String_Node_Str",FOLDER_PSEUDO_CLASS,"String_Node_Str",0,new NodeGenericMetadata());
  storage.flush();
  eventStack.take();
  eventStack.take();
  eventStack.take();
  NodeInfo fileInfo=storage.createNode(folder1Info.getId(),"String_Node_Str","String_Node_Str","String_Node_Str",0,new NodeGenericMetadata());
  storage.flush();
  eventStack.take();
  assertEquals(folder1Info,storage.getParentNode(fileInfo.getId()).orElseThrow(AssertionError::new));
  storage.setParentNode(fileInfo.getId(),folder2Info.getId());
  storage.flush();
  assertEquals(new ParentChanged(fileInfo.getId()),eventStack.take());
  assertEquals(folder2Info,storage.getParentNode(fileInfo.getId()).orElseThrow(AssertionError::new));
  assertTrue(eventStack.isEmpty());
}

Fixed version (ground truth):
@Test public void parentChangeTest() throws InterruptedException {
  NodeInfo rootFolderInfo=storage.createRootNodeIfNotExists(storage.getFileSystemName(),FOLDER_PSEUDO_CLASS);
  NodeInfo folder1Info=storage.createNode(rootFolderInfo.getId(),"String_Node_Str",FOLDER_PSEUDO_CLASS,"String_Node_Str",0,new NodeGenericMetadata());
  NodeInfo folder2Info=storage.createNode(rootFolderInfo.getId(),"String_Node_Str",FOLDER_PSEUDO_CLASS,"String_Node_Str",0,new NodeGenericMetadata());
  storage.flush();
  eventStack.take();
  eventStack.take();
  eventStack.take();
  NodeInfo fileInfo=storage.createNode(folder1Info.getId(),"String_Node_Str","String_Node_Str","String_Node_Str",0,new NodeGenericMetadata());
  storage.flush();
  eventStack.take();
  assertEquals(folder1Info,storage.getParentNode(fileInfo.getId()).orElseThrow(AssertionError::new));
  storage.setParentNode(fileInfo.getId(),folder2Info.getId());
  storage.flush();
  assertEquals(new ParentChanged(fileInfo.getId()),eventStack.take());
  assertEquals(folder2Info,storage.getParentNode(fileInfo.getId()).orElseThrow(AssertionError::new));
  assertTrue(eventStack.isEmpty());
}
Program: 38811
Project: 38811
Buggy source:
@After public void tearDown() throws Exception {
  storage.close();
}

Fixed version (ground truth):
@After public void tearDown(){
  storage.close();
}
Program: 38812
Project: 38812
Buggy source:
private AtomicInteger getRuleMatchCountInternal(String ruleId){
  AtomicInteger count=rulesMatchCount.get(ruleId);
  if (count == null) {
    count=new AtomicInteger();
    rulesMatchCount.put(ruleId,count);
  }
  return count;
}

Fixed version (ground truth):
private AtomicInteger getRuleMatchCountInternal(String ruleId){
  return rulesMatchCount.computeIfAbsent(ruleId,k -> new AtomicInteger());
}