nus-yam/ex-repair huggingface dataset:
Program: 42882
Project: 42882
Buggy source:
public static String joinAndUrlEncode(Collection<String> list) throws UnsupportedEncodingException {
  if (list == null || list.isEmpty()) {
    return "String_Node_Str";
  }
  return URLEncoder.encode(Joiner.on("String_Node_Str").join(list),"String_Node_Str");
}

Fixed version (ground truth):
public static String joinAndUrlEncode(Collection<String> list) throws UnsupportedEncodingException {
  if (list == null || list.isEmpty()) {
    return "String_Node_Str";
  }
  return encode(Joiner.on("String_Node_Str").join(list));
}
Program: 42884
Project: 42884
Buggy source:
private void notifyClientUsedImpl(Rp rp,boolean isClientLocal){
  try {
    String licenseId=conf.getLicenseId();
    String clientId=rp.getClientId();
    String oxdId=rp.getOxdId();
    String clientName=rp.getClientName();
    String macAddress=MacAddressProvider.macAddress();
    StatisticUpdateRequest request=StatisticUpdateRequest.clientUpdate(licenseId,clientId,oxdId,clientName,macAddress,isClientLocal);
    request.setAppMetadata(appMetadata(rp.getOxdRpProgrammingLanguage()));
    LOG.trace("String_Node_Str" + request);
    LicenseClient.statisticWs(LicenseFileUpdateService.LICENSE_SERVER_ENDPOINT,httpService.getClientExecutor()).update(request);
    LOG.trace("String_Node_Str" + request);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str" + e.getMessage(),e);
  }
}

Fixed version (ground truth):
private void notifyClientUsedImpl(Rp rp,boolean isClientLocal){
  try {
    String licenseId=conf.getLicenseId();
    String clientId=rp.getClientId();
    String oxdId=rp.getOxdId();
    String clientName=rp.getClientName();
    String macAddress=MacAddressProvider.macAddress();
    StatisticUpdateRequest request=StatisticUpdateRequest.clientUpdate(licenseId,clientId,oxdId,clientName,macAddress,isClientLocal);
    request.setAppMetadata(appMetadata(rp.getOxdRpProgrammingLanguage()));
    LOG.trace("String_Node_Str" + request);
    LicenseClient.statisticWs(LicenseFileUpdateService.LICENSE_SERVER_ENDPOINT,httpService.getClientExecutor()).update(request);
    LOG.trace("String_Node_Str" + oxdId);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str" + e.getMessage(),e);
  }
}
Program: 42885
Project: 42885
Buggy source:
@Parameters({"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}) @Test public void register(String host,int port,String opHost,String redirectUrl,String postLogoutRedirectUrl,String logoutUrl) throws IOException {
  CommandClient client=null;
  try {
    client=new CommandClient(host,port);
    RegisterSiteResponse resp=registerSite(client,opHost,redirectUrl,postLogoutRedirectUrl,logoutUrl);
    assertNotNull(resp);
    notEmpty(resp.getOxdId());
    final RegisterSiteParams commandParams=new RegisterSiteParams();
    commandParams.setOpHost(opHost);
    commandParams.setAuthorizationRedirectUri(redirectUrl);
    commandParams.setPostLogoutRedirectUri(postLogoutRedirectUrl);
    commandParams.setClientLogoutUri(Lists.newArrayList(logoutUrl));
    commandParams.setRedirectUris(Arrays.asList(redirectUrl));
    commandParams.setAcrValues(new ArrayList<String>());
    commandParams.setScope(Lists.newArrayList("String_Node_Str","String_Node_Str"));
    commandParams.setGrantType(Lists.newArrayList("String_Node_Str"));
    commandParams.setResponseTypes(Lists.newArrayList("String_Node_Str"));
    final Command command=new Command(CommandType.REGISTER_SITE);
    command.setParamsObject(commandParams);
    resp=client.send(command).dataAsResponse(RegisterSiteResponse.class);
    assertNotNull(resp);
    assertNotNull(resp.getOxdId());
    oxdId=resp.getOxdId();
  }
  finally {
    CommandClient.closeQuietly(client);
  }
}

Fixed version (ground truth):
@Parameters({"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}) @Test public void register(String host,int port,String opHost,String redirectUrl,String postLogoutRedirectUrl,String logoutUrl) throws IOException {
  CommandClient client=null;
  try {
    client=new CommandClient(host,port);
    final SetupClientResponse setupClient=SetupClientTest.setupClient(client,opHost,redirectUrl);
    final RegisterSiteParams commandParams=new RegisterSiteParams();
    commandParams.setProtectionAccessToken(setupClient.getClientRegistrationAccessToken());
    commandParams.setOpHost(opHost);
    commandParams.setAuthorizationRedirectUri(redirectUrl);
    commandParams.setPostLogoutRedirectUri(postLogoutRedirectUrl);
    commandParams.setClientLogoutUri(Lists.newArrayList(logoutUrl));
    commandParams.setRedirectUris(Arrays.asList(redirectUrl));
    commandParams.setAcrValues(new ArrayList<String>());
    commandParams.setScope(Lists.newArrayList("String_Node_Str","String_Node_Str"));
    commandParams.setGrantType(Lists.newArrayList("String_Node_Str"));
    commandParams.setResponseTypes(Lists.newArrayList("String_Node_Str"));
    final Command command=new Command(CommandType.REGISTER_SITE);
    command.setParamsObject(commandParams);
    RegisterSiteResponse resp=client.send(command).dataAsResponse(RegisterSiteResponse.class);
    assertNotNull(resp);
    assertNotNull(resp.getOxdId());
    oxdId=resp.getOxdId();
  }
  finally {
    CommandClient.closeQuietly(client);
  }
}
Program: 42886
Project: 42886
Buggy source:
private void validateAccessToken(String oxdId,RegisterSiteParams params){
  final Configuration conf=getConfigurationService().getConfiguration();
  if (conf.getProtectCommandsWithAccessToken() != null && !conf.getProtectCommandsWithAccessToken()) {
    if (StringUtils.isBlank(params.getProtectionAccessToken())) {
      return;
    }
  }
  final IntrospectionResponse response=getValidationService().introspect(params.getProtectionAccessToken(),params.getOxdId());
  LOG.trace("String_Node_Str" + response + "String_Node_Str"+ rp.getSetupClientId());
  rp.setSetupClientId(response.getClientId());
  rp.setSetupOxdId(oxdId);
  getRpService().updateSilently(rp);
}

Fixed version (ground truth):
private void validateAccessToken(String oxdId,RegisterSiteParams params){
  final Configuration conf=getConfigurationService().getConfiguration();
  if (conf.getProtectCommandsWithAccessToken() != null && !conf.getProtectCommandsWithAccessToken()) {
    if (StringUtils.isBlank(params.getProtectionAccessToken())) {
      return;
    }
  }
  if (params instanceof SetupClientParams) {
    return;
  }
  final IntrospectionResponse response=getValidationService().introspect(params.getProtectionAccessToken(),oxdId);
  LOG.trace("String_Node_Str" + response + "String_Node_Str"+ rp.getSetupClientId());
  rp.setSetupClientId(response.getClientId());
  rp.setSetupOxdId(oxdId);
  getRpService().updateSilently(rp);
}
Program: 42887
Project: 42887
Buggy source:
@Override public CommandResponse execute(RpAuthorizeRptParams params){
  validate(params);
  final RptAuthorizationRequest authorizationRequest=new RptAuthorizationRequest(params.getRpt(),params.getTicket());
  LOG.debug("String_Node_Str",params.getTicket());
  final RptAuthorizationRequestService rptAuthorizationService=UmaClientFactory.instance().createAuthorizationRequestService(getDiscoveryService().getUmaDiscoveryByOxdId(params.getOxdId()),getHttpService().getClientExecutor());
  final RptAuthorizationResponse authorizationResponse=rptAuthorizationService.requestRptPermissionAuthorization("String_Node_Str" + getUmaTokenService().getAat(params.getOxdId()).getToken(),getRp().opHostWithoutProtocol(),authorizationRequest);
  if (authorizationResponse != null) {
    LOG.trace("String_Node_Str",params.getRpt());
    return okResponse(new RpAuthorizeRptResponse(params.getOxdId()));
  }
  return CommandResponse.createErrorResponse(ErrorResponseCode.RPT_NOT_AUTHORIZED);
}

Fixed version (ground truth):
@Override public CommandResponse execute(RpAuthorizeRptParams params){
  validate(params);
  final RptAuthorizationRequest authorizationRequest=new RptAuthorizationRequest(params.getRpt(),params.getTicket());
  LOG.debug("String_Node_Str",params.getTicket());
  final RptAuthorizationRequestService rptAuthorizationService=UmaClientFactory.instance().createAuthorizationRequestService(getDiscoveryService().getUmaDiscoveryByOxdId(params.getOxdId()),getHttpService().getClientExecutor());
  try {
    final RptAuthorizationResponse authorizationResponse=rptAuthorizationService.requestRptPermissionAuthorization("String_Node_Str" + getUmaTokenService().getAat(params.getOxdId()).getToken(),getRp().opHostWithoutProtocol(),authorizationRequest);
    if (authorizationResponse != null) {
      LOG.trace("String_Node_Str",params.getRpt());
      return okResponse(new RpAuthorizeRptResponse(params.getOxdId()));
    }
  }
 catch (  ClientResponseFailure e) {
    LOG.trace("String_Node_Str",e);
  }
catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
  return CommandResponse.createErrorResponse(ErrorResponseCode.RPT_NOT_AUTHORIZED);
}
Program: 42888
Project: 42888
Buggy source:
public Pat getPat(String oxdId){
  validationService.notBlankOxdId(oxdId);
  SiteConfiguration site=siteService.getSite(oxdId);
  if (site.getPat() != null && site.getPatCreatedAt() != null && site.getPatExpiresIn() > 0) {
    Calendar c=Calendar.getInstance();
    c.setTime(site.getPatCreatedAt());
    c.add(Calendar.SECOND,site.getPatExpiresIn());
    boolean isExpired=c.getTime().after(new Date());
    if (!isExpired) {
      LOG.debug("String_Node_Str" + site.getPat());
      return new Pat(site.getPat(),"String_Node_Str",site.getPatExpiresIn());
    }
  }
  return obtainPat(oxdId);
}

Fixed version (ground truth):
public Pat getPat(String oxdId){
  validationService.notBlankOxdId(oxdId);
  SiteConfiguration site=siteService.getSite(oxdId);
  if (site.getPat() != null && site.getPatCreatedAt() != null && site.getPatExpiresIn() > 0) {
    Calendar c=Calendar.getInstance();
    c.setTime(site.getPatCreatedAt());
    c.add(Calendar.SECOND,site.getPatExpiresIn());
    boolean isExpired=c.getTime().before(new Date());
    if (!isExpired) {
      LOG.debug("String_Node_Str" + site.getPat());
      return new Pat(site.getPat(),"String_Node_Str",site.getPatExpiresIn());
    }
  }
  return obtainPat(oxdId);
}
Program: 42891
Project: 42891
Buggy source:
public Aat getAat(String oxdId){
  validationService.notBlankOxdId(oxdId);
  SiteConfiguration site=siteService.getSite(oxdId);
  if (site.getAat() != null && site.getAatCreatedAt() != null && site.getAatExpiresIn() > 0) {
    Calendar c=Calendar.getInstance();
    c.setTime(site.getAatCreatedAt());
    c.add(Calendar.SECOND,site.getAatExpiresIn());
    boolean isExpired=c.getTime().after(new Date());
    if (!isExpired) {
      LOG.debug("String_Node_Str" + site);
      return new Aat(site.getAat(),"String_Node_Str",site.getAatExpiresIn());
    }
  }
  return obtainAat(oxdId);
}

Fixed version (ground truth):
public Aat getAat(String oxdId){
  validationService.notBlankOxdId(oxdId);
  SiteConfiguration site=siteService.getSite(oxdId);
  if (site.getAat() != null && site.getAatCreatedAt() != null && site.getAatExpiresIn() > 0) {
    Calendar c=Calendar.getInstance();
    c.setTime(site.getAatCreatedAt());
    c.add(Calendar.SECOND,site.getAatExpiresIn());
    boolean isExpired=c.getTime().before(new Date());
    if (!isExpired) {
      LOG.debug("String_Node_Str" + site);
      return new Aat(site.getAat(),"String_Node_Str",site.getAatExpiresIn());
    }
  }
  return obtainAat(oxdId);
}
Program: 42892
Project: 42892
Buggy source:
@Override public CommandResponse execute(RegisterSiteParams params){
  try {
    validateParametersAndFallbackIfNeeded(params);
    String siteId=UUID.randomUUID().toString();
    LOG.info("String_Node_Str");
    persistSiteConfiguration(siteId,params);
    LOG.info("String_Node_Str" + siteConfiguration);
    RegisterSiteResponse opResponse=new RegisterSiteResponse();
    opResponse.setOxdId(siteId);
    opResponse.setOpHost(params.getOpHost());
    return okResponse(opResponse);
  }
 catch (  Exception e) {
    LOG.error(e.getMessage(),e);
  }
  return CommandResponse.INTERNAL_ERROR_RESPONSE;
}

Fixed version (ground truth):
@Override public CommandResponse execute(RegisterSiteParams params){
  try {
    validateParametersAndFallbackIfNeeded(params);
    String siteId=UUID.randomUUID().toString();
    LOG.info("String_Node_Str");
    persistSiteConfiguration(siteId,params);
    LOG.info("String_Node_Str" + siteConfiguration);
    RegisterSiteResponse opResponse=new RegisterSiteResponse();
    opResponse.setOxdId(siteId);
    opResponse.setOpHost(params.getOpHost());
    return okResponse(opResponse);
  }
 catch (  ErrorResponseException e) {
    throw e;
  }
catch (  Exception e) {
    LOG.error(e.getMessage(),e);
  }
  return CommandResponse.INTERNAL_ERROR_RESPONSE;
}
Program: 42893
Project: 42893
Buggy source:
@Parameters({"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}) @Test public void test(String host,int port,String redirectUrl,String opHost) throws IOException {
  CommandClient client=null;
  try {
    client=new CommandClient(host,port);
    final RegisterSiteResponse site=RegisterSiteTest.registerSite(client,opHost,redirectUrl);
    final GetAuthorizationUrlParams commandParams=new GetAuthorizationUrlParams();
    commandParams.setOxdId(site.getOxdId());
    final Command command=new Command(CommandType.GET_AUTHORIZATION_URL);
    command.setParamsObject(commandParams);
    final GetAuthorizationUrlResponse resp=client.send(command).dataAsResponse(GetAuthorizationUrlResponse.class);
    assertNotNull(resp);
    notEmpty(resp.getAuthorizationUrl());
    Assert.assertTrue(resp.getAuthorizationUrl().contains("String_Node_Str"));
  }
  finally {
    CommandClient.closeQuietly(client);
  }
}

Fixed version (ground truth):
@Parameters({"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}) @Test public void test(String host,int port,String redirectUrl,String opHost) throws IOException {
  CommandClient client=null;
  try {
    client=new CommandClient(host,port);
    final RegisterSiteResponse site=RegisterSiteTest.registerSite(client,opHost,redirectUrl);
    final GetAuthorizationUrlParams commandParams=new GetAuthorizationUrlParams();
    commandParams.setOxdId(site.getOxdId());
    final Command command=new Command(CommandType.GET_AUTHORIZATION_URL);
    command.setParamsObject(commandParams);
    final GetAuthorizationUrlResponse resp=client.send(command).dataAsResponse(GetAuthorizationUrlResponse.class);
    assertNotNull(resp);
    notEmpty(resp.getAuthorizationUrl());
  }
  finally {
    CommandClient.closeQuietly(client);
  }
}
Program: 42897
Project: 42897
Buggy source:
private void setButtonsState(){
  this.view.getRemoveButton().setEnabled(!selectionModel.getSelectedSet().isEmpty());
  this.view.getRemoveButton().setEnabled(selectionModel.getSelectedSet().size() == 1);
}

Fixed version (ground truth):
private void setButtonsState(){
  this.view.getRemoveButton().setEnabled(!selectionModel.getSelectedSet().isEmpty());
  this.view.getEditButton().setEnabled(selectionModel.getSelectedSet().size() == 1);
}
Program: 42898
Project: 42898
Buggy source:
public static SafeHtml asHtml(String str){
  String s=str != null ? str : "String_Node_Str";
  return SafeHtmlUtils.fromString(s);
}

Fixed version (ground truth):
public static SafeHtml asHtml(String str){
  String s=str != null ? str : "String_Node_Str";
  if (s.length() > 40) {
    s=s.substring(0,40) + "String_Node_Str";
  }
  return SafeHtmlUtils.fromString(s);
}
Program: 42899
Project: 42899
Buggy source:
private void clear(){
  view.getNameField().setHTML("String_Node_Str");
  view.getPrivateKey().setHTML("String_Node_Str");
  view.getPublicKey().setHTML("String_Node_Str");
  view.getClientPublicKey().setHTML("String_Node_Str");
  view.getClientPrivateKey().setHTML("String_Node_Str");
  view.getPrivatePassword().setHTML("String_Node_Str");
  view.getPublicPassword().setHTML("String_Node_Str");
  view.getLicensePassword().setHTML("String_Node_Str");
  view.getLicenseIdCount().setHTML("String_Node_Str");
  view.getLicenseIds().setRowCount(0);
  view.getLicenseIds().setRowData(new ArrayList<LdapLicenseId>());
}

Fixed version (ground truth):
public void clear(){
  view.getNameField().setHTML("String_Node_Str");
  view.getPrivateKey().setHTML("String_Node_Str");
  view.getPublicKey().setHTML("String_Node_Str");
  view.getClientPublicKey().setHTML("String_Node_Str");
  view.getClientPrivateKey().setHTML("String_Node_Str");
  view.getPrivatePassword().setHTML("String_Node_Str");
  view.getPublicPassword().setHTML("String_Node_Str");
  view.getLicensePassword().setHTML("String_Node_Str");
  view.getLicenseIdCount().setHTML("String_Node_Str");
  view.getLicenseIds().setRowCount(0);
  view.getLicenseIds().setRowData(new ArrayList<LdapLicenseId>());
}
Program: 42900
Project: 42900
Buggy source:
private void onRemove(){
  Admin.getService().remove(selectionModel.getSelectedSet(),new SuccessCallback<Void>(){
    @Override public void onSuccess(    Void result){
      LicenseCryptDetailsPresenter.this.clear();
    }
  }
);
}

Fixed version (ground truth):
private void onRemove(){
  Admin.getService().remove(selectionModel.getSelectedSet(),new SuccessCallback<Void>(){
    @Override public void onSuccess(    Void result){
      LicenseCryptDetailsPresenter.this.loadLicenseIds();
    }
  }
);
}
Program: 42901
Project: 42901
Buggy source:
public void show(LdapLicenseCrypt licenseCrypt){
  this.licenseCrypt=licenseCrypt;
  view.getNameField().setHTML(Admin.asHtml(licenseCrypt.getName()));
  view.getPrivateKey().setHTML(Admin.asHtml(licenseCrypt.getPrivateKey()));
  view.getPublicKey().setHTML(Admin.asHtml(licenseCrypt.getPublicKey()));
  view.getClientPublicKey().setHTML(Admin.asHtml(licenseCrypt.getClientPublicKey()));
  view.getClientPrivateKey().setHTML(Admin.asHtml(licenseCrypt.getClientPrivateKey()));
  view.getPrivatePassword().setHTML(Admin.asHtml(licenseCrypt.getPrivatePassword()));
  view.getPublicPassword().setHTML(Admin.asHtml(licenseCrypt.getPublicPassword()));
  view.getLicensePassword().setHTML(Admin.asHtml(licenseCrypt.getLicensePassword()));
}

Fixed version (ground truth):
public void show(LdapLicenseCrypt licenseCrypt){
  this.licenseCrypt=licenseCrypt;
  if (licenseCrypt == null) {
    clear();
  }
  view.getNameField().setHTML(Admin.asHtml(licenseCrypt.getName()));
  view.getPrivateKey().setHTML(Admin.asHtml(licenseCrypt.getPrivateKey()));
  view.getPublicKey().setHTML(Admin.asHtml(licenseCrypt.getPublicKey()));
  view.getClientPublicKey().setHTML(Admin.asHtml(licenseCrypt.getClientPublicKey()));
  view.getClientPrivateKey().setHTML(Admin.asHtml(licenseCrypt.getClientPrivateKey()));
  view.getPrivatePassword().setHTML(Admin.asHtml(licenseCrypt.getPrivatePassword()));
  view.getPublicPassword().setHTML(Admin.asHtml(licenseCrypt.getPublicPassword()));
  view.getLicensePassword().setHTML(Admin.asHtml(licenseCrypt.getLicensePassword()));
}
Program: 42902
Project: 42902
Buggy source:
public LicenseCryptTab(){
  uiBinder.createAndBindUi(this);
}

Fixed version (ground truth):
public LicenseCryptTab(){
  uiBinder.createAndBindUi(this);
  table.addColumn(new TextColumn<LdapLicenseCrypt>(){
    @Override public String getValue(    LdapLicenseCrypt object){
      return object.getName();
    }
  }
,"String_Node_Str");
}
Program: 42903
Project: 42903
Buggy source:
@NotNull public static String sysFrameCommand(final int frameNumber){
  return String.format("String_Node_Str",frameNumber);
}

Fixed version (ground truth):
@NotNull private static String sysFrameCommand(final int frameNumber){
  return String.format("String_Node_Str",frameNumber);
}
Program: 42904
Project: 42904
Buggy source:
@Test public void innerFunctionValueHandling(){
  assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str",TheRDebuggerUtils.handleValue("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + ENVIRONMENT + "String_Node_Str"));
}

Fixed version (ground truth):
@Test public void innerFunctionValueHandling(){
  assertEquals("String_Node_Str" + "String_Node_Str" + "String_Node_Str",TheRDebuggerUtils.handleValue("String_Node_Str" + "String_Node_Str" + "String_Node_Str" + ENVIRONMENT_PREFIX + "String_Node_Str"));
}
Program: 42905
Project: 42905
Buggy source:
public TheRDebugProcess(@NotNull final XDebugSession session,@NotNull final TheRXProcessHandler processHandler,@NotNull final List<String> initCommands,@NotNull final TheRDebugger debugger,@NotNull final TheRXOutputReceiver outputReceiver,@NotNull final TheRXResolvingSession resolvingSession,@NotNull final ExecutorService executor){
  super(session);
  myProcessHandler=processHandler;
  myInitCommands=initCommands;
  myDebugger=debugger;
  myOutputReceiver=outputReceiver;
  myStack=new TheRXStack(myDebugger.getStack(),resolvingSession,executor);
  myExecutor=executor;
  myBreakpoints=new HashMap<XSourcePositionWrapper,XLineBreakpoint<XBreakpointProperties>>();
  myTempBreakpoints=new HashSet<XSourcePositionWrapper>();
  myConsole=(ConsoleView)super.createConsole();
  myEditorsProvider=new TheREditorsProvider();
  myBreakpointHandlers=new XBreakpointHandler[]{new TheRXLineBreakpointHandler()};
  myProcessHandler.addListener(this);
  myConsole.attachToProcess(myProcessHandler);
}

Fixed version (ground truth):
public TheRDebugProcess(@NotNull final XDebugSession session,@NotNull final TheRXProcessHandler processHandler,@NotNull final List<String> initCommands,@NotNull final TheRDebugger debugger,@NotNull final TheRXOutputReceiver outputReceiver,@NotNull final TheRResolvingSession resolvingSession,@NotNull final ExecutorService executor){
  super(session);
  myProcessHandler=processHandler;
  myInitCommands=initCommands;
  myDebugger=debugger;
  myOutputReceiver=outputReceiver;
  myStack=new TheRXStack(myDebugger.getStack(),resolvingSession,executor);
  myExecutor=executor;
  myBreakpoints=new HashMap<XSourcePositionWrapper,XLineBreakpoint<XBreakpointProperties>>();
  myTempBreakpoints=new HashSet<XSourcePositionWrapper>();
  myConsole=(ConsoleView)super.createConsole();
  myEditorsProvider=new TheREditorsProvider();
  myBreakpointHandlers=new XBreakpointHandler[]{new TheRXLineBreakpointHandler()};
  myProcessHandler.addListener(this);
  myConsole.attachToProcess(myProcessHandler);
}
Program: 42906
Project: 42906
Buggy source:
@Test public void sameDepth(){
  final List<TheRStackFrame> originalStack=new ArrayList<TheRStackFrame>();
  final MockTheRXResolvingSession resolvingSession=new MockTheRXResolvingSession();
  final TheRXStack stack=new TheRXStack(originalStack,resolvingSession,ExecutorServices.ILLEGAL_EXECUTOR);
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",2),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  stack.update();
  assertEquals(0,resolvingSession.myCurrent);
  assertEquals(2,resolvingSession.myNext);
  assertEquals(0,resolvingSession.myDropped);
  check(stack,2,1);
  originalStack.set(1,new TheRStackFrame(new TheRLocation("String_Node_Str",2),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  stack.update();
  assertEquals(1,resolvingSession.myCurrent);
  assertEquals(2,resolvingSession.myNext);
  assertEquals(0,resolvingSession.myDropped);
  check(stack,3,1);
}

Fixed version (ground truth):
@Test public void sameDepth(){
  final List<TheRStackFrame> originalStack=new ArrayList<TheRStackFrame>();
  final MockTheRResolvingSession resolvingSession=new MockTheRResolvingSession();
  final TheRXStack stack=new TheRXStack(originalStack,resolvingSession,ExecutorServices.ILLEGAL_EXECUTOR);
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",2),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  stack.update();
  assertEquals(0,resolvingSession.myCurrent);
  assertEquals(2,resolvingSession.myNext);
  assertEquals(0,resolvingSession.myDropped);
  check(stack,2,1);
  originalStack.set(1,new TheRStackFrame(new TheRLocation("String_Node_Str",2),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  stack.update();
  assertEquals(1,resolvingSession.myCurrent);
  assertEquals(2,resolvingSession.myNext);
  assertEquals(0,resolvingSession.myDropped);
  check(stack,3,1);
}
Program: 42907
Project: 42907
Buggy source:
@Test public void plusOneDepth(){
  final List<TheRStackFrame> originalStack=new ArrayList<TheRStackFrame>();
  final MockTheRXResolvingSession resolvingSession=new MockTheRXResolvingSession();
  final TheRXStack stack=new TheRXStack(originalStack,resolvingSession,ExecutorServices.ILLEGAL_EXECUTOR);
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",2),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  stack.update();
  assertEquals(2,resolvingSession.myNext);
  assertEquals(0,resolvingSession.myCurrent);
  assertEquals(0,resolvingSession.myDropped);
  check(stack,2,1);
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  stack.update();
  assertEquals(3,resolvingSession.myNext);
  assertEquals(0,resolvingSession.myCurrent);
  assertEquals(0,resolvingSession.myDropped);
  check(stack,3,2,1);
}

Fixed version (ground truth):
@Test public void plusOneDepth(){
  final List<TheRStackFrame> originalStack=new ArrayList<TheRStackFrame>();
  final MockTheRResolvingSession resolvingSession=new MockTheRResolvingSession();
  final TheRXStack stack=new TheRXStack(originalStack,resolvingSession,ExecutorServices.ILLEGAL_EXECUTOR);
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",2),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  stack.update();
  assertEquals(2,resolvingSession.myNext);
  assertEquals(0,resolvingSession.myCurrent);
  assertEquals(0,resolvingSession.myDropped);
  check(stack,2,1);
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  stack.update();
  assertEquals(3,resolvingSession.myNext);
  assertEquals(0,resolvingSession.myCurrent);
  assertEquals(0,resolvingSession.myDropped);
  check(stack,3,2,1);
}
Program: 42908
Project: 42908
Buggy source:
@Test public void minusOneDepth(){
  final List<TheRStackFrame> originalStack=new ArrayList<TheRStackFrame>();
  final MockTheRXResolvingSession resolvingSession=new MockTheRXResolvingSession();
  final TheRXStack stack=new TheRXStack(originalStack,resolvingSession,ExecutorServices.ILLEGAL_EXECUTOR);
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",2),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  stack.update();
  assertEquals(2,resolvingSession.myNext);
  assertEquals(0,resolvingSession.myCurrent);
  assertEquals(0,resolvingSession.myDropped);
  check(stack,2,1);
  originalStack.remove(originalStack.size() - 1);
  stack.update();
  assertEquals(2,resolvingSession.myNext);
  assertEquals(1,resolvingSession.myCurrent);
  assertEquals(1,resolvingSession.myDropped);
  check(stack,3,1);
}

Fixed version (ground truth):
@Test public void minusOneDepth(){
  final List<TheRStackFrame> originalStack=new ArrayList<TheRStackFrame>();
  final MockTheRResolvingSession resolvingSession=new MockTheRResolvingSession();
  final TheRXStack stack=new TheRXStack(originalStack,resolvingSession,ExecutorServices.ILLEGAL_EXECUTOR);
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",2),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  stack.update();
  assertEquals(2,resolvingSession.myNext);
  assertEquals(0,resolvingSession.myCurrent);
  assertEquals(0,resolvingSession.myDropped);
  check(stack,2,1);
  originalStack.remove(originalStack.size() - 1);
  stack.update();
  assertEquals(2,resolvingSession.myNext);
  assertEquals(1,resolvingSession.myCurrent);
  assertEquals(1,resolvingSession.myDropped);
  check(stack,3,1);
}
Program: 42909
Project: 42909
Buggy source:
@Test public void lessDepth(){
  final List<TheRStackFrame> originalStack=new ArrayList<TheRStackFrame>();
  final MockTheRXResolvingSession resolvingSession=new MockTheRXResolvingSession();
  final TheRXStack stack=new TheRXStack(originalStack,resolvingSession,ExecutorServices.ILLEGAL_EXECUTOR);
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",2),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  stack.update();
  assertEquals(3,resolvingSession.myNext);
  assertEquals(0,resolvingSession.myCurrent);
  assertEquals(0,resolvingSession.myDropped);
  check(stack,3,2,1);
  originalStack.remove(originalStack.size() - 1);
  originalStack.remove(originalStack.size() - 1);
  stack.update();
  assertEquals(3,resolvingSession.myNext);
  assertEquals(1,resolvingSession.myCurrent);
  assertEquals(2,resolvingSession.myDropped);
  check(stack,4);
}

Fixed version (ground truth):
@Test public void lessDepth(){
  final List<TheRStackFrame> originalStack=new ArrayList<TheRStackFrame>();
  final MockTheRResolvingSession resolvingSession=new MockTheRResolvingSession();
  final TheRXStack stack=new TheRXStack(originalStack,resolvingSession,ExecutorServices.ILLEGAL_EXECUTOR);
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",2),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  stack.update();
  assertEquals(3,resolvingSession.myNext);
  assertEquals(0,resolvingSession.myCurrent);
  assertEquals(0,resolvingSession.myDropped);
  check(stack,3,2,1);
  originalStack.remove(originalStack.size() - 1);
  originalStack.remove(originalStack.size() - 1);
  stack.update();
  assertEquals(3,resolvingSession.myNext);
  assertEquals(1,resolvingSession.myCurrent);
  assertEquals(2,resolvingSession.myDropped);
  check(stack,4);
}
Program: 42910
Project: 42910
Buggy source:
@Test public void moreDepth(){
  final List<TheRStackFrame> originalStack=new ArrayList<TheRStackFrame>();
  final MockTheRXResolvingSession resolvingSession=new MockTheRXResolvingSession();
  final TheRXStack stack=new TheRXStack(originalStack,resolvingSession,ExecutorServices.ILLEGAL_EXECUTOR);
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",2),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  stack.update();
  assertEquals(2,resolvingSession.myNext);
  assertEquals(0,resolvingSession.myCurrent);
  assertEquals(0,resolvingSession.myDropped);
  check(stack,2,1);
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  stack.update();
  assertEquals(4,resolvingSession.myNext);
  assertEquals(0,resolvingSession.myCurrent);
  assertEquals(0,resolvingSession.myDropped);
  check(stack,4,3,2,1);
}

Fixed version (ground truth):
@Test public void moreDepth(){
  final List<TheRStackFrame> originalStack=new ArrayList<TheRStackFrame>();
  final MockTheRResolvingSession resolvingSession=new MockTheRResolvingSession();
  final TheRXStack stack=new TheRXStack(originalStack,resolvingSession,ExecutorServices.ILLEGAL_EXECUTOR);
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",2),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  stack.update();
  assertEquals(2,resolvingSession.myNext);
  assertEquals(0,resolvingSession.myCurrent);
  assertEquals(0,resolvingSession.myDropped);
  check(stack,2,1);
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  originalStack.add(new TheRStackFrame(new TheRLocation("String_Node_Str",1),new IllegalTheRVarsLoader(),new IllegalTheRDebuggerEvaluator()));
  stack.update();
  assertEquals(4,resolvingSession.myNext);
  assertEquals(0,resolvingSession.myCurrent);
  assertEquals(0,resolvingSession.myDropped);
  check(stack,4,3,2,1);
}
Program: 42911
Project: 42911
Buggy source:
public TheRDebugger(@NotNull final TheRExecutor executor,@NotNull final TheRFunctionDebuggerFactory debuggerFactory,@NotNull final TheRVarsLoaderFactory loaderFactory,@NotNull final TheRDebuggerEvaluatorFactory evaluatorFactory,@NotNull final TheRScriptReader scriptReader,@NotNull final TheROutputReceiver outputReceiver,@NotNull final TheRExpressionHandler expressionHandler,@NotNull final TheRValueModifierFactory modifierFactory,@NotNull final TheRValueModifierHandler modifierHandler) throws TheRDebuggerException {
  myExecutor=executor;
  myDebuggerFactory=debuggerFactory;
  myLoaderFactory=loaderFactory;
  myEvaluatorFactory=evaluatorFactory;
  myScriptReader=scriptReader;
  myOutputReceiver=outputReceiver;
  myExpressionHandler=expressionHandler;
  myModifierFactory=modifierFactory;
  myModifierHandler=modifierHandler;
  myDebuggers=new ArrayList<TheRFunctionDebugger>();
  myStack=new ArrayList<TheRStackFrame>();
  myUnmodifiableStack=Collections.unmodifiableList(myStack);
  myReturnLineNumber=-1;
  myDropFrames=1;
  myIsRunning=false;
}

Fixed version (ground truth):
public TheRDebugger(@NotNull final TheRExecutor executor,@NotNull final TheRFunctionDebuggerFactory debuggerFactory,@NotNull final TheRVarsLoaderFactory loaderFactory,@NotNull final TheRDebuggerEvaluatorFactory evaluatorFactory,@NotNull final TheRScriptReader scriptReader,@NotNull final TheROutputReceiver outputReceiver,@NotNull final TheRExpressionHandler expressionHandler,@NotNull final TheRValueModifierFactory modifierFactory,@NotNull final TheRValueModifierHandler modifierHandler){
  myExecutor=executor;
  myDebuggerFactory=debuggerFactory;
  myLoaderFactory=loaderFactory;
  myEvaluatorFactory=evaluatorFactory;
  myScriptReader=scriptReader;
  myOutputReceiver=outputReceiver;
  myExpressionHandler=expressionHandler;
  myModifierFactory=modifierFactory;
  myModifierHandler=modifierHandler;
  myDebuggers=new ArrayList<TheRFunctionDebugger>();
  myStack=new ArrayList<TheRStackFrame>();
  myUnmodifiableStack=Collections.unmodifiableList(myStack);
  myReturnLineNumber=-1;
  myDropFrames=1;
  myIsRunning=false;
}
Program: 42912
Project: 42912
Buggy source:
@NotNull private TheRDebugger createDebugger(@NotNull final TheRXProcessHandler processHandler,@NotNull final TheRXOutputReceiver outputReceiver,@NotNull final String scriptPath) throws ExecutionException {
  try {
    return new TheRDebugger(processHandler,new TheRFunctionDebuggerFactoryImpl(),new TheRVarsLoaderFactoryImpl(processHandler,outputReceiver),new TheRDebuggerEvaluatorFactoryImpl(),new TheRScriptReaderImpl(scriptPath),outputReceiver,new TheRExpressionHandlerImpl(),new TheRValueModifierFactoryImpl(),new TheRValueModifierHandlerImpl());
  }
 catch (  final TheRDebuggerException e) {
    throw new ExecutionException(e);
  }
catch (  final IOException e) {
    throw new ExecutionException(e);
  }
}

Fixed version (ground truth):
@NotNull private TheRDebugger createDebugger(@NotNull final TheRXProcessHandler processHandler,@NotNull final TheRXOutputReceiver outputReceiver,@NotNull final String scriptPath) throws ExecutionException {
  try {
    return new TheRDebugger(processHandler,new TheRFunctionDebuggerFactoryImpl(),new TheRVarsLoaderFactoryImpl(processHandler,outputReceiver),new TheRDebuggerEvaluatorFactoryImpl(),new TheRScriptReaderImpl(scriptPath),outputReceiver,new TheRExpressionHandlerImpl(),new TheRValueModifierFactoryImpl(),new TheRValueModifierHandlerImpl());
  }
 catch (  final IOException e) {
    throw new ExecutionException(e);
  }
}
Program: 42913
Project: 42913
Buggy source:
private void writeEnvs(@NotNull final Element element){
  JDOMExternalizerUtil.writeField(element,PARENT_ENVS,Boolean.toString(isPassParentEnvs()));
  EnvironmentVariablesComponent.writeExternal(element,getEnvs());
}

Fixed version (ground truth):
private void writeEnvs(@NotNull final Element element){
  JDOMExternalizerUtil.writeField(element,PASS_PARENT_ENVS,Boolean.toString(isPassParentEnvs()));
  EnvironmentVariablesComponent.writeExternal(element,getEnvs());
}
Program: 42914
Project: 42914
Buggy source:
@Nullable @Override public String suggestedName(){
  if (StringUtil.isEmptyOrSpaces(myScriptPath)) {
    return null;
  }
  final String name=new File(myScriptPath).getName();
  final String extension=TheRFileType.INSTANCE.getDefaultExtension();
  final int dotIndex=name.length() - extension.length() - 1;
  if (StringUtil.endsWithIgnoreCase(name,extension) && name.charAt(dotIndex) == '.') {
    return name.substring(0,dotIndex);
  }
  return name;
}

Fixed version (ground truth):
@Nullable @Override public String suggestedName(){
  if (StringUtil.isEmptyOrSpaces(myScriptPath)) {
    return null;
  }
  final String name=new File(myScriptPath).getName();
  final String dotAndExtension="String_Node_Str" + TheRFileType.INSTANCE.getDefaultExtension();
  if (name.length() > dotAndExtension.length() && StringUtil.endsWithIgnoreCase(name,dotAndExtension)) {
    return name.substring(0,name.length() - dotAndExtension.length());
  }
  return name;
}
Program: 42915
Project: 42915
Buggy source:
private void readEnvs(@NotNull final Element element){
  setPassParentEnvs(Boolean.parseBoolean(JDOMExternalizerUtil.readField(element,PARENT_ENVS,"String_Node_Str")));
  EnvironmentVariablesComponent.readExternal(element,getEnvs());
}

Fixed version (ground truth):
private void readEnvs(@NotNull final Element element){
  setPassParentEnvs(Boolean.parseBoolean(JDOMExternalizerUtil.readField(element,PASS_PARENT_ENVS,"String_Node_Str")));
  EnvironmentVariablesComponent.readExternal(element,getEnvs());
}
Program: 42916
Project: 42916
Buggy source:
@NotNull private String calculateWorkDirectory(@NotNull final TheRRunConfigurationParams runConfigurationParams){
  final String specifiedValue=runConfigurationParams.getWorkingDirectory();
  final String defaultValue=new File(runConfigurationParams.getScriptPath()).getParent();
  return !StringUtil.isEmptyOrSpaces(specifiedValue) ? specifiedValue : defaultValue;
}

Fixed version (ground truth):
@NotNull private String calculateWorkDirectory(@NotNull final TheRRunConfigurationParams runConfigurationParams){
  final String workingDirectory=runConfigurationParams.getWorkingDirectory();
  final String defaultValue=new File(runConfigurationParams.getScriptPath()).getParent();
  return !StringUtil.isEmptyOrSpaces(workingDirectory) ? workingDirectory : defaultValue;
}
Program: 42917
Project: 42917
Buggy source:
private void addEntry(@NotNull final TheRLocation nextLocation){
  final String nextFunctionName=nextLocation.getFunctionName();
  final TheRXFunctionDescriptor descriptor=myEntries.isEmpty() ? myRoot : resolveDescriptor(myEntries.listIterator(myEntries.size()),nextFunctionName);
  final boolean isUnbraceFunction=descriptor != null && nextLocation.getLine() == 0;
  final int line=isUnbraceFunction ? descriptor.getStartLine() : nextLocation.getLine() - 1;
  myEntries.add(new TheRXResolvingSessionEntry(descriptor,line));
}

Fixed version (ground truth):
private void addEntry(@NotNull final TheRLocation nextLocation){
  final String nextFunctionName=nextLocation.getFunctionName();
  final TheRXFunctionDescriptor descriptor=myEntries.isEmpty() ? myRoot : resolveDescriptor(myEntries.listIterator(myEntries.size()),nextFunctionName);
  myEntries.add(new TheRXResolvingSessionEntry(descriptor,resolveLine(descriptor,nextLocation.getLine())));
}
Program: 42918
Project: 42918
Buggy source:
private void updateCurrentEntry(final int line){
  final int lastIndex=myEntries.size() - 1;
  myEntries.set(lastIndex,new TheRXResolvingSessionEntry(myEntries.get(lastIndex).myDescriptor,line - 1));
}

Fixed version (ground truth):
private void updateCurrentEntry(final int line){
  final int lastIndex=myEntries.size() - 1;
  final TheRXFunctionDescriptor descriptor=myEntries.get(lastIndex).myDescriptor;
  myEntries.set(lastIndex,new TheRXResolvingSessionEntry(descriptor,resolveLine(descriptor,line)));
}
Program: 42919
Project: 42919
Buggy source:
protected TheRConfigurationFactory(ConfigurationType configurationType){
  super(configurationType);
}

Fixed version (ground truth):
public TheRConfigurationFactory(@NotNull final ConfigurationType configurationType){
  super(configurationType);
}
Program: 42920
Project: 42920
Buggy source:
@Override public RunConfiguration createTemplateConfiguration(Project project){
  return new TheRRunConfiguration(project,this);
}

Fixed version (ground truth):
@Override public RunConfiguration createTemplateConfiguration(@NotNull final Project project){
  return new TheRRunConfiguration(project,this);
}
Program: 42921
Project: 42921
Buggy source:
public static TheRConfigurationType getInstance(){
  return ConfigurationTypeUtil.findConfigurationType(TheRConfigurationType.class);
}

Fixed version (ground truth):
@NotNull public static TheRConfigurationType getInstance(){
  return ConfigurationTypeUtil.findConfigurationType(TheRConfigurationType.class);
}
Program: 42922
Project: 42922
Buggy source:
@Nullable private XSourcePosition resolvePosition(@NotNull final TheRXResolvingSessionEntry entry){
  if (entry.myDescriptor == null) {
    return null;
  }
  return XDebuggerUtil.getInstance().createPosition(myVirtualFile,entry.myLine - 1);
}

Fixed version (ground truth):
@Nullable private XSourcePosition resolvePosition(@NotNull final TheRXResolvingSessionEntry entry){
  if (entry.myDescriptor == null) {
    return null;
  }
  return XDebuggerUtil.getInstance().createPosition(myVirtualFile,entry.myLine);
}
Program: 42923
Project: 42923
Buggy source:
private void addEntry(@NotNull final TheRLocation nextLocation){
  final TheRXFunctionDescriptor descriptor=myEntries.isEmpty() ? myRoot : resolveDescriptor(myEntries.listIterator(myEntries.size()),nextLocation.getFunctionName());
  myEntries.add(new TheRXResolvingSessionEntry(descriptor,nextLocation.getLine()));
}

Fixed version (ground truth):
private void addEntry(@NotNull final TheRLocation nextLocation){
  final String nextFunctionName=nextLocation.getFunctionName();
  final TheRXFunctionDescriptor descriptor=myEntries.isEmpty() ? myRoot : resolveDescriptor(myEntries.listIterator(myEntries.size()),nextFunctionName);
  final boolean isUnbraceFunction=descriptor != null && nextLocation.getLine() == 0;
  final int line=isUnbraceFunction ? descriptor.getStartLine() : nextLocation.getLine() - 1;
  myEntries.add(new TheRXResolvingSessionEntry(descriptor,line));
}
Program: 42924
Project: 42924
Buggy source:
private void updateCurrentEntry(final int line){
  final int lastIndex=myEntries.size() - 1;
  myEntries.set(lastIndex,new TheRXResolvingSessionEntry(myEntries.get(lastIndex).myDescriptor,line));
}

Fixed version (ground truth):
private void updateCurrentEntry(final int line){
  final int lastIndex=myEntries.size() - 1;
  myEntries.set(lastIndex,new TheRXResolvingSessionEntry(myEntries.get(lastIndex).myDescriptor,line - 1));
}
Program: 42925
Project: 42925
Buggy source:
@Test public void function(){
  final String expression="String_Node_Str";
  final String error="String_Node_Str";
  final String result="String_Node_Str";
  final AlwaysSameResultTheRExecutor executor=new AlwaysSameResultTheRExecutor(TheRDebugConstants.DEBUGGING_IN + "String_Node_Str" + expression,DEBUGGING_IN,TextRange.EMPTY_RANGE,error);
  final MyFunctionDebugger debugger=new MyFunctionDebugger();
  final MockTheRFunctionDebuggerFactory factory=new MockTheRFunctionDebuggerFactory(debugger);
  final MockTheROutputReceiver outputReceiver=new MockTheROutputReceiver();
  final MockTheRExpressionHandler handler=new MockTheRExpressionHandler();
  final TheRDebuggerEvaluatorImpl evaluator=new TheRDebuggerEvaluatorImpl(executor,factory,outputReceiver,handler,1);
  final TheRDebuggerEvaluatorReceiver receiver=new TheRDebuggerEvaluatorReceiver(result);
  evaluator.evalExpression(expression,receiver);
  assertEquals(1,executor.getCounter());
  assertEquals(2,debugger.getCounter());
  assertEquals(1,factory.getCounter());
  assertEquals(1,receiver.getCounter());
  assertEquals(Collections.singletonList(error),outputReceiver.getErrors());
  assertEquals(Collections.emptyList(),outputReceiver.getOutputs());
  assertEquals(1,handler.myCounter);
  assertEquals(expression,handler.myLastExpression);
}

Fixed version (ground truth):
@Test public void function(){
  final String expression="String_Node_Str";
  final String error="String_Node_Str";
  final String result="String_Node_Str";
  final AlwaysSameResultTheRExecutor executor=new AlwaysSameResultTheRExecutor(TheRDebugConstants.DEBUGGING_IN + "String_Node_Str" + expression+ "String_Node_Str"+ DEBUG+ "String_Node_Str"+ "String_Node_Str"+ SERVICE_FUNCTION_PREFIX+ "String_Node_Str"+ SERVICE_ENTER_FUNCTION_SUFFIX+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",DEBUGGING_IN,TextRange.EMPTY_RANGE,error);
  final MyFunctionDebugger debugger=new MyFunctionDebugger();
  final MockTheRFunctionDebuggerFactory factory=new MockTheRFunctionDebuggerFactory(debugger);
  final MockTheROutputReceiver outputReceiver=new MockTheROutputReceiver();
  final MockTheRExpressionHandler handler=new MockTheRExpressionHandler();
  final TheRDebuggerEvaluatorImpl evaluator=new TheRDebuggerEvaluatorImpl(executor,factory,outputReceiver,handler,1);
  final TheRDebuggerEvaluatorReceiver receiver=new TheRDebuggerEvaluatorReceiver(result);
  evaluator.evalExpression(expression,receiver);
  assertEquals(1,executor.getCounter());
  assertEquals(2,debugger.getCounter());
  assertEquals(1,factory.getCounter());
  assertEquals(1,receiver.getCounter());
  assertEquals(Collections.singletonList(error),outputReceiver.getErrors());
  assertEquals(Collections.emptyList(),outputReceiver.getOutputs());
  assertEquals(1,handler.myCounter);
  assertEquals(expression,handler.myLastExpression);
}