nus-yam/ex-repair huggingface dataset:
Program: 113881
Project: 113881
Buggy source:
@VisibleForTesting protected String getProjectName(ILaunchConfiguration configuration) throws CoreException {
  return configuration.getAttribute(RunTestsConstants.ATTR_PROJECT_NAME,"String_Node_Str");
}

Fixed version (ground truth):
@VisibleForTesting public String getProjectName(ILaunchConfiguration configuration) throws CoreException {
  return configuration.getAttribute(RunTestsConstants.ATTR_PROJECT_NAME,"String_Node_Str");
}
Program: 113882
Project: 113882
Buggy source:
@VisibleForTesting protected int getTotalTests(ILaunchConfiguration configuration) throws CoreException {
  return configuration.getAttribute(RunTestsConstants.ATTR_TESTS_TOTAL,0);
}

Fixed version (ground truth):
@VisibleForTesting public int getTotalTests(ILaunchConfiguration configuration) throws CoreException {
  return configuration.getAttribute(RunTestsConstants.ATTR_TESTS_TOTAL,0);
}
Program: 113883
Project: 113883
Buggy source:
@VisibleForTesting protected Map<IResource,List<String>> findTestClasses(IProject project){
  return ApexTestsUtils.INSTANCE.findTestClassesInProject(project);
}

Fixed version (ground truth):
@VisibleForTesting public Map<IResource,List<String>> findTestClasses(IProject project){
  return ApexTestsUtils.INSTANCE.findTestClassesInProject(project);
}
Program: 113884
Project: 113884
Buggy source:
@VisibleForTesting protected IProject materializeForceProject(ILaunchConfiguration configuration) throws CoreException {
  String forceProjectName=getProjectName(configuration);
  IProject project=getProjectFromName(forceProjectName);
  if (Utils.isEmpty(project)) {
    throwErrorMsg(Messages.RunTestsLaunchConfigurationDelegate_CannotLaunchInvalidForceProject);
  }
  return project;
}

Fixed version (ground truth):
@VisibleForTesting public IProject materializeForceProject(ILaunchConfiguration configuration) throws CoreException {
  String forceProjectName=getProjectName(configuration);
  IProject project=getProjectFromName(forceProjectName);
  if (Utils.isEmpty(project)) {
    throwErrorMsg(Messages.RunTestsLaunchConfigurationDelegate_CannotLaunchInvalidForceProject);
  }
  return project;
}
Program: 113885
Project: 113885
Buggy source:
@VisibleForTesting protected void throwErrorMsg(String msg) throws CoreException {
  if (Utils.isNotEmpty(msg)) {
    throw new CoreException(new Status(IStatus.ERROR,ForceIdeCorePlugin.PLUGIN_ID,0,msg,null));
  }
}

Fixed version (ground truth):
@VisibleForTesting public void throwErrorMsg(String msg) throws CoreException {
  if (Utils.isNotEmpty(msg)) {
    throw new CoreException(new Status(IStatus.ERROR,ForceIdeCorePlugin.PLUGIN_ID,0,msg,null));
  }
}
Program: 113886
Project: 113886
Buggy source:
@VisibleForTesting protected String getTestsArray(ILaunchConfiguration configuration) throws CoreException {
  return configuration.getAttribute(RunTestsConstants.ATTR_TESTS_ARRAY,"String_Node_Str");
}

Fixed version (ground truth):
@VisibleForTesting public String getTestsArray(ILaunchConfiguration configuration) throws CoreException {
  return configuration.getAttribute(RunTestsConstants.ATTR_TESTS_ARRAY,"String_Node_Str");
}
Program: 113887
Project: 113887
Buggy source:
/** 
 * Inform user there is an existing Trace Flag.
 * @return False if abort, true if continue
 */
@VisibleForTesting protected boolean confirmExistingTraceFlag(){
  Display display=getDisplay();
  final AtomicInteger choice=new AtomicInteger(0);
  display.syncExec(new Runnable(){
    @Override public void run(){
      choice.set(DialogUtils.getInstance().abortContinueMessage(Messages.RunTestsLaunchConfigurationDelegate_ConfirmDialogTitle,Messages.RunTestsLaunchConfigurationDelegate_ExistingTraceFlag,MessageDialog.INFORMATION));
    }
  }
);
  return choice.get() == 1;
}

Fixed version (ground truth):
/** 
 * Inform user there is an existing Trace Flag.
 * @return False if abort, true if continue
 */
@VisibleForTesting public boolean confirmExistingTraceFlag(){
  Display display=getDisplay();
  final AtomicInteger choice=new AtomicInteger(0);
  display.syncExec(new Runnable(){
    @Override public void run(){
      choice.set(DialogUtils.getInstance().abortContinueMessage(Messages.RunTestsLaunchConfigurationDelegate_ConfirmDialogTitle,Messages.RunTestsLaunchConfigurationDelegate_ExistingTraceFlag,MessageDialog.INFORMATION));
    }
  }
);
  return choice.get() == 1;
}
Program: 113888
Project: 113888
Buggy source:
@VisibleForTesting protected RunTestsView getRunTestView(){
  return RunTestsView.getInstance();
}

Fixed version (ground truth):
@VisibleForTesting public RunTestsView getRunTestView(){
  return RunTestsView.getInstance();
}
Program: 113889
Project: 113889
Buggy source:
@VisibleForTesting protected boolean isProjectDebugging(IProject project){
  return DebugListener.isDebugging(project);
}

Fixed version (ground truth):
@VisibleForTesting public boolean isProjectDebugging(IProject project){
  return DebugListener.isDebugging(project);
}
Program: 113890
Project: 113890
Buggy source:
@VisibleForTesting protected void disableLogging(ILaunchConfiguration configuration) throws CoreException {
  ILaunchConfigurationWorkingCopy realConfig=configuration.getWorkingCopy();
  realConfig.setAttribute(RunTestsConstants.ATTR_ENABLE_LOGGING,false);
  realConfig.doSave();
}

Fixed version (ground truth):
@VisibleForTesting public void disableLogging(ILaunchConfiguration configuration) throws CoreException {
  ILaunchConfigurationWorkingCopy realConfig=configuration.getWorkingCopy();
  realConfig.setAttribute(RunTestsConstants.ATTR_ENABLE_LOGGING,false);
  realConfig.doSave();
}
Program: 113891
Project: 113891
Buggy source:
@VisibleForTesting protected void removeLaunch(ILaunch launch){
  DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
}

Fixed version (ground truth):
@VisibleForTesting public void removeLaunch(ILaunch launch){
  DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
}
Program: 113892
Project: 113892
Buggy source:
@VisibleForTesting protected void checkMode(String mode) throws CoreException {
  if (!mode.equals(ILaunchManager.RUN_MODE)) {
    throwErrorMsg(Messages.RunTestsLaunchConfigurationDelegate_CannotLaunchDebugModeErrorMessage);
  }
}

Fixed version (ground truth):
@VisibleForTesting public void checkMode(String mode) throws CoreException {
  if (!mode.equals(ILaunchManager.RUN_MODE)) {
    throwErrorMsg(Messages.RunTestsLaunchConfigurationDelegate_CannotLaunchDebugModeErrorMessage);
  }
}
Program: 113893
Project: 113893
Buggy source:
@VisibleForTesting protected IProject getProjectFromName(String name){
  return ResourcesPlugin.getWorkspace().getRoot().getProject(name);
}

Fixed version (ground truth):
@VisibleForTesting public IProject getProjectFromName(String name){
  return ResourcesPlugin.getWorkspace().getRoot().getProject(name);
}
Program: 113894
Project: 113894
Buggy source:
/** 
 * Re-open config window with the specified launch config
 * @param configuration
 * @param mode
 */
@VisibleForTesting protected void reopenLaunchConfig(final ILaunchConfiguration configuration,final String mode){
  if (Utils.isNotEmpty(configuration) && Utils.isNotEmpty(mode)) {
    Display display=getDisplay();
    display.asyncExec(new Runnable(){
      @Override public void run(){
        IWorkbenchWindow aww=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        ILaunchGroup launchGroup=DebugUITools.getLaunchGroup(configuration,mode);
        DebugUITools.openLaunchConfigurationDialog(aww.getShell(),configuration,launchGroup.getIdentifier(),null);
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * Re-open config window with the specified launch config
 * @param configuration
 * @param mode
 */
@VisibleForTesting public void reopenLaunchConfig(final ILaunchConfiguration configuration,final String mode){
  if (Utils.isNotEmpty(configuration) && Utils.isNotEmpty(mode)) {
    Display display=getDisplay();
    display.asyncExec(new Runnable(){
      @Override public void run(){
        IWorkbenchWindow aww=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        ILaunchGroup launchGroup=DebugUITools.getLaunchGroup(configuration,mode);
        DebugUITools.openLaunchConfigurationDialog(aww.getShell(),configuration,launchGroup.getIdentifier(),null);
      }
    }
);
  }
}
Program: 113895
Project: 113895
Buggy source:
@VisibleForTesting protected boolean getTestMode(ILaunchConfiguration configuration) throws CoreException {
  return configuration.getAttribute(RunTestsConstants.ATTR_TEST_MODE,true);
}

Fixed version (ground truth):
@VisibleForTesting public boolean getTestMode(ILaunchConfiguration configuration) throws CoreException {
  return configuration.getAttribute(RunTestsConstants.ATTR_TEST_MODE,true);
}
Program: 113896
Project: 113896
Buggy source:
/** 
 * Pop up a confirmation dialog regarding asynchronous test run while debugging
 * @return False if abort, true if continue
 */
@VisibleForTesting protected boolean confirmAsyncTestRunWhileDebugging(){
  Display display=getDisplay();
  final AtomicInteger choice=new AtomicInteger(0);
  display.syncExec(new Runnable(){
    @Override public void run(){
      choice.set(DialogUtils.getInstance().abortContinueMessage(Messages.RunTestsLaunchConfigurationDelegate_ConfirmDialogTitle,Messages.RunTestsLaunchConfigurationDelegate_CannotLaunchAsyncWhileDebugging,MessageDialog.WARNING));
    }
  }
);
  return choice.get() == 1;
}

Fixed version (ground truth):
/** 
 * Pop up a confirmation dialog regarding asynchronous test run while debugging
 * @return False if abort, true if continue
 */
@VisibleForTesting public boolean confirmAsyncTestRunWhileDebugging(){
  Display display=getDisplay();
  final AtomicInteger choice=new AtomicInteger(0);
  display.syncExec(new Runnable(){
    @Override public void run(){
      choice.set(DialogUtils.getInstance().abortContinueMessage(Messages.RunTestsLaunchConfigurationDelegate_ConfirmDialogTitle,Messages.RunTestsLaunchConfigurationDelegate_CannotLaunchAsyncWhileDebugging,MessageDialog.WARNING));
    }
  }
);
  return choice.get() == 1;
}
Program: 113897
Project: 113897
Buggy source:
@VisibleForTesting protected boolean secondPhasePreLaunchCheck(ILaunchConfiguration configuration,String mode,IProgressMonitor monitor) throws CoreException {
  return super.preLaunchCheck(configuration,mode,monitor);
}

Fixed version (ground truth):
@VisibleForTesting public boolean secondPhasePreLaunchCheck(ILaunchConfiguration configuration,String mode,IProgressMonitor monitor) throws CoreException {
  return super.preLaunchCheck(configuration,mode,monitor);
}
Program: 113899
Project: 113899
Buggy source:
@VisibleForTesting protected boolean shouldEnableLogging(ILaunchConfiguration configuration) throws CoreException {
  return configuration.getAttribute(RunTestsConstants.ATTR_ENABLE_LOGGING,false);
}

Fixed version (ground truth):
@VisibleForTesting public boolean shouldEnableLogging(ILaunchConfiguration configuration) throws CoreException {
  return configuration.getAttribute(RunTestsConstants.ATTR_ENABLE_LOGGING,false);
}
Program: 113900
Project: 113900
Buggy source:
@VisibleForTesting protected Display getDisplay(){
  return PlatformUI.getWorkbench().getDisplay();
}

Fixed version (ground truth):
@VisibleForTesting public Display getDisplay(){
  return PlatformUI.getWorkbench().getDisplay();
}
Program: 113901
Project: 113901
Buggy source:
@Override public void _case(MethodMember x){
  if (hasTestModifier(x.methodDecl.modifiers)) {
    methodNames.add(x.methodDecl.name.value);
  }
}

Fixed version (ground truth):
@Override public void _case(MethodMember x){
  if (hasTestModifier(x.methodDecl.modifiers)) {
    RealLoc realLoc=(RealLoc)x.methodDecl.name.loc;
    ApexCodeLocation loc=new ApexCodeLocation(file,realLoc.line,realLoc.column);
    testMethods.put(x.methodDecl.name.value,loc);
  }
}
Program: 113902
Project: 113902
Buggy source:
/** 
 * Find test classes in a given project. Test classes are annotated with @IsTest.
 * @param project
 * @return Map of test resources whose key is the resource ID
 */
public Map<String,IResource> findTestClassesInProject(IProject project){
  final Map<String,IResource> testClasses=Maps.newHashMap();
  List<IResource> projectResources=findSourcesInProject(project);
  List<IResource> projectClasses=filterSourcesByClass(projectResources);
  try {
    for (    final IResource projectResource : projectClasses) {
      IFile projectClass=(IFile)projectResource;
      CompilationUnit compilationUnit=ApexModelManager.INSTANCE.getCompilationUnit(projectClass);
      compilationUnit._switch(new CompilationUnit.SwitchBlockWithDefault(){
        @Override public void _case(        ClassDeclUnit classDeclUnit){
          if (classDeclUnit.body != null) {
            if (hasTestModifier(classDeclUnit.body.modifiers)) {
              String resourceId=ResourceProperties.getProperty(projectResource,QualifiedNames.QN_ID);
              testClasses.put(resourceId,projectResource);
            }
          }
        }
        @Override protected void _default(        CompilationUnit x){
        }
      }
);
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
  return testClasses;
}

Fixed version (ground truth):
/** 
 * Find test classes in a given project. Test classes are annotated with @IsTest.
 * @param project
 * @return Map of test resources whose key is the resource ID
 */
public Map<IResource,List<String>> findTestClassesInProject(IProject project){
  final Map<IResource,List<String>> allTests=Maps.newHashMap();
  List<IResource> projectResources=findSourcesInProject(project);
  List<IResource> projectClasses=filterSourcesByClass(projectResources);
  try {
    for (    final IResource projectResource : projectClasses) {
      List<String> methodNames=findTestMethodNamesInFile(projectResource);
      if (methodNames != null && methodNames.size() > 0) {
        allTests.put(projectResource,methodNames);
      }
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
  return allTests;
}
Program: 113903
Project: 113903
Buggy source:
@Test public void testPreLaunchSyncWithDebug() throws Exception {
  ILaunchConfiguration configuration=mock(ILaunchConfiguration.class);
  String mode=ILaunchManager.RUN_MODE;
  IProgressMonitor monitor=mock(IProgressMonitor.class);
  RunTestView runTestsView=mock(RunTestView.class);
  IProject project=mock(IProject.class);
  when(mockedDelegate.preLaunchCheck(configuration,mode,monitor)).thenCallRealMethod();
  doNothing().when(mockedDelegate).checkMode(mode);
  when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
  when(runTestsView.canRun()).thenReturn(true);
  when(mockedDelegate.materializeForceProject(configuration)).thenReturn(project);
  when(mockedDelegate.getTestMode(configuration)).thenReturn(false);
  when(mockedDelegate.isProjectDebugging(project)).thenReturn(true);
  when(mockedDelegate.secondPhasePreLaunchCheck(configuration,mode,monitor)).thenReturn(true);
  boolean prelaunchResult=mockedDelegate.preLaunchCheck(configuration,mode,monitor);
  verify(mockedDelegate,times(1)).checkMode(mode);
  verify(mockedDelegate,times(1)).getRunTestView();
  verify(mockedDelegate,times(1)).materializeForceProject(configuration);
  verify(mockedDelegate,times(1)).getTestMode(configuration);
  verify(mockedDelegate,times(1)).isProjectDebugging(project);
  verify(runTestsView,never()).confirmAsyncTestRunWhileDebugging();
  verify(mockedDelegate,never()).getDisplay();
  assertTrue(prelaunchResult);
}

Fixed version (ground truth):
@Test public void testPreLaunchSyncWithDebug() throws Exception {
  ILaunchConfiguration configuration=mock(ILaunchConfiguration.class);
  String mode=ILaunchManager.RUN_MODE;
  IProgressMonitor monitor=mock(IProgressMonitor.class);
  RunTestsView runTestsView=mock(RunTestsView.class);
  IProject project=mock(IProject.class);
  when(mockedDelegate.preLaunchCheck(configuration,mode,monitor)).thenCallRealMethod();
  doNothing().when(mockedDelegate).checkMode(mode);
  when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
  when(runTestsView.canRun()).thenReturn(true);
  when(mockedDelegate.materializeForceProject(configuration)).thenReturn(project);
  when(mockedDelegate.getTestMode(configuration)).thenReturn(false);
  when(mockedDelegate.isProjectDebugging(project)).thenReturn(true);
  when(mockedDelegate.secondPhasePreLaunchCheck(configuration,mode,monitor)).thenReturn(true);
  boolean prelaunchResult=mockedDelegate.preLaunchCheck(configuration,mode,monitor);
  verify(mockedDelegate,times(1)).checkMode(mode);
  verify(mockedDelegate,times(1)).getRunTestView();
  verify(mockedDelegate,times(1)).materializeForceProject(configuration);
  verify(mockedDelegate,times(1)).getTestMode(configuration);
  verify(mockedDelegate,times(1)).isProjectDebugging(project);
  verify(runTestsView,never()).confirmAsyncTestRunWhileDebugging();
  verify(mockedDelegate,never()).getDisplay();
  assertTrue(prelaunchResult);
}
Program: 113904
Project: 113904
Buggy source:
@Test public void testPreLaunchAsyncWithDebugUserContinues() throws Exception {
  ILaunchConfiguration configuration=mock(ILaunchConfiguration.class);
  String mode=ILaunchManager.RUN_MODE;
  IProgressMonitor monitor=mock(IProgressMonitor.class);
  RunTestView runTestsView=mock(RunTestView.class);
  IProject project=mock(IProject.class);
  when(mockedDelegate.preLaunchCheck(configuration,mode,monitor)).thenCallRealMethod();
  doNothing().when(mockedDelegate).checkMode(mode);
  when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
  when(runTestsView.canRun()).thenReturn(true);
  when(mockedDelegate.materializeForceProject(configuration)).thenReturn(project);
  when(mockedDelegate.getTestMode(configuration)).thenReturn(true);
  when(mockedDelegate.isProjectDebugging(project)).thenReturn(true);
  when(runTestsView.confirmAsyncTestRunWhileDebugging()).thenReturn(true);
  when(mockedDelegate.secondPhasePreLaunchCheck(configuration,mode,monitor)).thenReturn(true);
  boolean prelaunchResult=mockedDelegate.preLaunchCheck(configuration,mode,monitor);
  verify(mockedDelegate,times(1)).checkMode(mode);
  verify(mockedDelegate,times(1)).getRunTestView();
  verify(mockedDelegate,times(1)).materializeForceProject(configuration);
  verify(mockedDelegate,times(1)).getTestMode(configuration);
  verify(mockedDelegate,times(1)).isProjectDebugging(project);
  verify(runTestsView,times(1)).confirmAsyncTestRunWhileDebugging();
  verify(mockedDelegate,never()).getDisplay();
  assertTrue(prelaunchResult);
}

Fixed version (ground truth):
@Test public void testPreLaunchAsyncWithDebugUserContinues() throws Exception {
  ILaunchConfiguration configuration=mock(ILaunchConfiguration.class);
  String mode=ILaunchManager.RUN_MODE;
  IProgressMonitor monitor=mock(IProgressMonitor.class);
  RunTestsView runTestsView=mock(RunTestsView.class);
  IProject project=mock(IProject.class);
  when(mockedDelegate.preLaunchCheck(configuration,mode,monitor)).thenCallRealMethod();
  doNothing().when(mockedDelegate).checkMode(mode);
  when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
  when(runTestsView.canRun()).thenReturn(true);
  when(mockedDelegate.materializeForceProject(configuration)).thenReturn(project);
  when(mockedDelegate.getTestMode(configuration)).thenReturn(true);
  when(mockedDelegate.isProjectDebugging(project)).thenReturn(true);
  when(runTestsView.confirmAsyncTestRunWhileDebugging()).thenReturn(true);
  when(mockedDelegate.secondPhasePreLaunchCheck(configuration,mode,monitor)).thenReturn(true);
  boolean prelaunchResult=mockedDelegate.preLaunchCheck(configuration,mode,monitor);
  verify(mockedDelegate,times(1)).checkMode(mode);
  verify(mockedDelegate,times(1)).getRunTestView();
  verify(mockedDelegate,times(1)).materializeForceProject(configuration);
  verify(mockedDelegate,times(1)).getTestMode(configuration);
  verify(mockedDelegate,times(1)).isProjectDebugging(project);
  verify(runTestsView,times(1)).confirmAsyncTestRunWhileDebugging();
  verify(mockedDelegate,never()).getDisplay();
  assertTrue(prelaunchResult);
}
Program: 113905
Project: 113905
Buggy source:
@Test public void testPreLaunchSyncWithoutDebug() throws Exception {
  ILaunchConfiguration configuration=mock(ILaunchConfiguration.class);
  String mode=ILaunchManager.RUN_MODE;
  IProgressMonitor monitor=mock(IProgressMonitor.class);
  RunTestView runTestsView=mock(RunTestView.class);
  IProject project=mock(IProject.class);
  when(mockedDelegate.preLaunchCheck(configuration,mode,monitor)).thenCallRealMethod();
  doNothing().when(mockedDelegate).checkMode(mode);
  when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
  when(runTestsView.canRun()).thenReturn(true);
  when(mockedDelegate.materializeForceProject(configuration)).thenReturn(project);
  when(mockedDelegate.getTestMode(configuration)).thenReturn(false);
  when(mockedDelegate.isProjectDebugging(project)).thenReturn(false);
  when(mockedDelegate.secondPhasePreLaunchCheck(configuration,mode,monitor)).thenReturn(true);
  boolean prelaunchResult=mockedDelegate.preLaunchCheck(configuration,mode,monitor);
  verify(mockedDelegate,times(1)).checkMode(mode);
  verify(mockedDelegate,times(1)).getRunTestView();
  verify(mockedDelegate,times(1)).materializeForceProject(configuration);
  verify(mockedDelegate,times(1)).getTestMode(configuration);
  verify(mockedDelegate,times(1)).isProjectDebugging(project);
  verify(runTestsView,never()).confirmAsyncTestRunWhileDebugging();
  verify(mockedDelegate,never()).getDisplay();
  assertTrue(prelaunchResult);
}

Fixed version (ground truth):
@Test public void testPreLaunchSyncWithoutDebug() throws Exception {
  ILaunchConfiguration configuration=mock(ILaunchConfiguration.class);
  String mode=ILaunchManager.RUN_MODE;
  IProgressMonitor monitor=mock(IProgressMonitor.class);
  RunTestsView runTestsView=mock(RunTestsView.class);
  IProject project=mock(IProject.class);
  when(mockedDelegate.preLaunchCheck(configuration,mode,monitor)).thenCallRealMethod();
  doNothing().when(mockedDelegate).checkMode(mode);
  when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
  when(runTestsView.canRun()).thenReturn(true);
  when(mockedDelegate.materializeForceProject(configuration)).thenReturn(project);
  when(mockedDelegate.getTestMode(configuration)).thenReturn(false);
  when(mockedDelegate.isProjectDebugging(project)).thenReturn(false);
  when(mockedDelegate.secondPhasePreLaunchCheck(configuration,mode,monitor)).thenReturn(true);
  boolean prelaunchResult=mockedDelegate.preLaunchCheck(configuration,mode,monitor);
  verify(mockedDelegate,times(1)).checkMode(mode);
  verify(mockedDelegate,times(1)).getRunTestView();
  verify(mockedDelegate,times(1)).materializeForceProject(configuration);
  verify(mockedDelegate,times(1)).getTestMode(configuration);
  verify(mockedDelegate,times(1)).isProjectDebugging(project);
  verify(runTestsView,never()).confirmAsyncTestRunWhileDebugging();
  verify(mockedDelegate,never()).getDisplay();
  assertTrue(prelaunchResult);
}
Program: 113906
Project: 113906
Buggy source:
@Test public void testPreLaunchWithExistingRun() throws Exception {
  ILaunchConfiguration configuration=mock(ILaunchConfiguration.class);
  String mode=ILaunchManager.RUN_MODE;
  IProgressMonitor monitor=mock(IProgressMonitor.class);
  RunTestView runTestsView=mock(RunTestView.class);
  when(mockedDelegate.preLaunchCheck(configuration,mode,monitor)).thenCallRealMethod();
  doNothing().when(mockedDelegate).checkMode(mode);
  when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
  when(runTestsView.canRun()).thenReturn(false);
  doNothing().when(mockedDelegate).throwErrorMsg(any(String.class));
  when(mockedDelegate.secondPhasePreLaunchCheck(configuration,mode,monitor)).thenReturn(true);
  boolean prelaunchResult=mockedDelegate.preLaunchCheck(configuration,mode,monitor);
  verify(mockedDelegate,times(1)).checkMode(mode);
  verify(mockedDelegate,times(1)).getRunTestView();
  verify(mockedDelegate,times(1)).throwErrorMsg(Messages.RunTestsLaunchConfigurationDelegate_CannotLaunchAnotherConfig);
  assertTrue(prelaunchResult);
}

Fixed version (ground truth):
@Test public void testPreLaunchWithExistingRun() throws Exception {
  ILaunchConfiguration configuration=mock(ILaunchConfiguration.class);
  String mode=ILaunchManager.RUN_MODE;
  IProgressMonitor monitor=mock(IProgressMonitor.class);
  RunTestsView runTestsView=mock(RunTestsView.class);
  when(mockedDelegate.preLaunchCheck(configuration,mode,monitor)).thenCallRealMethod();
  doNothing().when(mockedDelegate).checkMode(mode);
  when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
  when(runTestsView.canRun()).thenReturn(false);
  doNothing().when(mockedDelegate).throwErrorMsg(any(String.class));
  when(mockedDelegate.secondPhasePreLaunchCheck(configuration,mode,monitor)).thenReturn(true);
  boolean prelaunchResult=mockedDelegate.preLaunchCheck(configuration,mode,monitor);
  verify(mockedDelegate,times(1)).checkMode(mode);
  verify(mockedDelegate,times(1)).getRunTestView();
  verify(mockedDelegate,times(1)).throwErrorMsg(Messages.RunTestsLaunchConfigurationDelegate_CannotLaunchAnotherConfig);
  assertTrue(prelaunchResult);
}
Program: 113910
Project: 113910
Buggy source:
@Test public void testPreLaunchAsyncWithoutDebug() throws Exception {
  ILaunchConfiguration configuration=mock(ILaunchConfiguration.class);
  String mode=ILaunchManager.RUN_MODE;
  IProgressMonitor monitor=mock(IProgressMonitor.class);
  RunTestView runTestsView=mock(RunTestView.class);
  IProject project=mock(IProject.class);
  when(mockedDelegate.preLaunchCheck(configuration,mode,monitor)).thenCallRealMethod();
  doNothing().when(mockedDelegate).checkMode(mode);
  when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
  when(runTestsView.canRun()).thenReturn(true);
  when(mockedDelegate.materializeForceProject(configuration)).thenReturn(project);
  when(mockedDelegate.getTestMode(configuration)).thenReturn(true);
  when(mockedDelegate.isProjectDebugging(project)).thenReturn(false);
  when(mockedDelegate.secondPhasePreLaunchCheck(configuration,mode,monitor)).thenReturn(true);
  boolean prelaunchResult=mockedDelegate.preLaunchCheck(configuration,mode,monitor);
  verify(mockedDelegate,times(1)).checkMode(mode);
  verify(mockedDelegate,times(1)).getRunTestView();
  verify(mockedDelegate,times(1)).materializeForceProject(configuration);
  verify(mockedDelegate,times(1)).getTestMode(configuration);
  verify(mockedDelegate,times(1)).isProjectDebugging(project);
  verify(runTestsView,never()).confirmAsyncTestRunWhileDebugging();
  verify(mockedDelegate,never()).getDisplay();
  assertTrue(prelaunchResult);
}

Fixed version (ground truth):
@Test public void testPreLaunchAsyncWithoutDebug() throws Exception {
  ILaunchConfiguration configuration=mock(ILaunchConfiguration.class);
  String mode=ILaunchManager.RUN_MODE;
  IProgressMonitor monitor=mock(IProgressMonitor.class);
  RunTestsView runTestsView=mock(RunTestsView.class);
  IProject project=mock(IProject.class);
  when(mockedDelegate.preLaunchCheck(configuration,mode,monitor)).thenCallRealMethod();
  doNothing().when(mockedDelegate).checkMode(mode);
  when(mockedDelegate.getRunTestView()).thenReturn(runTestsView);
  when(runTestsView.canRun()).thenReturn(true);
  when(mockedDelegate.materializeForceProject(configuration)).thenReturn(project);
  when(mockedDelegate.getTestMode(configuration)).thenReturn(true);
  when(mockedDelegate.isProjectDebugging(project)).thenReturn(false);
  when(mockedDelegate.secondPhasePreLaunchCheck(configuration,mode,monitor)).thenReturn(true);
  boolean prelaunchResult=mockedDelegate.preLaunchCheck(configuration,mode,monitor);
  verify(mockedDelegate,times(1)).checkMode(mode);
  verify(mockedDelegate,times(1)).getRunTestView();
  verify(mockedDelegate,times(1)).materializeForceProject(configuration);
  verify(mockedDelegate,times(1)).getTestMode(configuration);
  verify(mockedDelegate,times(1)).isProjectDebugging(project);
  verify(runTestsView,never()).confirmAsyncTestRunWhileDebugging();
  verify(mockedDelegate,never()).getDisplay();
  assertTrue(prelaunchResult);
}
Program: 113911
Project: 113911
Buggy source:
@Test public void testCreateTabs(){
  RunTestsLaunchConfigurationTabGroup tabGroup=new RunTestsLaunchConfigurationTabGroup();
  ILaunchConfigurationDialog mockDialog=mock(ILaunchConfigurationDialog.class);
  String mockMode="String_Node_Str";
  tabGroup.createTabs(mockDialog,mockMode);
  ILaunchConfigurationTab[] tabs=tabGroup.getTabs();
  assertNotNull(tabs);
  assertEquals(2,tabs.length);
  assertTrue(tabs[0] instanceof RunTestsTab);
  assertTrue(tabs[1] instanceof CommonTab);
}

Fixed version (ground truth):
@Test public void testCreateTabs(){
  RunTestsLaunchConfigurationTabGroup tabGroup=new RunTestsLaunchConfigurationTabGroup();
  ILaunchConfigurationDialog mockDialog=mock(ILaunchConfigurationDialog.class);
  String mockMode="String_Node_Str";
  tabGroup.createTabs(mockDialog,mockMode);
  ILaunchConfigurationTab[] tabs=tabGroup.getTabs();
  assertNotNull(tabs);
  assertEquals(2,tabs.length);
  assertTrue(tabs[0] instanceof RunTestsLaunchConfigurationTab);
  assertTrue(tabs[1] instanceof CommonTab);
}
Program: 113913
Project: 113913
Buggy source:
@Override public void onCreate(){
  super.onCreate();
  Log.i(TAG,"String_Node_Str");
  initFabric();
  initFirebase();
  initApplication();
  registerActivityLifecycleCallbacks(new ActivityLifecycleHandler());
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  Log.i(TAG,"String_Node_Str");
  initFabric();
  initApplication();
  registerActivityLifecycleCallbacks(new ActivityLifecycleHandler());
}
Program: 113914
Project: 113914
Buggy source:
private void initQb(){
  QBSettings.getInstance().init(getApplicationContext(),StringObfuscator.getApplicationId(),StringObfuscator.getAuthKey(),StringObfuscator.getAuthSecret());
  QBSettings.getInstance().setAccountKey(StringObfuscator.getAccountKey());
  initDomains();
  initHTTPConfig();
  QBChatService.setDebugEnabled(StringObfuscator.getDebugEnabled());
}

Fixed version (ground truth):
private void initQb(){
  QBSettings.getInstance().init(getApplicationContext(),StringObfuscator.getApplicationId(),StringObfuscator.getAuthKey(),StringObfuscator.getAuthSecret());
  QBSettings.getInstance().setAccountKey(StringObfuscator.getAccountKey());
  initDomains();
  initHTTPConfig();
  QBChatService.setDebugEnabled(true);
}
Program: 113915
Project: 113915
Buggy source:
@Override public void onProviderSessionExpired(String provider){
  Log.d(TAG,"String_Node_Str" + provider);
  if (!QBProvider.FIREBASE_PHONE.equals(provider)) {
    return;
  }
  FirebaseAuthHelper.getIdTokenForCurrentUser(new FirebaseAuthHelper.RequestFirebaseIdTokenCallback(){
    @Override public void onSuccess(    String authToken){
      Log.d(TAG,"String_Node_Str" + authToken);
      Bundle bundle=new Bundle();
      bundle.putString(FirebaseAuthHelper.EXTRA_FIREBASE_ACCESS_TOKEN,authToken);
      SessionJobService.startSignInSocial(App.getInstance(),bundle);
    }
    @Override public void onError(    Exception e){
      Log.d(TAG,"String_Node_Str" + e.getMessage());
      LandingActivity.start(App.getInstance());
    }
  }
);
}

Fixed version (ground truth):
@Override public void onProviderSessionExpired(String provider){
  Log.d(TAG,"String_Node_Str" + provider);
  if (QBProvider.FIREBASE_PHONE.equals(provider) || QBProvider.TWITTER_DIGITS.equals(provider)) {
    FirebaseAuthHelper.getIdTokenForCurrentUser(new FirebaseAuthHelper.RequestFirebaseIdTokenCallback(){
      @Override public void onSuccess(      String authToken){
        Log.d(TAG,"String_Node_Str" + authToken);
        Bundle bundle=new Bundle();
        bundle.putString(FirebaseAuthHelper.EXTRA_FIREBASE_ACCESS_TOKEN,authToken);
        SessionJobService.startSignInSocial(App.getInstance(),bundle);
      }
      @Override public void onError(      Exception e){
        Log.d(TAG,"String_Node_Str" + e.getMessage());
        LandingActivity.start(App.getInstance());
      }
    }
);
  }
}
Program: 113916
Project: 113916
Buggy source:
@Override public void onError(Exception e){
  hideProgress();
}

Fixed version (ground truth):
@Override public void onError(Exception e){
  Log.d(TAG,"String_Node_Str");
  hideProgress();
}
Program: 113917
Project: 113917
Buggy source:
@Override public void onSuccess(String authToken){
  showProgress();
  serviceManager.login(QBProvider.FIREBASE_PHONE,authToken,StringObfuscator.getFirebaseAuthProjectId()).subscribe(socialLoginObserver);
}

Fixed version (ground truth):
@Override public void onSuccess(String authToken){
  Log.d(TAG,"String_Node_Str");
  showProgress();
  serviceManager.login(QBProvider.FIREBASE_PHONE,authToken,StringObfuscator.getFirebaseAuthProjectId()).subscribe(socialLoginObserver);
}
Program: 113918
Project: 113918
Buggy source:
protected void initDataLoader(int id){
  getLoaderManager().initLoader(id,null,this);
}

Fixed version (ground truth):
protected void initDataLoader(int id){
  getLoaderManager().initLoader(id,null,this).forceLoad();
}
Program: 113919
Project: 113919
Buggy source:
protected void loginChat(){
  isDialogLoading=true;
  showSnackbar(R.string.dialog_loading_dialogs,Snackbar.LENGTH_INDEFINITE);
  QBLoginChatCompositeCommand.start(this);
}

Fixed version (ground truth):
protected void loginChat(){
  isDialogLoading=true;
  showSnackbar(R.string.dialog_loading_dialogs,Snackbar.LENGTH_INDEFINITE,Priority.MAX);
  QBLoginChatCompositeCommand.start(this);
}
Program: 113920
Project: 113920
Buggy source:
@Override public void onLoadFinished(Loader<List<DialogWrapper>> loader,List<DialogWrapper> dialogsList){
  updateDialogsProcess=State.started;
  Log.d(TAG,"String_Node_Str" + dialogsListLoader.isLoadCacheFinished());
  updateDialogsListFromQueue();
  updateDialogsAdapter(dialogsList);
  checkEmptyList(dialogsListAdapter.getCount());
  if (!baseActivity.isDialogLoading()) {
    baseActivity.hideSnackBar();
  }
  if (dialogsListLoader.isLoadCacheFinished()) {
    QBLoadDialogsCommand.start(getContext(),true);
  }
}

Fixed version (ground truth):
@Override public void onLoadFinished(Loader<List<DialogWrapper>> loader,List<DialogWrapper> dialogsList){
  updateDialogsProcess=State.started;
  Log.d(TAG,"String_Node_Str" + dialogsListLoader.isLoadCacheFinished());
  updateDialogsListFromQueue();
  updateDialogsAdapter(dialogsList);
  checkEmptyList(dialogsListAdapter.getCount());
  if (!baseActivity.isDialogLoading()) {
    baseActivity.hideSnackBar(R.string.dialog_loading_dialogs);
  }
  if (dialogsListLoader.isLoadCacheFinished()) {
    QBLoadDialogsCommand.start(getContext(),true);
  }
}
Program: 113921
Project: 113921
Buggy source:
@Override public BaseClickListenerViewHolder<QBChatDialog> onCreateViewHolder(ViewGroup parent,int viewType){
  return new ViewHolder(this,layoutInflater.inflate(R.layout.item_local_search,parent,false));
}

Fixed version (ground truth):
@Override public BaseClickListenerViewHolder<DialogSearchWrapper> onCreateViewHolder(ViewGroup parent,int viewType){
  return new ViewHolder(this,layoutInflater.inflate(R.layout.item_local_search,parent,false));
}
Program: 113922
Project: 113922
Buggy source:
public LocalSearchAdapter(BaseActivity baseActivity,List<QBChatDialog> list){
  super(baseActivity,list);
  dataManager=DataManager.getInstance();
}

Fixed version (ground truth):
public LocalSearchAdapter(BaseActivity baseActivity,List<DialogSearchWrapper> list){
  super(baseActivity,list);
}
Program: 113923
Project: 113923
Buggy source:
@Override protected boolean isMatch(QBChatDialog item,String query){
  String chatTitle=ChatDialogUtils.getTitleForChatDialog(item,dataManager);
  return chatTitle != null && chatTitle.toLowerCase().contains(query);
}

Fixed version (ground truth):
@Override protected boolean isMatch(DialogSearchWrapper item,String query){
  String chatTitle=ChatDialogUtils.getTitleForChatDialog(item.getChatDialog(),dataManager);
  return chatTitle != null && chatTitle.toLowerCase().contains(query);
}
Program: 113924
Project: 113924
Buggy source:
@Override public void onBindViewHolder(BaseClickListenerViewHolder<QBChatDialog> baseClickListenerViewHolder,int position){
  QBChatDialog chatDialog=getItem(position);
  ViewHolder viewHolder=(ViewHolder)baseClickListenerViewHolder;
  List<DialogOccupant> dialogOccupantsList=dataManager.getDialogOccupantDataManager().getDialogOccupantsListByDialogId(chatDialog.getDialogId());
  String label;
  if (QBDialogType.PRIVATE.equals(chatDialog.getType())) {
    QMUser currentUser=UserFriendUtils.createLocalUser(AppSession.getSession().getUser());
    QMUser opponentUser=ChatUtils.getOpponentFromPrivateDialog(currentUser,dialogOccupantsList);
    setOnlineStatus(viewHolder,opponentUser);
    displayAvatarImage(opponentUser.getAvatar(),viewHolder.avatarImageView);
    viewHolder.titleTextView.setText(opponentUser.getFullName());
  }
 else {
    List<Long> dialogOccupantsIdsList=ChatUtils.getIdsFromDialogOccupantsList(dialogOccupantsList);
    Message message=dataManager.getMessageDataManager().getLastMessageWithTempByDialogId(dialogOccupantsIdsList);
    DialogNotification dialogNotification=dataManager.getDialogNotificationDataManager().getLastDialogNotificationByDialogId(dialogOccupantsIdsList);
    label=ChatUtils.getDialogLastMessage(resources.getString(R.string.cht_notification_message),message,dialogNotification);
    viewHolder.labelTextView.setText(label);
    viewHolder.labelTextView.setTextColor(resources.getColor(R.color.dark_gray));
    displayGroupPhotoImage(chatDialog.getPhoto(),viewHolder.avatarImageView);
    viewHolder.titleTextView.setText(chatDialog.getName());
  }
  if (!TextUtils.isEmpty(query)) {
    TextViewHelper.changeTextColorView(baseActivity,viewHolder.titleTextView,query);
  }
}

Fixed version (ground truth):
@Override public void onBindViewHolder(BaseClickListenerViewHolder<DialogSearchWrapper> baseClickListenerViewHolder,int position){
  DialogSearchWrapper dialogWrapper=getItem(position);
  ViewHolder viewHolder=(ViewHolder)baseClickListenerViewHolder;
  String label;
  if (QBDialogType.PRIVATE.equals(dialogWrapper.getChatDialog().getType())) {
    QMUser opponentUser=dialogWrapper.getOpponentUser();
    setOnlineStatus(viewHolder,opponentUser);
    displayAvatarImage(opponentUser.getAvatar(),viewHolder.avatarImageView);
    viewHolder.titleTextView.setText(opponentUser.getFullName());
  }
 else {
    label=dialogWrapper.getLabel();
    viewHolder.labelTextView.setText(label);
    viewHolder.labelTextView.setTextColor(resources.getColor(R.color.dark_gray));
    displayGroupPhotoImage(dialogWrapper.getChatDialog().getPhoto(),viewHolder.avatarImageView);
    viewHolder.titleTextView.setText(dialogWrapper.getChatDialog().getName());
  }
  if (!TextUtils.isEmpty(query)) {
    TextViewHelper.changeTextColorView(baseActivity,viewHolder.titleTextView,query);
  }
}
Program: 113925
Project: 113925
Buggy source:
@Override protected List<QBChatDialog> getItems(){
  return dataManager.getQBChatDialogDataManager().getAllSorted();
}

Fixed version (ground truth):
@Override protected List<DialogSearchWrapper> getItems(){
  List<QBChatDialog> dialogsList=dataManager.getQBChatDialogDataManager().getAllSorted();
  List<DialogSearchWrapper> wrappedList=new ArrayList<>(dialogsList.size());
  for (  QBChatDialog dialog : dialogsList) {
    wrappedList.add(new DialogSearchWrapper(getContext(),dataManager,dialog));
  }
  return wrappedList;
}
Program: 113926
Project: 113926
Buggy source:
@Override protected Loader<List<QBChatDialog>> createDataLoader(){
  return new DialogsListLoader(getActivity(),dataManager);
}

Fixed version (ground truth):
@Override protected Loader<List<DialogSearchWrapper>> createDataLoader(){
  return new DialogsListLoader(getActivity(),dataManager);
}
Program: 113927
Project: 113927
Buggy source:
@Override public void onLoadFinished(Loader<List<QBChatDialog>> loader,List<QBChatDialog> dialogsList){
  this.dialogsList=dialogsList;
  updateLocal();
}

Fixed version (ground truth):
@Override public void onLoadFinished(Loader<List<DialogSearchWrapper>> loader,List<DialogSearchWrapper> dialogsList){
  this.dialogsList=dialogsList;
  updateLocal();
}
Program: 113928
Project: 113928
Buggy source:
private void initCustomListeners(){
  localSearchAdapter.setOnRecycleItemClickListener(new SimpleOnRecycleItemClickListener<QBChatDialog>(){
    @Override public void onItemClicked(    View view,    QBChatDialog chatDialog,    int position){
      if (QBDialogType.PRIVATE.equals(chatDialog.getType())) {
        startPrivateChatActivity(chatDialog);
      }
 else {
        startGroupChatActivity(chatDialog);
      }
    }
  }
);
}

Fixed version (ground truth):
private void initCustomListeners(){
  localSearchAdapter.setOnRecycleItemClickListener(new SimpleOnRecycleItemClickListener<DialogSearchWrapper>(){
    @Override public void onItemClicked(    View view,    DialogSearchWrapper dialogSearchWrapper,    int position){
      if (QBDialogType.PRIVATE.equals(dialogSearchWrapper.getChatDialog().getType())) {
        startPrivateChatActivity(dialogSearchWrapper.getChatDialog());
      }
 else {
        startGroupChatActivity(dialogSearchWrapper.getChatDialog());
      }
    }
  }
);
}
Program: 113929
Project: 113929
Buggy source:
@Override public void onItemClicked(View view,QBChatDialog chatDialog,int position){
  if (QBDialogType.PRIVATE.equals(chatDialog.getType())) {
    startPrivateChatActivity(chatDialog);
  }
 else {
    startGroupChatActivity(chatDialog);
  }
}

Fixed version (ground truth):
@Override public void onItemClicked(View view,DialogSearchWrapper dialogSearchWrapper,int position){
  if (QBDialogType.PRIVATE.equals(dialogSearchWrapper.getChatDialog().getType())) {
    startPrivateChatActivity(dialogSearchWrapper.getChatDialog());
  }
 else {
    startGroupChatActivity(dialogSearchWrapper.getChatDialog());
  }
}
Program: 113930
Project: 113930
Buggy source:
private void performLoadChatsSuccessAction(Bundle bundle){
  hideSnackBar();
  isDialogLoading=false;
}

Fixed version (ground truth):
private void performLoadChatsSuccessAction(Bundle bundle){
  isDialogLoading=false;
}
Program: 113931
Project: 113931
Buggy source:
@Override public void onResult(Boolean aBoolean){
  if (isLoadedOldMessages) {
    messagesAdapter.setList(combinationMessagesList,false);
    messagesAdapter.notifyItemRangeInserted(0,totalEntries);
  }
 else {
    messagesAdapter.setList(combinationMessagesList,true);
    scrollMessagesToBottom();
  }
  messageSwipeRefreshLayout.setRefreshing(false);
  hideActionBarProgress();
  isLoadingMessages=false;
}

Fixed version (ground truth):
@Override public void onResult(Boolean aBoolean){
  if (isLoadedOldMessages) {
    messagesAdapter.addAllInBegin(combinationMessagesList);
  }
 else {
    messagesAdapter.addAllInEnd(combinationMessagesList);
    scrollMessagesToBottom();
  }
  messageSwipeRefreshLayout.setRefreshing(false);
  hideActionBarProgress();
  isLoadingMessages=false;
}
Program: 113932
Project: 113932
Buggy source:
@Override public Boolean performInBackground(Void... params) throws Exception {
  combinationMessagesList=createCombinationMessagesList();
  additionalActionsAfterLoadMessages();
  return true;
}

Fixed version (ground truth):
@Override public Boolean performInBackground(Void... params) throws Exception {
  combinationMessagesList=buildCombinationMessagesListByDate(lastMessageDate,isLoadedOldMessages);
  additionalActionsAfterLoadMessages();
  return true;
}
Program: 113933
Project: 113933
Buggy source:
public void setList(List<CombinationMessage> collection,boolean notifyDataChanged){
  if (notifyDataChanged) {
    addList(collection);
  }
 else {
    chatMessages.clear();
    chatMessages.addAll(collection);
  }
}

Fixed version (ground truth):
public void setList(List<CombinationMessage> collection,boolean notifyDataChanged){
  chatMessages=collection;
  if (notifyDataChanged) {
    this.notifyDataSetChanged();
  }
}
Program: 113935
Project: 113935
Buggy source:
protected void startLoadDialogMessages(boolean isLoadOldMessages){
  if (currentChatDialog == null) {
    return;
  }
  showActionBarProgress();
  List<DialogOccupant> dialogOccupantsList=dataManager.getDialogOccupantDataManager().getDialogOccupantsListByDialogId(currentChatDialog.getDialogId());
  List<Long> dialogOccupantsIdsList=ChatUtils.getIdsFromDialogOccupantsList(dialogOccupantsList);
  Message message;
  DialogNotification dialogNotification;
  message=dataManager.getMessageDataManager().getMessageByDialogId(isLoadOldMessages,dialogOccupantsIdsList);
  dialogNotification=dataManager.getDialogNotificationDataManager().getDialogNotificationByDialogId(isLoadOldMessages,dialogOccupantsIdsList);
  long messageDateSent=ChatUtils.getDialogMessageCreatedDate(!isLoadOldMessages,message,dialogNotification);
  startLoadDialogMessages(currentChatDialog,messageDateSent,isLoadOldMessages);
}

Fixed version (ground truth):
protected void startLoadDialogMessages(final boolean isLoadOldMessages){
  if (currentChatDialog == null) {
    return;
  }
  showActionBarProgress();
  (new BaseAsyncTask<Void,Void,Boolean>(){
    private long messageDateSent;
    @Override public Boolean performInBackground(    Void... params) throws Exception {
      List<DialogOccupant> dialogOccupantsList=dataManager.getDialogOccupantDataManager().getDialogOccupantsListByDialogId(currentChatDialog.getDialogId());
      List<Long> dialogOccupantsIdsList=ChatUtils.getIdsFromDialogOccupantsList(dialogOccupantsList);
      Message message;
      DialogNotification dialogNotification;
      message=dataManager.getMessageDataManager().getMessageByDialogId(isLoadOldMessages,dialogOccupantsIdsList);
      dialogNotification=dataManager.getDialogNotificationDataManager().getDialogNotificationByDialogId(isLoadOldMessages,dialogOccupantsIdsList);
      messageDateSent=ChatUtils.getDialogMessageCreatedDate(!isLoadOldMessages,message,dialogNotification);
      return true;
    }
    @Override public void onResult(    Boolean aBoolean){
      startLoadDialogMessages(currentChatDialog,messageDateSent,isLoadOldMessages);
    }
    @Override public void onException(    Exception e){
      hideActionBarProgress();
      ErrorUtils.showError(BaseDialogActivity.this,e);
    }
  }
).execute();
}
Program: 113936
Project: 113936
Buggy source:
protected void initFields(){
  mainThreadHandler=new Handler(Looper.getMainLooper());
  resources=getResources();
  dataManager=DataManager.getInstance();
  imageUtils=new ImageUtils(this);
  loadAttachFileSuccessAction=new LoadAttachFileSuccessAction();
  loadDialogMessagesSuccessAction=new LoadDialogMessagesSuccessAction();
  loadDialogMessagesFailAction=new LoadDialogMessagesFailAction();
  typingTimer=new Timer();
  dialogObserver=new DialogObserver();
  messageObserver=new MessageObserver();
  dialogNotificationObserver=new DialogNotificationObserver();
  updatingDialogBroadcastReceiver=new UpdatingDialogBroadcastReceiver();
  appSharedHelper.saveNeedToOpenDialog(false);
  imagePickHelper=new ImagePickHelper();
  systemPermissionHelper=new SystemPermissionHelper(this);
  messagesTextViewLinkClickListener=new MessagesTextViewLinkClickListener();
  locationAttachClickListener=new LocationAttachClickListener();
  imageAttachClickListener=new ImageAttachClickListener();
  currentChatDialog=(QBChatDialog)getIntent().getExtras().getSerializable(QBServiceConsts.EXTRA_DIALOG);
  combinationMessagesList=createCombinationMessagesList();
}

Fixed version (ground truth):
protected void initFields(){
  mainThreadHandler=new Handler(Looper.getMainLooper());
  resources=getResources();
  dataManager=DataManager.getInstance();
  imageUtils=new ImageUtils(this);
  loadAttachFileSuccessAction=new LoadAttachFileSuccessAction();
  loadDialogMessagesSuccessAction=new LoadDialogMessagesSuccessAction();
  loadDialogMessagesFailAction=new LoadDialogMessagesFailAction();
  typingTimer=new Timer();
  dialogObserver=new DialogObserver();
  messageObserver=new MessageObserver();
  dialogNotificationObserver=new DialogNotificationObserver();
  updatingDialogBroadcastReceiver=new UpdatingDialogBroadcastReceiver();
  appSharedHelper.saveNeedToOpenDialog(false);
  imagePickHelper=new ImagePickHelper();
  systemPermissionHelper=new SystemPermissionHelper(this);
  messagesTextViewLinkClickListener=new MessagesTextViewLinkClickListener();
  locationAttachClickListener=new LocationAttachClickListener();
  imageAttachClickListener=new ImageAttachClickListener();
  currentChatDialog=(QBChatDialog)getIntent().getExtras().getSerializable(QBServiceConsts.EXTRA_DIALOG);
  combinationMessagesList=new ArrayList<>();
}