nus-yam/ex-repair huggingface dataset:
Program: 86863
Project: 86863
Buggy source:
/** 
 * Recursive method used to find all classes in a given directory and subdirs.
 * @param directory   The base directory
 * @param packageName The package name for classes found inside the base directory
 * @return The classes
 */
private List<Class<?>> findClasses(File directory,String packageName){
  List<Class<?>> classes=Lists.newArrayList();
  if (isJar(directory)) {
    List<File> files=classesFilesFromJar(directory,packageName);
    for (    File file : files) {
      classes.add(correspondingClass(packageName,file));
    }
  }
  if (!directory.exists()) {
    return classes;
  }
  File[] files=directory.listFiles();
  if (files != null) {
    for (    File file : files) {
      if (file.isDirectory()) {
        classes.addAll(findClasses(file,packageName + "String_Node_Str" + file.getName()));
      }
 else       if (file.getName().endsWith("String_Node_Str") && isNotAnInnerClass(file.getName())) {
        classes.add(correspondingClass(packageName,file));
      }
    }
  }
  return classes;
}

Fixed version (ground truth):
/** 
 * Recursive method used to find all classes in a given directory and subdirs.
 * @param directory   The base directory
 * @param packageName The package name for classes found inside the base directory
 * @return The classes
 */
private List<Class<?>> findClasses(File directory,String packageName){
  List<Class<?>> classes=Lists.newArrayList();
  if (isJar(directory)) {
    return classesFromJar(directory,packageName);
  }
  if (!directory.exists()) {
    return classes;
  }
  File[] files=directory.listFiles();
  if (files != null) {
    for (    File file : files) {
      if (file.isDirectory()) {
        classes.addAll(findClasses(file,packageName + "String_Node_Str" + file.getName()));
      }
 else       if (file.getName().endsWith("String_Node_Str") && isNotAnInnerClass(file.getName())) {
        classes.add(correspondingClass(packageName,file));
      }
    }
  }
  return classes;
}
Program: 86864
Project: 86864
Buggy source:
public void beforeStory(Story story,boolean b){
  currentStory=story;
  if (!isFixture(story)) {
    String requestedDriver=getRequestedDriver(story.getMeta());
    if (StringUtils.isNotEmpty(requestedDriver)) {
      ThucydidesWebDriverSupport.initialize(requestedDriver);
    }
 else {
      ThucydidesWebDriverSupport.initialize();
    }
    getThucydidesListeners().withDriver(ThucydidesWebDriverSupport.getDriver());
    String storyName=removeSuffixFrom(story.getName());
    String storyTitle=NameConverter.humanize(storyName);
    StepEventBus.getEventBus().testSuiteStarted(net.thucydides.core.model.Story.withId(storyName,storyTitle));
    registerStoryIssues(story.getMeta());
    registerStoryFeaturesAndEpics(story.getMeta());
    registerStoryTags(story.getMeta());
  }
}

Fixed version (ground truth):
public void beforeStory(Story story,boolean b){
  currentStory=story;
  if (!isFixture(story)) {
    System.out.println("String_Node_Str" + story.getName());
    String requestedDriver=getRequestedDriver(story.getMeta());
    if (StringUtils.isNotEmpty(requestedDriver)) {
      ThucydidesWebDriverSupport.initialize(requestedDriver);
    }
 else {
      ThucydidesWebDriverSupport.initialize();
    }
    ThucydidesStepFactory.resetContext();
    getThucydidesListeners().withDriver(ThucydidesWebDriverSupport.getDriver());
    String storyName=removeSuffixFrom(story.getName());
    String storyTitle=NameConverter.humanize(storyName);
    StepEventBus.getEventBus().testSuiteStarted(net.thucydides.core.model.Story.withId(storyName,storyTitle));
    registerTags(story);
  }
}
Program: 86865
Project: 86865
Buggy source:
public void afterStory(boolean given){
  if (isAfterStory(currentStory)) {
    generateReportsFor(baseStepListeners);
  }
 else   if (!isFixture(currentStory)) {
    StepEventBus.getEventBus().testSuiteFinished();
    clearListeners();
  }
}

Fixed version (ground truth):
public void afterStory(boolean given){
  if (isAfterStory(currentStory)) {
    ThucydidesWebDriverSupport.closeAllDrivers();
    generateReportsFor(baseStepListeners);
  }
 else   if (!isFixture(currentStory)) {
    StepEventBus.getEventBus().testSuiteFinished();
    clearListeners();
  }
}
Program: 86866
Project: 86866
Buggy source:
public Object newInstanceOf(final Class<?> type){
  try {
    ThucydidesWebDriverSupport.getPages();
    if (hasConstructorWithPagesParameter(type)) {
      return createNewPageEnabledStepCandidate(type);
    }
 else {
      return type.newInstance();
    }
  }
 catch (  Exception e) {
    throw new ThucydidesStepInitializationError(e);
  }
}

Fixed version (ground truth):
public Object newInstanceOf(final Class<?> type){
  if (stepInstances.containsKey(type)) {
    return stepInstances.get(type);
  }
 else {
    Object newInstance=null;
    try {
      ThucydidesWebDriverSupport.getPages();
      if (hasConstructorWithPagesParameter(type)) {
        newInstance=createNewPageEnabledStepCandidate(type);
      }
 else {
        newInstance=type.newInstance();
      }
    }
 catch (    Exception e) {
      throw new ThucydidesStepInitializationError(e);
    }
    stepInstances.put(type,newInstance);
    return newInstance;
  }
}
Program: 86867
Project: 86867
Buggy source:
public ThucydidesStepFactory(Configuration configuration,String rootPackage){
  super(configuration);
  this.context=new ThucydidesStepContext();
  this.rootPackage=rootPackage;
}

Fixed version (ground truth):
public ThucydidesStepFactory(Configuration configuration,String rootPackage){
  super(configuration);
  this.rootPackage=rootPackage;
}
Program: 86868
Project: 86868
Buggy source:
public Object createInstanceOfType(Class<?> type){
  Object stepsInstance=context.newInstanceOf(type);
  StepAnnotations.injectScenarioStepsInto(stepsInstance,getStepFactory());
  ThucydidesWebDriverSupport.initializeFieldsIn(stepsInstance);
  return stepsInstance;
}

Fixed version (ground truth):
public Object createInstanceOfType(Class<?> type){
  Object stepsInstance=getContext().newInstanceOf(type);
  StepAnnotations.injectScenarioStepsInto(stepsInstance,getStepFactory());
  ThucydidesWebDriverSupport.initializeFieldsIn(stepsInstance);
  return stepsInstance;
}
Program: 86869
Project: 86869
Buggy source:
protected ThucydidesListeners getThucydidesListeners(){
  if (thucydidesListenersThreadLocal.get() == null) {
    ThucydidesListeners listeners=ThucydidesReports.setupListeners(systemConfiguration);
    thucydidesListenersThreadLocal.set(listeners);
    baseStepListeners.add(listeners.getBaseStepListener());
  }
  return thucydidesListenersThreadLocal.get();
}

Fixed version (ground truth):
protected ThucydidesListeners getThucydidesListeners(){
  if (thucydidesListenersThreadLocal.get() == null) {
    System.out.println("String_Node_Str");
    ThucydidesListeners listeners=ThucydidesReports.setupListeners(systemConfiguration);
    thucydidesListenersThreadLocal.set(listeners);
synchronized (baseStepListeners) {
      baseStepListeners.add(listeners.getBaseStepListener());
    }
    System.out.println("String_Node_Str");
  }
  return thucydidesListenersThreadLocal.get();
}
Program: 86870
Project: 86870
Buggy source:
public void afterStory(boolean given){
  if (isAfterStory(currentStory)) {
    ThucydidesWebDriverSupport.closeAllDrivers();
    generateReportsFor(baseStepListeners);
  }
 else   if (!isFixture(currentStory)) {
    StepEventBus.getEventBus().testSuiteFinished();
    clearListeners();
  }
}

Fixed version (ground truth):
public void afterStory(boolean given){
  if (isAfterStory(currentStory)) {
    ThucydidesWebDriverSupport.closeAllDrivers();
    generateReports();
  }
 else   if (!isFixture(currentStory)) {
    StepEventBus.getEventBus().testSuiteFinished();
    clearListeners();
  }
}
Program: 86871
Project: 86871
Buggy source:
@Test public void stories_with_a_matching_name_can_be_run() throws Throwable {
  ThucydidesJUnitStories stories=new AStorySample("String_Node_Str");
  stories.setSystemConfiguration(systemConfiguration);
  stories.configuredEmbedder().configuration().storyReporterBuilder().withReporters(printOutput);
  run(stories);
  List<TestOutcome> outcomes=loadTestOutcomes();
  assertThat(outcomes.size(),is(3));
}

Fixed version (ground truth):
@Test public void stories_with_a_matching_name_can_be_run() throws Throwable {
  ThucydidesJUnitStories stories=new AStorySample("String_Node_Str");
  stories.setSystemConfiguration(systemConfiguration);
  stories.configuredEmbedder().configuration().storyReporterBuilder().withReporters(printOutput);
  run(stories);
  List<TestOutcome> outcomes=loadTestOutcomes();
  assertThat(outcomes.size(),is(6));
}
Program: 86872
Project: 86872
Buggy source:
@Test public void all_stories_on_the_classpath_should_be_run_by_default() throws Throwable {
  ThucydidesJUnitStories stories=new AllStoriesSample();
  stories.setSystemConfiguration(systemConfiguration);
  stories.configuredEmbedder().configuration().storyReporterBuilder().withReporters(printOutput);
  run(stories);
  List<TestOutcome> outcomes=loadTestOutcomes();
  assertThat(outcomes.size(),is(greaterThan(10)));
}

Fixed version (ground truth):
@Test public void all_stories_on_the_classpath_should_be_run_by_default() throws Throwable {
  ThucydidesJUnitStories stories=new AllStoriesSample();
  assertThat(stories.getRootPackage(),is("String_Node_Str"));
  assertThat(stories.getStoryPath(),is("String_Node_Str"));
}
Program: 86873
Project: 86873
Buggy source:
@Test public void a_subset_of_the_stories_can_be_run_individually() throws Throwable {
  ThucydidesJUnitStories stories=new StoriesInTheSubsetFolderSample();
  stories.setSystemConfiguration(systemConfiguration);
  stories.configuredEmbedder().configuration().storyReporterBuilder().withReporters(printOutput);
  run(stories);
  List<TestOutcome> outcomes=loadTestOutcomes();
  assertThat(outcomes.size(),is(2));
}

Fixed version (ground truth):
@Test public void a_subset_of_the_stories_can_be_run_individually() throws Throwable {
  ThucydidesJUnitStories stories=new StoriesInTheSubsetFolderSample();
  stories.setSystemConfiguration(systemConfiguration);
  stories.configuredEmbedder().configuration().storyReporterBuilder().withReporters(printOutput);
  run(stories);
  List<TestOutcome> outcomes=loadTestOutcomes();
  assertThat(outcomes.size(),is(5));
}
Program: 86874
Project: 86874
Buggy source:
public void failed(String stepTitle,Throwable cause){
  StepEventBus.getEventBus().updateCurrentStepTitle(stepTitle);
  StepEventBus.getEventBus().stepFailed(new StepFailure(ExecutedStepDescription.withTitle(normalized(stepTitle)),cause));
}

Fixed version (ground truth):
public void failed(String stepTitle,Throwable cause){
  StepEventBus.getEventBus().updateCurrentStepTitle(stepTitle);
  StepEventBus.getEventBus().stepFailed(new StepFailure(ExecutedStepDescription.withTitle(normalized(stepTitle)),cause));
  ThucydidesWebDriverSupport.closeAllDrivers();
}
Program: 86875
Project: 86875
Buggy source:
@Override public Configuration configuration(){
  return ThucydidesJBehave.defaultConfiguration(getSystemConfiguration());
}

Fixed version (ground truth):
@Override public Configuration configuration(){
  if (configuration == null) {
    configuration=ThucydidesJBehave.defaultConfiguration(getSystemConfiguration());
  }
  return configuration;
}
Program: 86876
Project: 86876
Buggy source:
protected void useDriver(String driver){
  System.setProperty("String_Node_Str",driver);
  ThucydidesWebDriverSupport.initialize(driver);
}

Fixed version (ground truth):
protected void useDriver(String driver){
  getSystemConfiguration().setIfUndefined(ThucydidesSystemProperty.DRIVER.getPropertyName(),driver);
  ThucydidesWebDriverSupport.initialize(driver);
}
Program: 86877
Project: 86877
Buggy source:
public void pending(String stepTitle){
  StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(stepTitle));
  StepEventBus.getEventBus().stepPending();
}

Fixed version (ground truth):
public void pending(String stepTitle){
  System.out.println("String_Node_Str" + stepTitle);
  (new Exception()).printStackTrace();
  StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(stepTitle));
  StepEventBus.getEventBus().stepPending();
}
Program: 86878
Project: 86878
Buggy source:
public void notPerformed(String stepTitle){
  StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(stepTitle));
  StepEventBus.getEventBus().stepIgnored();
}

Fixed version (ground truth):
public void notPerformed(String stepTitle){
  System.out.println("String_Node_Str" + stepTitle);
  StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(stepTitle));
  StepEventBus.getEventBus().stepIgnored();
}
Program: 86879
Project: 86879
Buggy source:
private void generateReportsFor(final List<TestOutcome> testRunResults){
  reportService.generateReportsFor(testRunResults);
}

Fixed version (ground truth):
private void generateReportsFor(final List<BaseStepListener> baseStepListeners){
  for (  BaseStepListener listener : baseStepListeners) {
    getReportService().generateReportsFor(listener.getTestOutcomes());
  }
}
Program: 86880
Project: 86880
Buggy source:
public ThucydidesReporter(Configuration systemConfiguration){
  this.systemConfiguration=systemConfiguration;
}

Fixed version (ground truth):
public ThucydidesReporter(Configuration systemConfiguration){
  this.systemConfiguration=systemConfiguration;
  thucydidesListenersThreadLocal=new ThreadLocal<ThucydidesListeners>();
  reportServiceThreadLocal=new ThreadLocal<ReportService>();
  baseStepListeners=Lists.newArrayList();
}
Program: 86881
Project: 86881
Buggy source:
public void successful(String title){
  StepEventBus.getEventBus().updateCurrentStepTitle(title);
  StepEventBus.getEventBus().stepFinished();
}

Fixed version (ground truth):
public void successful(String title){
  System.out.println("String_Node_Str" + title);
  StepEventBus.getEventBus().updateCurrentStepTitle(title);
  StepEventBus.getEventBus().stepFinished();
}
Program: 86882
Project: 86882
Buggy source:
public void beforeStory(Story story,boolean b){
  String requestedDriver=getRequestedDriver(story.getMeta());
  if (StringUtils.isNotEmpty(requestedDriver)) {
    ThucydidesWebDriverSupport.initialize(requestedDriver);
  }
  String storyName=removeSuffixFrom(story.getName());
  String storyTitle=NameConverter.humanize(storyName);
  reportService=ThucydidesReports.getReportService(systemConfiguration);
  thucydidesListeners=ThucydidesReports.setupListeners(systemConfiguration).withDriver(ThucydidesWebDriverSupport.getDriver());
  StepEventBus.getEventBus().testSuiteStarted(net.thucydides.core.model.Story.withId(storyName,storyTitle));
  registerStoryIssues(story.getMeta());
  registerStoryFeaturesAndEpics(story.getMeta());
  registerStoryTags(story.getMeta());
}

Fixed version (ground truth):
public void beforeStory(Story story,boolean b){
  System.out.println("String_Node_Str" + story.getName() + "String_Node_Str"+ Thread.currentThread());
  currentStory=story;
  if (!isFixture(story)) {
    String requestedDriver=getRequestedDriver(story.getMeta());
    if (StringUtils.isNotEmpty(requestedDriver)) {
      ThucydidesWebDriverSupport.initialize(requestedDriver);
    }
 else {
      ThucydidesWebDriverSupport.initialize();
    }
    getThucydidesListeners().withDriver(ThucydidesWebDriverSupport.getDriver());
    String storyName=removeSuffixFrom(story.getName());
    String storyTitle=NameConverter.humanize(storyName);
    StepEventBus.getEventBus().testSuiteStarted(net.thucydides.core.model.Story.withId(storyName,storyTitle));
    registerStoryIssues(story.getMeta());
    registerStoryFeaturesAndEpics(story.getMeta());
    registerStoryTags(story.getMeta());
  }
}
Program: 86883
Project: 86883
Buggy source:
public void failed(String stepTitle,Throwable cause){
  StepEventBus.getEventBus().updateCurrentStepTitle(stepTitle);
  StepEventBus.getEventBus().stepFailed(new StepFailure(ExecutedStepDescription.withTitle(stepTitle),cause));
}

Fixed version (ground truth):
public void failed(String stepTitle,Throwable cause){
  System.out.println("String_Node_Str" + stepTitle);
  StepEventBus.getEventBus().updateCurrentStepTitle(stepTitle);
  StepEventBus.getEventBus().stepFailed(new StepFailure(ExecutedStepDescription.withTitle(stepTitle),cause));
}
Program: 86884
Project: 86884
Buggy source:
public void afterScenario(){
  StepEventBus.getEventBus().testFinished();
}

Fixed version (ground truth):
public void afterScenario(){
  System.out.println("String_Node_Str" + currentStory.getName());
  StepEventBus.getEventBus().testFinished();
}
Program: 86885
Project: 86885
Buggy source:
public void storyCancelled(Story story,StoryDuration storyDuration){
}

Fixed version (ground truth):
public void storyCancelled(Story story,StoryDuration storyDuration){
  System.out.println("String_Node_Str" + story.getName());
}
Program: 86886
Project: 86886
Buggy source:
public void ignorable(String title){
  StepEventBus.getEventBus().updateCurrentStepTitle(title);
  StepEventBus.getEventBus().stepIgnored();
}

Fixed version (ground truth):
public void ignorable(String title){
  System.out.println("String_Node_Str" + title);
  StepEventBus.getEventBus().updateCurrentStepTitle(title);
  StepEventBus.getEventBus().stepIgnored();
}
Program: 86887
Project: 86887
Buggy source:
public void afterStory(boolean b){
  StepEventBus.getEventBus().testSuiteFinished();
  generateReportsFor(thucydidesListeners.getResults());
}

Fixed version (ground truth):
public void afterStory(boolean given){
  System.out.println("String_Node_Str" + currentStory.getName());
  if (isAfterStory(currentStory)) {
    generateReportsFor(baseStepListeners);
  }
 else   if (!isFixture(currentStory)) {
    StepEventBus.getEventBus().testSuiteFinished();
    clearListeners();
  }
}
Program: 86888
Project: 86888
Buggy source:
public APassingWebTestSampleWithASpecifiedBrowser(){
  findStoriesCalled("String_Node_Str");
  useDriver("String_Node_Str");
}

Fixed version (ground truth):
public APassingWebTestSampleWithASpecifiedBrowser(){
  findStoriesCalled("String_Node_Str");
  runThucydides().withDriver("String_Node_Str");
}
Program: 86889
Project: 86889
Buggy source:
@Test public void a_data_driven_test_should_produce_a_successful_result_if_all_rows_are_successful() throws Throwable {
  ThucydidesJUnitStories story=new AStorySample("String_Node_Str");
  story.setSystemConfiguration(systemConfiguration);
  story.configuredEmbedder().configuration().storyReporterBuilder().withReporters(printOutput);
  run(story);
  List<TestOutcome> outcomes=loadTestOutcomes();
  assertThat(outcomes.get(0).getResult(),is(TestResult.SUCCESS));
}

Fixed version (ground truth):
@Test public void a_data_driven_test_should_produce_a_successful_result_if_all_rows_are_successful() throws Throwable {
  ThucydidesJUnitStories story=new AStorySample("String_Node_Str");
  story.setSystemConfiguration(systemConfiguration);
  story.configuredEmbedder().configuration().storyReporterBuilder().withReporters(printOutput);
  run(story);
  List<TestOutcome> outcomes=loadTestOutcomes();
  assertThat(outcomes.get(0).getResult(),is(TestResult.SUCCESS));
  assertThat(outcomes.get(1).getResult(),is(TestResult.SUCCESS));
}
Program: 86890
Project: 86890
Buggy source:
@Test public void a_data_driven_test_should_produce_a_set_of_steps_per_line_of_data() throws Throwable {
  ThucydidesJUnitStories story=new AStorySample("String_Node_Str");
  story.setSystemConfiguration(systemConfiguration);
  story.configuredEmbedder().configuration().storyReporterBuilder().withReporters(printOutput);
  run(story);
  List<TestOutcome> outcomes=loadTestOutcomes();
  assertThat(outcomes.size(),is(1));
  assertThat(outcomes.get(0).getTestSteps().size(),is(9));
}

Fixed version (ground truth):
@Test public void a_data_driven_test_should_produce_a_set_of_steps_per_line_of_data() throws Throwable {
  ThucydidesJUnitStories story=new AStorySample("String_Node_Str");
  story.setSystemConfiguration(systemConfiguration);
  story.configuredEmbedder().configuration().storyReporterBuilder().withReporters(printOutput);
  run(story);
  List<TestOutcome> outcomes=loadTestOutcomes();
  assertThat(outcomes.size(),is(2));
  assertThat(outcomes.get(0).getTestSteps().size(),is(9));
}
Program: 86891
Project: 86891
Buggy source:
@Test public void web_tests_should_take_screenshots_for_multiple_tests() throws Throwable {
  ThucydidesJUnitStories story=new AStorySample("String_Node_Str");
  story.setSystemConfiguration(systemConfiguration);
  story.configuredEmbedder().configuration().storyReporterBuilder().withReporters(printOutput);
  run(story);
  List<TestOutcome> outcomes=loadTestOutcomes();
  assertThat(outcomes.get(0).getScreenshots().size(),greaterThan(0));
}

Fixed version (ground truth):
@Test public void web_tests_should_take_screenshots_for_multiple_tests() throws Throwable {
  ThucydidesJUnitStories story=new AStorySample("String_Node_Str");
  story.setSystemConfiguration(systemConfiguration);
  story.configuredEmbedder().configuration().storyReporterBuilder().withReporters(printOutput);
  run(story);
  List<TestOutcome> outcomes=loadTestOutcomes();
  assertThat(outcomes.get(0).getScreenshots().size(),greaterThan(0));
  assertThat(outcomes.get(1).getScreenshots().size(),greaterThan(0));
}
Program: 86892
Project: 86892
Buggy source:
/** 
 * Writes the new JPEG to the given output stream. The stream is not closed. The IPTC metadata are replaced if there were modified.
 * @param fos the output stream
 * @throws IOException if the image can't be written
 */
public void write(OutputStream fos) throws IOException {
  try {
    PhotoshopApp13Data data=m_image.getMetadata().getExtendedMetadata().getPhotoshopApp13Data();
    if (data != null) {
      replaceIPTCMetadata(data);
    }
    String xmp=m_image.getMetadata().getXmp();
    if (xmp != null) {
      List newPieces=new ArrayList();
      m_pieces=removeXmpSegments(m_pieces);
      int segmentSize=Math.min(xmp.getBytes().length,MAX_SEGMENT_SIZE);
      byte segmentData[]=writeXmpSegment(m_image.getMetadata().getXmp().getBytes("String_Node_Str"),0,segmentSize);
      newPieces.add(new JFIFPieceSegment(JPEG_APP1_Marker,segmentData));
      m_pieces=insertAfterLastAppSegments(m_pieces,newPieces);
    }
    writeSegments(fos,(List<JFIFPiece>)m_pieces);
  }
 catch (  ImageWriteException e) {
    throw new IOException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * Writes the new JPEG to the given output stream. The stream is not closed. The IPTC metadata are replaced if there were modified.
 * @param fos the output stream
 * @throws IOException if the image can't be written
 */
public void write(OutputStream fos) throws IOException {
  try {
    PhotoshopApp13Data data=m_image.getMetadata().getExtendedMetadata().getPhotoshopApp13Data();
    if (data != null) {
      replaceIPTCMetadata(data);
    }
    String xmp=m_image.getMetadata().getXmp();
    if (xmp != null) {
      List newPieces=new ArrayList();
      m_pieces=removeXmpSegments(m_pieces);
      int segmentSize=Math.min(xmp.getBytes().length,MAX_SEGMENT_SIZE);
      byte segmentData[]=writeXmpSegment(m_image.getMetadata().getXmp().getBytes(),0,segmentSize);
      newPieces.add(new JFIFPieceSegment(JPEG_APP1_Marker,segmentData));
      m_pieces=insertAfterLastAppSegments(m_pieces,newPieces);
    }
    writeSegments(fos,(List<JFIFPiece>)m_pieces);
  }
 catch (  ImageWriteException e) {
    throw new IOException(e.getMessage(),e);
  }
}
Program: 86893
Project: 86893
Buggy source:
/** 
 * Reads a   {@link BufferedImage} from the given byte array.
 * @param bytes the bytes
 * @return the {@link BufferedImage}
 * @throws IOException if the byte array is <code>null</code>,or does not depict an image
 */
public BufferedImage read(byte[] bytes) throws IOException {
  if (bytes == null) {
    throw new IOException("String_Node_Str" + "String_Node_Str");
  }
  InputStream is=new ByteArrayInputStream(bytes);
  BufferedImage img=ImageIO.read(is);
  closeQuietly(is);
  return img;
}

Fixed version (ground truth):
/** 
 * Reads a   {@link BufferedImage} from the given byte array.
 * @param bytes the bytes
 * @return the {@link BufferedImage}
 * @throws IOException if the byte array is <code>null</code>,or does not depict an image
 */
public BufferedImage read(byte[] bytes) throws IOException {
  if (bytes == null) {
    throw new IOException("String_Node_Str" + "String_Node_Str");
  }
  InputStream is=new ByteArrayInputStream(bytes);
  try {
    BufferedImage img=Sanselan.getBufferedImage(bytes);
    return img;
  }
 catch (  ImageReadException e) {
    throw new IOException("String_Node_Str",e);
  }
 finally {
    closeQuietly(is);
  }
}
Program: 86895
Project: 86895
Buggy source:
/** 
 * Stop services IF nothing is using them
 */
private static synchronized void stopIfIdle(){
  if (initialized && startCount == 0) {
    if (!logger.isLogging() && !audible.isEnabled()) {
      Log.i(TAG,"String_Node_Str");
      cloud.stop();
      notifications.stop();
      audible.stop();
      flightComputer.stop();
      alti.stop();
      sensors.stop();
      location.stop();
      logger.stop();
      bluetooth.stop();
      initialized=false;
    }
 else {
      if (logger.isLogging()) {
        Log.w(TAG,"String_Node_Str");
      }
      if (audible.isEnabled()) {
        Log.w(TAG,"String_Node_Str");
      }
      handler.postDelayed(stopRunnable,shutdownDelay);
    }
  }
}

Fixed version (ground truth):
/** 
 * Stop services IF nothing is using them
 */
private static synchronized void stopIfIdle(){
  if (initialized && startCount == 0) {
    if (!logger.isLogging() && !audible.isEnabled()) {
      Log.i(TAG,"String_Node_Str");
      cloud.stop();
      notifications.stop();
      audible.stop();
      flightComputer.stop();
      alti.stop();
      sensors.stop();
      location.stop();
      logger.stop();
      trackStore.stop();
      bluetooth.stop();
      initialized=false;
    }
 else {
      if (logger.isLogging()) {
        Log.w(TAG,"String_Node_Str");
      }
      if (audible.isEnabled()) {
        Log.w(TAG,"String_Node_Str");
      }
      handler.postDelayed(stopRunnable,shutdownDelay);
    }
  }
}
Program: 86896
Project: 86896
Buggy source:
private void upload(@NonNull TrackFile trackFile){
  Services.trackStore.setUploading(trackFile);
  new Thread(new UploadTask(context,trackFile)).start();
}

Fixed version (ground truth):
private void upload(@NonNull TrackFile trackFile){
  final boolean networkAvailable=Network.isAvailable(context);
  if (!networkAvailable) {
    Log.w(TAG,"String_Node_Str");
    return;
  }
  uploading=true;
  uploadingTrack=trackFile;
  Services.trackStore.setUploading(trackFile);
  new Thread(new UploadTask(context,trackFile)).start();
}
Program: 86897
Project: 86897
Buggy source:
@Subscribe(threadMode=ThreadMode.ASYNC) public void onLoggingEvent(@NonNull LoggingEvent event){
  if (BaseActivity.currentAuthState == AuthEvent.SIGNED_IN && !event.started) {
    Log.i(TAG,"String_Node_Str" + event.trackFile);
    Exceptions.log("String_Node_Str" + event.trackFile);
    upload(event.trackFile);
  }
}

Fixed version (ground truth):
@Subscribe(threadMode=ThreadMode.ASYNC) public void onLoggingEvent(@NonNull LoggingEvent event){
  if (BaseActivity.currentAuthState == AuthEvent.SIGNED_IN && !event.started) {
    if (!uploading) {
      Log.i(TAG,"String_Node_Str" + event.trackFile);
      upload(event.trackFile);
    }
  }
}
Program: 86898
Project: 86898
Buggy source:
private void uploadAll(){
  if (BaseActivity.currentAuthState == AuthEvent.SIGNED_IN) {
    for (    TrackFile trackFile : Services.trackStore.getLocalTracks()) {
      Log.i(TAG,"String_Node_Str" + trackFile);
      upload(trackFile);
    }
  }
}

Fixed version (ground truth):
/** 
 * Upload the first track waiting to upload
 */
private void uploadAll(){
  if (BaseActivity.currentAuthState != AuthEvent.SIGNED_IN) {
    return;
  }
  if (!uploading) {
    final List<TrackFile> tracks=Services.trackStore.getLocalTracks();
    if (!tracks.isEmpty()) {
      TrackFile firstTrackFile=tracks.get(0);
      Log.i(TAG,"String_Node_Str" + firstTrackFile);
      upload(firstTrackFile);
    }
  }
}
Program: 86899
Project: 86899
Buggy source:
@Subscribe(threadMode=ThreadMode.MAIN) public void onUploadSuccess(@NonNull SyncEvent.UploadSuccess event){
  Services.trackStore.setUploadSuccess(event.trackFile,event.cloudData);
}

Fixed version (ground truth):
@Subscribe(threadMode=ThreadMode.ASYNC) public void onUploadSuccess(@NonNull SyncEvent.UploadSuccess event){
  Services.trackStore.setUploadSuccess(event.trackFile,event.cloudData);
  if (event.trackFile == uploadingTrack) {
    uploading=false;
    uploadingTrack=null;
    uploadAll();
  }
 else {
    Log.e(TAG,"String_Node_Str");
  }
}
Program: 86900
Project: 86900
Buggy source:
@Subscribe(threadMode=ThreadMode.MAIN) public void onUploadFailure(@NonNull SyncEvent.UploadFailure event){
  Services.trackStore.setNotUploaded(event.trackFile);
}

Fixed version (ground truth):
@Subscribe(threadMode=ThreadMode.ASYNC) public void onUploadFailure(@NonNull SyncEvent.UploadFailure event){
  Services.trackStore.setNotUploaded(event.trackFile);
  if (event.trackFile == uploadingTrack) {
    uploading=false;
    uploadingTrack=null;
  }
 else {
    Log.e(TAG,"String_Node_Str");
  }
}
Program: 86901
Project: 86901
Buggy source:
@Override public void run(){
  Log.i(TAG,"String_Node_Str" + trackFile);
  final boolean networkAvailable=Network.isAvailable(context);
  try {
    final String authToken=AuthToken.getAuthToken(context);
    final CloudData trackData=postTrack(trackFile,authToken);
    archive(trackData);
    Services.cloud.tracks.addTrackData(trackData);
    Services.cloud.listing.listAsync(authToken,true);
    Log.i(TAG,"String_Node_Str" + trackData.track_id);
    EventBus.getDefault().post(new SyncEvent.UploadSuccess(trackFile,trackData));
  }
 catch (  AuthException e) {
    Log.e(TAG,"String_Node_Str",e);
    Exceptions.report(e);
    EventBus.getDefault().post(new SyncEvent.UploadFailure(trackFile,"String_Node_Str"));
  }
catch (  IOException e) {
    if (networkAvailable) {
      Log.e(TAG,"String_Node_Str",e);
      Exceptions.report(e);
    }
 else {
      Log.w(TAG,"String_Node_Str",e);
    }
    EventBus.getDefault().post(new SyncEvent.UploadFailure(trackFile,e.getMessage()));
  }
catch (  JSONException e) {
    Log.e(TAG,"String_Node_Str",e);
    Exceptions.report(e);
    EventBus.getDefault().post(new SyncEvent.UploadFailure(trackFile,"String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void run(){
  Log.i(TAG,"String_Node_Str" + trackFile);
  final boolean networkAvailable=Network.isAvailable(context);
  try {
    final String authToken=AuthToken.getAuthToken(context);
    final CloudData trackData=postTrack(trackFile,authToken);
    archive(trackData);
    Services.cloud.tracks.addTrackData(trackData);
    Services.cloud.listing.listAsync(authToken,true);
    Log.i(TAG,"String_Node_Str" + trackData.track_id);
    EventBus.getDefault().post(new SyncEvent.UploadSuccess(trackFile,trackData));
  }
 catch (  AuthException e) {
    if (networkAvailable) {
      Log.e(TAG,"String_Node_Str",e);
      Exceptions.report(e);
    }
 else {
      Log.w(TAG,"String_Node_Str",e);
    }
    EventBus.getDefault().post(new SyncEvent.UploadFailure(trackFile,"String_Node_Str"));
  }
catch (  IOException e) {
    if (networkAvailable) {
      Log.e(TAG,"String_Node_Str",e);
      Exceptions.report(e);
    }
 else {
      Log.w(TAG,"String_Node_Str",e);
    }
    EventBus.getDefault().post(new SyncEvent.UploadFailure(trackFile,e.getMessage()));
  }
catch (  JSONException e) {
    Log.e(TAG,"String_Node_Str",e);
    Exceptions.report(e);
    EventBus.getDefault().post(new SyncEvent.UploadFailure(trackFile,"String_Node_Str"));
  }
}
Program: 86902
Project: 86902
Buggy source:
@NonNull static List<TrackFile> getTracks(@NonNull Context context){
  final List<TrackFile> tracks=new ArrayList<>();
  final File logDir=getTrackDirectory(context);
  if (logDir != null) {
    final File[] files=logDir.listFiles();
    for (    File file : files) {
      final String filename=file.getName();
      final TrackFile trackFile=new TrackFile(file);
      final boolean matchesFilenamePattern=filename.startsWith("String_Node_Str") && filename.endsWith("String_Node_Str");
      if (matchesFilenamePattern) {
        tracks.add(trackFile);
      }
    }
    Collections.sort(tracks,(track1,track2) -> -track1.getName().compareTo(track2.getName()));
    return tracks;
  }
 else {
    Log.e(TAG,"String_Node_Str");
    return tracks;
  }
}

Fixed version (ground truth):
@NonNull static List<TrackFile> getTracks(@NonNull Context context){
  final List<TrackFile> tracks=new ArrayList<>();
  final File logDir=getTrackDirectory(context);
  if (logDir != null) {
    final File[] files=logDir.listFiles();
    for (    File file : files) {
      final String filename=file.getName();
      final TrackFile trackFile=new TrackFile(file);
      final boolean matchesFilenamePattern=filename.startsWith("String_Node_Str") && filename.endsWith("String_Node_Str");
      if (matchesFilenamePattern) {
        tracks.add(trackFile);
      }
    }
    return tracks;
  }
 else {
    Log.e(TAG,"String_Node_Str");
    return tracks;
  }
}
Program: 86903
Project: 86903
Buggy source:
/** 
 * Return non-uploaded and non-recording tracks. In other words, the things we should list in track listing view.
 */
public List<TrackFile> getLocalTracks(){
  final List<TrackFile> tracks=new ArrayList<>();
  for (  TrackState state : trackState.values()) {
    if (state instanceof TrackState.TrackNotUploaded) {
      final TrackFile trackFile=((TrackState.TrackNotUploaded)state).trackFile;
      tracks.add(trackFile);
    }
 else     if (state instanceof TrackState.TrackUploading) {
      final TrackFile trackFile=((TrackState.TrackUploading)state).trackFile;
      tracks.add(trackFile);
    }
  }
  return tracks;
}

Fixed version (ground truth):
/** 
 * Return non-uploaded and non-recording tracks. In other words, the things we should list in track listing view.
 */
public List<TrackFile> getLocalTracks(){
  if (!initialized) {
    Log.e(TAG,"String_Node_Str");
  }
  final List<TrackFile> tracks=new ArrayList<>();
  for (  TrackState state : trackState.values()) {
    if (state instanceof TrackState.TrackNotUploaded) {
      final TrackFile trackFile=((TrackState.TrackNotUploaded)state).trackFile;
      tracks.add(trackFile);
    }
 else     if (state instanceof TrackState.TrackUploading) {
      final TrackFile trackFile=((TrackState.TrackUploading)state).trackFile;
      tracks.add(trackFile);
    }
  }
  Collections.sort(tracks,(track1,track2) -> -track1.getName().compareTo(track2.getName()));
  return tracks;
}
Program: 86904
Project: 86904
Buggy source:
public void setUploading(@NonNull TrackFile trackFile){
  final String filename=trackFile.file.getName();
  final TrackState state=trackState.get(filename);
  if (state != null && state instanceof TrackState.TrackNotUploaded) {
    trackState.put(filename,new TrackState.TrackUploading(trackFile));
  }
 else {
    Log.e(TAG,"String_Node_Str" + state + "String_Node_Str");
  }
}

Fixed version (ground truth):
public void setUploading(@NonNull TrackFile trackFile){
  final TrackState state=trackState.get(trackFile);
  if (state != null && state instanceof TrackState.TrackNotUploaded) {
    trackState.put(trackFile,new TrackState.TrackUploading(trackFile));
  }
 else {
    Log.e(TAG,"String_Node_Str" + state + "String_Node_Str");
  }
}
Program: 86905
Project: 86905
Buggy source:
public void setUploadSuccess(@NonNull TrackFile trackFile,@NonNull CloudData cloudData){
  final String filename=trackFile.file.getName();
  trackState.put(filename,new TrackState.TrackUploaded(cloudData));
}

Fixed version (ground truth):
public void setUploadSuccess(@NonNull TrackFile trackFile,@NonNull CloudData cloudData){
  trackState.put(trackFile,new TrackState.TrackUploaded(cloudData));
}
Program: 86906
Project: 86906
Buggy source:
public int getUploadProgress(@NonNull TrackFile trackFile){
  final String filename=trackFile.file.getName();
  final TrackState state=trackState.get(filename);
  if (state != null && state instanceof TrackState.TrackUploading) {
    return ((TrackState.TrackUploading)state).progress;
  }
 else {
    Log.e(TAG,"String_Node_Str" + state);
    return 0;
  }
}

Fixed version (ground truth):
public int getUploadProgress(@NonNull TrackFile trackFile){
  final TrackState state=trackState.get(trackFile);
  if (state != null && state instanceof TrackState.TrackUploading) {
    return ((TrackState.TrackUploading)state).progress;
  }
 else {
    Log.e(TAG,"String_Node_Str" + state);
    return 0;
  }
}
Program: 86907
Project: 86907
Buggy source:
void setRecording(@NonNull TrackFile trackFile){
  final String filename=trackFile.file.getName();
  trackState.put(filename,new TrackState.TrackRecording());
}

Fixed version (ground truth):
void setRecording(@NonNull TrackFile trackFile){
  trackState.put(trackFile,new TrackState.TrackRecording());
}
Program: 86908
Project: 86908
Buggy source:
@Nullable public CloudData getCloudData(@NonNull TrackFile trackFile){
  final String filename=trackFile.file.getName();
  final TrackState state=trackState.get(filename);
  if (state != null && state instanceof TrackState.TrackUploaded) {
    return ((TrackState.TrackUploaded)state).cloudData;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Nullable public CloudData getCloudData(@NonNull TrackFile trackFile){
  final TrackState state=trackState.get(trackFile);
  if (state != null && state instanceof TrackState.TrackUploaded) {
    return ((TrackState.TrackUploaded)state).cloudData;
  }
 else {
    return null;
  }
}
Program: 86909
Project: 86909
Buggy source:
public void setUploadProgress(@NonNull TrackFile trackFile,int bytesCopied){
  final String filename=trackFile.file.getName();
  final TrackState state=trackState.get(filename);
  if (state != null && state instanceof TrackState.TrackUploading) {
    ((TrackState.TrackUploading)state).progress=bytesCopied;
  }
 else {
    Log.e(TAG,"String_Node_Str" + state);
  }
}

Fixed version (ground truth):
public void setUploadProgress(@NonNull TrackFile trackFile,int bytesCopied){
  final TrackState state=trackState.get(trackFile);
  if (state != null && state instanceof TrackState.TrackUploading) {
    ((TrackState.TrackUploading)state).progress=bytesCopied;
  }
 else {
    Log.e(TAG,"String_Node_Str" + state);
  }
}
Program: 86910
Project: 86910
Buggy source:
public void start(@NonNull Context context){
  if (!initialized) {
    initialized=true;
    final List<TrackFile> trackFiles=TrackFiles.getTracks(context);
    for (    TrackFile trackFile : trackFiles) {
      trackState.put(trackFile.getName(),new TrackState.TrackNotUploaded(trackFile));
    }
  }
 else {
  }
}

Fixed version (ground truth):
public void start(@NonNull Context context){
  if (!initialized) {
    initialized=true;
    final List<TrackFile> trackFiles=TrackFiles.getTracks(context);
    for (    TrackFile trackFile : trackFiles) {
      trackState.put(trackFile,new TrackState.TrackNotUploaded(trackFile));
    }
  }
 else {
  }
}
Program: 86911
Project: 86911
Buggy source:
public void setNotUploaded(@NonNull TrackFile trackFile){
  final String filename=trackFile.file.getName();
  trackState.put(filename,new TrackState.TrackNotUploaded(trackFile));
}

Fixed version (ground truth):
public void setNotUploaded(@NonNull TrackFile trackFile){
  trackState.put(trackFile,new TrackState.TrackNotUploaded(trackFile));
}
Program: 86912
Project: 86912
Buggy source:
public boolean isUploading(@NonNull TrackFile trackFile){
  final String filename=trackFile.file.getName();
  final TrackState state=trackState.get(filename);
  return state != null && state instanceof TrackState.TrackUploading;
}

Fixed version (ground truth):
public boolean isUploading(@NonNull TrackFile trackFile){
  final TrackState state=trackState.get(trackFile);
  return state != null && state instanceof TrackState.TrackUploading;
}
Program: 86913
Project: 86913
Buggy source:
public void upload(TrackFile trackFile,Callback<CloudData> cb){
  new UploadTask(context,trackFile,cb).execute();
}

Fixed version (ground truth):
public void upload(TrackFile trackFile,Callback<CloudData> cb){
  FirebaseCrash.log("String_Node_Str" + trackFile.getName());
  new UploadTask(context,trackFile,cb).execute();
}
Program: 86914
Project: 86914
Buggy source:
@Subscribe(threadMode=ThreadMode.ASYNC) public void onLoggingEvent(LoggingEvent event){
  if (BaseActivity.currentState == AuthEvent.SIGNED_IN && autosyncEnabled && !event.started) {
    Log.i(TAG,"String_Node_Str" + event.trackFile);
    upload(event.trackFile,null);
  }
}

Fixed version (ground truth):
@Subscribe(threadMode=ThreadMode.ASYNC) public void onLoggingEvent(LoggingEvent event){
  if (BaseActivity.currentState == AuthEvent.SIGNED_IN && autosyncEnabled && !event.started) {
    Log.i(TAG,"String_Node_Str" + event.trackFile);
    FirebaseCrash.log("String_Node_Str" + event.trackFile.getName());
    new UploadTask(context,event.trackFile,null).execute();
  }
}
Program: 86915
Project: 86915
Buggy source:
/** 
 * Move the track file to synced directory
 */
public void archive(){
  final File syncedDir=new File(file.getParentFile(),"String_Node_Str");
  if (!syncedDir.exists()) {
    syncedDir.mkdir();
  }
  final File destination=new File(syncedDir,file.getName());
  file.renameTo(destination);
}

Fixed version (ground truth):
/** 
 * Move the track file to synced directory
 */
public void archive(){
  Log.i(TAG,"String_Node_Str" + file.getName());
  final File syncedDir=new File(file.getParentFile(),"String_Node_Str");
  if (!syncedDir.exists()) {
    syncedDir.mkdir();
  }
  final File destination=new File(syncedDir,file.getName());
  if (file.renameTo(destination)) {
    file=destination;
  }
}
Program: 86916
Project: 86916
Buggy source:
private void handleSignInResult(GoogleSignInResult result){
  Log.d(TAG,"String_Node_Str" + result.getStatus());
  if (result.isSuccess()) {
    account=result.getSignInAccount();
    if (account != null) {
      Log.i(TAG,"String_Node_Str" + account.getDisplayName());
      BaselineCloud.listAsync(account.getIdToken(),false);
    }
    updateState(AuthEvent.SIGNED_IN);
  }
 else {
    Log.w(TAG,"String_Node_Str");
    BaselineCloud.signOut();
    updateState(AuthEvent.SIGNED_OUT);
  }
  userClickedSignIn=false;
}

Fixed version (ground truth):
private void handleSignInResult(GoogleSignInResult result){
  Log.d(TAG,"String_Node_Str" + result.getStatus());
  if (result.isSuccess()) {
    account=result.getSignInAccount();
    if (account != null) {
      Log.i(TAG,"String_Node_Str" + account.getDisplayName());
      BaselineCloud.listAsync(account.getIdToken(),false);
    }
    updateState(AuthEvent.SIGNED_IN);
  }
 else {
    Log.w(TAG,"String_Node_Str");
    signedOut();
  }
  userClickedSignIn=false;
}
Program: 86917
Project: 86917
Buggy source:
@Override protected void onStart(){
  super.onStart();
  Services.start(this);
  final OptionalPendingResult<GoogleSignInResult> opr=Auth.GoogleSignInApi.silentSignIn(mGoogleApiClient);
  if (opr.isDone()) {
    Log.d(TAG,"String_Node_Str");
    final GoogleSignInResult result=opr.get();
    handleSignInResult(result);
  }
 else {
    opr.setResultCallback(new ResultCallback<GoogleSignInResult>(){
      @Override public void onResult(      @NonNull GoogleSignInResult googleSignInResult){
        handleSignInResult(googleSignInResult);
      }
    }
);
  }
  signInPanel=findViewById(R.id.sign_in_panel);
  signInSpinner=findViewById(R.id.sign_in_spinner);
  final View signInButton=findViewById(R.id.sign_in_button);
  if (signInButton != null) {
    signInButton.setOnClickListener(signInClickListener);
  }
  if (signInPanel != null) {
    if (currentState == AuthEvent.SIGNED_OUT) {
      signInPanel.setVisibility(View.VISIBLE);
    }
 else {
      signInPanel.setVisibility(View.GONE);
    }
  }
}

Fixed version (ground truth):
@Override protected void onStart(){
  super.onStart();
  Services.start(this);
  Auth.GoogleSignInApi.silentSignIn(mGoogleApiClient).setResultCallback(new ResultCallback<GoogleSignInResult>(){
    @Override public void onResult(    @NonNull GoogleSignInResult googleSignInResult){
      handleSignInResult(googleSignInResult);
    }
  }
);
  signInPanel=findViewById(R.id.sign_in_panel);
  signInSpinner=findViewById(R.id.sign_in_spinner);
  final View signInButton=findViewById(R.id.sign_in_button);
  if (signInButton != null) {
    signInButton.setOnClickListener(signInClickListener);
  }
  if (signInPanel != null) {
    if (currentState == AuthEvent.SIGNED_OUT) {
      signInPanel.setVisibility(View.VISIBLE);
    }
 else {
      signInPanel.setVisibility(View.GONE);
    }
  }
}
Program: 86918
Project: 86918
Buggy source:
/** 
 * Get google auth token and return asynchronously via callback 
 */
public void getAuthToken(final Callback<String> callback){
  if (account != null) {
    final String token=account.getIdToken();
    if (token != null) {
      Log.i(TAG,"String_Node_Str" + token);
      if (callback != null) {
        callback.apply(token);
      }
    }
 else {
      if (callback != null) {
        callback.error("String_Node_Str");
      }
    }
  }
 else {
    callback.error("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Get google auth token and return asynchronously via callback 
 */
public void getAuthToken(@NonNull Callback<String> callback){
  if (account != null) {
    final String token=account.getIdToken();
    if (token != null) {
      Log.i(TAG,"String_Node_Str" + token);
      callback.apply(token);
    }
 else {
      callback.error("String_Node_Str");
    }
  }
 else {
    callback.error("String_Node_Str");
  }
}
Program: 86919
Project: 86919
Buggy source:
protected void clickSignOut(){
  Log.i(TAG,"String_Node_Str");
  Auth.GoogleSignInApi.signOut(mGoogleApiClient).setResultCallback(new ResultCallback<Status>(){
    @Override public void onResult(    @NonNull Status status){
      Log.d(TAG,"String_Node_Str" + status);
      Toast.makeText(BaseActivity.this,R.string.signout_success,Toast.LENGTH_LONG).show();
      account=null;
      BaselineCloud.signOut();
      updateState(AuthEvent.SIGNED_OUT);
    }
  }
);
}

Fixed version (ground truth):
protected void clickSignOut(){
  Log.i(TAG,"String_Node_Str");
  Auth.GoogleSignInApi.signOut(mGoogleApiClient).setResultCallback(new ResultCallback<Status>(){
    @Override public void onResult(    @NonNull Status status){
      Log.d(TAG,"String_Node_Str" + status);
      Toast.makeText(BaseActivity.this,R.string.signout_success,Toast.LENGTH_LONG).show();
      signedOut();
    }
  }
);
}
Program: 86920
Project: 86920
Buggy source:
@Override public void onResult(@NonNull Status status){
  Log.d(TAG,"String_Node_Str" + status);
  Toast.makeText(BaseActivity.this,R.string.signout_success,Toast.LENGTH_LONG).show();
  account=null;
  BaselineCloud.signOut();
  updateState(AuthEvent.SIGNED_OUT);
}

Fixed version (ground truth):
@Override public void onResult(@NonNull Status status){
  Log.d(TAG,"String_Node_Str" + status);
  Toast.makeText(BaseActivity.this,R.string.signout_success,Toast.LENGTH_LONG).show();
  signedOut();
}
Program: 86921
Project: 86921
Buggy source:
public void clickRecord(View v){
  if (!Services.logger.isLogging()) {
    firebaseAnalytics.logEvent("String_Node_Str",null);
    Services.logger.startLogging();
  }
 else {
    firebaseAnalytics.logEvent("String_Node_Str",null);
    final TrackFile trackList=Services.logger.stopLogging();
    if (trackList != null) {
      uploadToCloud(trackList);
    }
 else {
      Log.e(TAG,"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void clickRecord(View v){
  if (!Services.logger.isLogging()) {
    firebaseAnalytics.logEvent("String_Node_Str",null);
    Services.logger.startLogging();
  }
 else {
    firebaseAnalytics.logEvent("String_Node_Str",null);
    final TrackFile trackFile=Services.logger.stopLogging();
    if (trackFile != null && trackFile.file.exists()) {
      uploadToCloud(trackFile);
    }
 else {
      Log.e(TAG,"String_Node_Str" + trackFile);
      FirebaseCrash.report(new FileNotFoundException("String_Node_Str" + trackFile));
    }
  }
}