nus-yam/ex-repair huggingface dataset:
Program: 45097
Project: 45097
Buggy source:
@Test public void eventOrderingTest(){
  EventParser[] parsers=new EventParser[3];
  InputStream trace1=new FakeTraceStream(0);
  InputStream trace2=new FakeTraceStream(60);
  InputStream trace3=new FakeTraceStream(30);
  EventScheduler scheduler=new EventScheduler();
  Machine machine1=new Machine(scheduler,"String_Node_Str");
  Machine machine2=new Machine(scheduler,"String_Node_Str");
  Machine machine3=new Machine(scheduler,"String_Node_Str");
  DDGClient client1=new DDGClient(scheduler,1,machine1,null);
  DDGClient client2=new DDGClient(scheduler,2,machine2,null);
  DDGClient client3=new DDGClient(scheduler,3,machine3,null);
  parsers[0]=new FileSystemEventParser(trace1,client1);
  parsers[1]=new FileSystemEventParser(trace2,client2);
  parsers[2]=new FileSystemEventParser(trace3,client3);
  EventParser multipleSourceParser=new MultipleEventParser(parsers);
  Event currentEvent=multipleSourceParser.getNextEvent();
  Event nextEvent=null;
  while ((nextEvent=multipleSourceParser.getNextEvent()) != null) {
    assertTrue(currentEvent.getTheScheduledTime().isEarlierThan(nextEvent.getTheScheduledTime()));
    currentEvent=nextEvent;
  }
}

Fixed version (ground truth):
@Test public void eventOrderingTest(){
  EventParser[] parsers=new EventParser[3];
  InputStream trace1=new FakeTraceStream(0);
  InputStream trace2=new FakeTraceStream(60);
  InputStream trace3=new FakeTraceStream(30);
  EventScheduler scheduler=new EventScheduler();
  Machine machine1=new Machine(scheduler,"String_Node_Str");
  Machine machine2=new Machine(scheduler,"String_Node_Str");
  Machine machine3=new Machine(scheduler,"String_Node_Str");
  DDGClient client1=new DDGClient(scheduler,1,machine1,null);
  DDGClient client2=new DDGClient(scheduler,2,machine2,null);
  DDGClient client3=new DDGClient(scheduler,3,machine3,null);
  parsers[0]=new FileSystemEventParser(trace1,client1);
  parsers[1]=new FileSystemEventParser(trace2,client2);
  parsers[2]=new FileSystemEventParser(trace3,client3);
  EventParser multipleSourceParser=new MultipleEventParser(parsers);
  Event currentEvent=multipleSourceParser.getNextEvent();
  Event nextEvent=null;
  while ((nextEvent=multipleSourceParser.getNextEvent()) != null) {
    assertTrue(currentEvent.getTheScheduledTime().compareTo(nextEvent.getTheScheduledTime()) <= 0);
    currentEvent=nextEvent;
  }
}
Program: 45098
Project: 45098
Buggy source:
/** 
 * @param swapMachineProb
 * @param mSecondsBetweenLogins
 * @param firstClient
 * @param clients
 */
public HomeLessLoginAlgorithm(double swapMachineProb,long mSecondsBetweenLogins,DDGClient firstClient,List<DDGClient> clients){
  super(mSecondsBetweenLogins);
  if (swapMachineProb < 0 || swapMachineProb > 1) {
    throw new IllegalArgumentException();
  }
  this.clients=clients;
  this.swapMachineProb=swapMachineProb;
  this.random=new Random();
  this.lastSampledClient=firstClient;
}

Fixed version (ground truth):
/** 
 * @param swapMachineProb
 * @param mSecondsBetweenLogins
 * @param firstClient
 * @param clients
 */
public HomeLessLoginAlgorithm(double swapMachineProb,long mSecondsBetweenLogins,DDGClient firstClient,List<DDGClient> clients){
  super(mSecondsBetweenLogins,firstClient);
  if (swapMachineProb < 0 || swapMachineProb > 1) {
    throw new IllegalArgumentException();
  }
  this.clients=clients;
  this.swapMachineProb=swapMachineProb;
  this.random=new Random();
  this.lastSampledClient=firstClient;
}
Program: 45099
Project: 45099
Buggy source:
public LoginAlgorithm(long mSecondsBetweenLogins){
  this.mSecondsBetweenLogins=mSecondsBetweenLogins;
}

Fixed version (ground truth):
public LoginAlgorithm(long mSecondsBetweenLogins,DDGClient firstClient){
  this.mSecondsBetweenLogins=mSecondsBetweenLogins;
  this.lastSampledClient=firstClient;
}
Program: 45100
Project: 45100
Buggy source:
/** 
 * @param swapMachineProb
 * @param mSecondsBetweenLogins
 * @param sweetHomeClient
 * @param othersClients
 */
public SweetHomeLoginAlgorithm(double swapMachineProb,long mSecondsBetweenLogins,DDGClient sweetHomeClient,List<DDGClient> othersClients){
  super(mSecondsBetweenLogins);
  if (swapMachineProb < 0 || swapMachineProb >= 1) {
    throw new IllegalArgumentException();
  }
  if (othersClients.contains(sweetHomeClient)) {
    throw new IllegalArgumentException();
  }
  this.migrationProb=swapMachineProb;
  this.sweetHomeClient=sweetHomeClient;
  this.othersClients=othersClients;
  this.random=new Random();
}

Fixed version (ground truth):
/** 
 * @param swapMachineProb
 * @param mSecondsBetweenLogins
 * @param sweetHomeClient
 * @param othersClients
 */
public SweetHomeLoginAlgorithm(double swapMachineProb,long mSecondsBetweenLogins,DDGClient sweetHomeClient,List<DDGClient> othersClients){
  super(mSecondsBetweenLogins,sweetHomeClient);
  if (swapMachineProb < 0 || swapMachineProb >= 1) {
    throw new IllegalArgumentException();
  }
  if (othersClients.contains(sweetHomeClient)) {
    throw new IllegalArgumentException();
  }
  this.migrationProb=swapMachineProb;
  this.sweetHomeClient=sweetHomeClient;
  this.othersClients=othersClients;
  this.random=new Random();
}
Program: 45101
Project: 45101
Buggy source:
public static EList getMetadataTableFromConnection(final Connection conn){
  if (conn == null) {
    return null;
  }
  if (conn instanceof SAPConnection) {
    final SAPConnection sapConnection=(SAPConnection)conn;
    final EList functions=sapConnection.getFuntions();
    if (functions != null && !functions.isEmpty()) {
      final EList tables=new BasicEList();
      for (int i=0; i < functions.size(); i++) {
        tables.addAll(((SAPFunctionUnit)functions.get(i)).getTables());
      }
      return tables;
    }
  }
 else {
    EList tables=new BasicEList();
    tables.addAll(ConnectionHelper.getTables(conn));
    return tables;
  }
  return null;
}

Fixed version (ground truth):
public static EList getMetadataTableFromConnection(final Connection conn){
  if (conn == null) {
    return null;
  }
  if (conn instanceof SAPConnection) {
    final SAPConnection sapConnection=(SAPConnection)conn;
    final EList functions=sapConnection.getFuntions();
    if (functions != null && !functions.isEmpty()) {
      final EList tables=new BasicEList();
      for (int i=0; i < functions.size(); i++) {
        tables.add(((SAPFunctionUnit)functions.get(i)).getMetadataTable());
      }
      return tables;
    }
  }
 else {
    EList tables=new BasicEList();
    tables.addAll(ConnectionHelper.getTables(conn));
    return tables;
  }
  return null;
}
Program: 45103
Project: 45103
Buggy source:
/** 
 * Updates the accountActive flag on the hidden accounts.  (These are postmaster and abuse.
 * @param ldap the ldap block we're using
 * @param domainName the domain name to update
 * @param active activate or deactive accounts
 * @exception NamingException if an ldap error occurs
 * @exception MailManagerException if a mail manager error occurs
 */
private void hiddenAccountUpdate(LdapFacade ldap,String domainName,boolean active) throws NamingException, MailManagerException {
  AliasInfo ai=getAlias("String_Node_Str" + domainName);
  if (ai != null) {
    ai.setActive(active);
    modifyAlias(ai);
  }
  String pmMail="String_Node_Str" + domainName;
  ldap.searchOneLevel(domainDn(domainName),"String_Node_Str" + pmMail);
  if (ldap.nextResult()) {
    ldap.modifyElementAttribute(ldap.getResultName(),"String_Node_Str",booleanToString(active));
  }
}

Fixed version (ground truth):
/** 
 * Updates the accountActive flag on the hidden accounts.  (These are postmaster and abuse.
 * @param ldap the ldap block we're using
 * @param domainName the domain name to update
 * @param active activate or deactive accounts
 * @exception NamingException if an ldap error occurs
 * @exception MailManagerException if a mail manager error occurs
 */
private void hiddenAccountUpdate(LdapFacade ldap,String domainName,boolean active) throws NamingException, MailManagerException {
  AliasInfo ai=getAlias("String_Node_Str" + domainName);
  if (ai != null) {
    ai.setActive(active);
    modifyAlias(ai);
  }
  ai=null;
  ai=getAlias("String_Node_Str" + domainName);
  if (ai != null) {
    ai.setActive(active);
    modifyAlias(ai);
  }
  String pmMail="String_Node_Str" + domainName;
  ldap.searchOneLevel(domainDn(domainName),"String_Node_Str" + pmMail);
  if (ldap.nextResult()) {
    ldap.modifyElementAttribute(ldap.getResultName(),"String_Node_Str",booleanToString(active));
  }
}
Program: 45105
Project: 45105
Buggy source:
/** 
 * actually does the nuking
 */
private void nukeAccounts(){
  boolean nondestruct=JammCleanerOptions.isNonDestructive();
  Iterator a=mDeadAccounts.iterator();
  while (a.hasNext()) {
    AccountInfo account=(AccountInfo)a.next();
    if (nondestruct) {
      System.out.println(account.getName() + "String_Node_Str");
    }
 else {
      File file=new File(account.getFullPathToMailbox());
      boolean successful=FileUtils.recursiveDelete(file);
      if (successful) {
        boolean ldapsuccess=false;
        try {
          mManager.deleteAccount(account.getName());
          ldapsuccess=true;
        }
 catch (        MailManagerException e) {
          System.out.println("String_Node_Str" + account.getName() + "String_Node_Str"+ e.toString());
        }
        if (ldapsuccess && JammCleanerOptions.isVerbose()) {
          System.out.println(account.getName() + "String_Node_Str");
        }
      }
 else {
        System.out.println("String_Node_Str" + account.getName() + "String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * actually does the nuking
 */
private void nukeAccounts(){
  boolean nondestruct=JammCleanerOptions.isNonDestructive();
  Iterator a=mDeadAccounts.iterator();
  while (a.hasNext()) {
    AccountInfo account=(AccountInfo)a.next();
    if (nondestruct) {
      System.out.println(account.getName() + "String_Node_Str");
    }
 else {
      File file=new File(account.getFullPathToMailbox());
      boolean successful=false;
      if (file.exists()) {
        successful=FileUtils.recursiveDelete(file);
      }
 else {
        System.out.println("String_Node_Str" + account.getName() + "String_Node_Str");
        successful=true;
      }
      if (successful) {
        boolean ldapsuccess=false;
        try {
          mManager.deleteAccount(account.getName());
          ldapsuccess=true;
        }
 catch (        MailManagerException e) {
          System.out.println("String_Node_Str" + account.getName() + "String_Node_Str"+ e.toString());
        }
        if (ldapsuccess && JammCleanerOptions.isVerbose()) {
          System.out.println(account.getName() + "String_Node_Str");
        }
      }
 else {
        System.out.println("String_Node_Str" + account.getName() + "String_Node_Str");
      }
    }
  }
}
Program: 45108
Project: 45108
Buggy source:
@Override protected void onSubmit(AjaxRequestTarget target,Form<?> form){
  Building building=buildings.get(type);
  if (building != null) {
    Integer newLevel=building.getLevel() + 1;
    building.setLevel(newLevel);
    buildingsDao.beginTransaction();
    buildingsDao.update(building);
    mapUserDao.update(baseutils.reduceRessources(mapUser,500));
    buildingsDao.commitTransaction();
    updateBildingCounter(building,this);
    info("String_Node_Str");
  }
 else {
    building=new Building();
    building.setLevel(1);
    building.setType(type);
    building.setUpgrading(false);
    building.setSquare(square);
    square.getBuildings().add(building);
    mapUser.getSquares().add(square);
    baseutils.reduceRessources(mapUser,1500);
    buildingsDao.beginTransaction();
    buildingsDao.insert(building);
    mapUserDao.update(mapUser);
    buildingsDao.commitTransaction();
    updateBildingCounter(building,this);
    buildings.put(type,building);
    info("String_Node_Str");
  }
  target.add(buildWood);
  target.add(buildClay);
  target.add(buildStable);
  target.add(buildBarracks);
  target.add(buildUpgrades);
  target.add(buildDestruction);
  target.add(buildGrain);
  target.add(buildIron);
  checkVisiblityOfLinks();
  add(barracksLink);
  add(stableLink);
  add(destructionLink);
  add(upgradeLink);
  add(troopsLink);
  add(feedbackPanel);
}

Fixed version (ground truth):
@Override protected void onSubmit(AjaxRequestTarget target,Form<?> form){
  Building building=buildings.get(type);
  if (building != null) {
    Integer newLevel=building.getLevel() + 1;
    building.setLevel(newLevel);
    buildingsDao.beginTransaction();
    buildingsDao.update(building);
    mapUserDao.update(baseutils.reduceRessources(mapUser,500));
    buildingsDao.commitTransaction();
    updateBildingCounter(building,this);
    info("String_Node_Str");
  }
 else {
    building=new Building();
    building.setLevel(1);
    building.setType(type);
    building.setUpgrading(false);
    building.setSquare(square);
    square.getBuildings().add(building);
    buildingsDao.beginTransaction();
    buildingsDao.insert(building);
    squareDao.update(square);
    mapUserDao.update(baseutils.reduceRessources(mapUser,1500));
    buildingsDao.commitTransaction();
    updateBildingCounter(building,this);
    buildings.put(type,building);
    info("String_Node_Str");
  }
  target.add(buildWood);
  target.add(buildClay);
  target.add(buildStable);
  target.add(buildBarracks);
  target.add(buildUpgrades);
  target.add(buildDestruction);
  target.add(buildGrain);
  target.add(buildIron);
  checkVisiblityOfLinks();
  target.add(barracksLink);
  target.add(stableLink);
  target.add(destructionLink);
  target.add(upgradeLink);
  target.add(troopsLink);
}
Program: 45109
Project: 45109
Buggy source:
public MapUser reduceRessources(MapUser mapuser,Integer res){
  StoredRessource clay=mapuser.getClayRessource();
  clay.setAmount(clay.getAmount() - res);
  StoredRessource wood=mapuser.getWoodRessource();
  wood.setAmount(wood.getAmount() - res);
  StoredRessource iron=mapuser.getIronRessource();
  iron.setAmount(iron.getAmount() - res);
  StoredRessource grain=mapuser.getGrainRessource();
  grain.setAmount(grain.getAmount() - res);
  mapuser.setClayRessource(clay);
  mapuser.setGrainRessource(grain);
  mapuser.setIronRessource(iron);
  mapuser.setWoodRessource(wood);
  sRDao.beginTransaction();
  sRDao.update(clay);
  sRDao.update(grain);
  sRDao.update(iron);
  sRDao.update(wood);
  sRDao.commitTransaction();
  return mapuser;
}

Fixed version (ground truth):
public MapUser reduceRessources(MapUser mapuser,Integer res){
  StoredRessource clay=mapuser.getClayRessource();
  clay.setAmount(clay.getAmount() - res);
  StoredRessource wood=mapuser.getWoodRessource();
  wood.setAmount(wood.getAmount() - res);
  StoredRessource iron=mapuser.getIronRessource();
  iron.setAmount(iron.getAmount() - res);
  StoredRessource grain=mapuser.getGrainRessource();
  grain.setAmount(grain.getAmount() - res);
  mapuser.setClayRessource(clay);
  mapuser.setGrainRessource(grain);
  mapuser.setIronRessource(iron);
  mapuser.setWoodRessource(wood);
  sRDao.update(clay);
  sRDao.update(grain);
  sRDao.update(iron);
  sRDao.update(wood);
  return mapuser;
}
Program: 45110
Project: 45110
Buggy source:
public boolean checkRessources(MapUser mapuser,Integer res){
  if (mapuser.getClayRessource().getAmount() < res) {
    return false;
  }
  if (mapuser.getGrainRessource().getAmount() < res) {
    return false;
  }
  if (mapuser.getIronRessource().getAmount() < res) {
    return false;
  }
  if (mapuser.getWoodRessource().getAmount() < res) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean checkRessources(MapUser mapuser,Integer res){
  if (mapuser.getClayRessource() == null || mapuser.getClayRessource().getAmount() < res) {
    return false;
  }
  if (mapuser.getGrainRessource() == null || mapuser.getGrainRessource().getAmount() < res) {
    return false;
  }
  if (mapuser.getIronRessource() == null || mapuser.getIronRessource().getAmount() < res) {
    return false;
  }
  if (mapuser.getWoodRessource() == null || mapuser.getWoodRessource().getAmount() < res) {
    return false;
  }
  return true;
}
Program: 45111
Project: 45111
Buggy source:
public InPage(PageParameters parameters){
  SwagWebSession session=(SwagWebSession)getSession();
  add(new InTopNavigation("String_Node_Str"));
  add(new InNavigation("String_Node_Str"));
  add(new OutSideNavigation("String_Node_Str"));
  AdminNavigation adminNav=new AdminNavigation("String_Node_Str");
  adminNav.setVisible(false);
  if (session.getRoles().hasRole(Roles.ADMIN)) {
    adminNav.setVisible(true);
  }
  add(adminNav);
}

Fixed version (ground truth):
public InPage(PageParameters parameters){
  SwagWebSession session=(SwagWebSession)getSession();
  add(new InTopNavigation("String_Node_Str"));
  add(new InNavigation("String_Node_Str"));
  add(new ResourcenSidePanel("String_Node_Str"));
  AdminNavigation adminNav=new AdminNavigation("String_Node_Str");
  adminNav.setVisible(false);
  if (session.getRoles().hasRole(Roles.ADMIN)) {
    adminNav.setVisible(true);
  }
  add(adminNav);
}
Program: 45112
Project: 45112
Buggy source:
public BasePanel(String id,long squareId){
  super(id);
  square=squareDAO.findById(squareId);
  fetchBuildings();
  FeedbackPanel feedbackPanel=new FeedbackPanel("String_Node_Str");
  add(feedbackPanel);
  setupForm();
  PageParameters params=new PageParameters();
  params.add("String_Node_Str",squareId);
  BookmarkablePageLink barracksLink=new BookmarkablePageLink("String_Node_Str",Barracks.class,params);
  if (!buildings.containsKey(BuildingType.BARRACKS)) {
    barracksLink.setVisible(false);
  }
  add(barracksLink);
  BookmarkablePageLink stableLink=new BookmarkablePageLink("String_Node_Str",Stable.class,params);
  if (!buildings.containsKey(BuildingType.STABLE)) {
    stableLink.setVisible(false);
  }
  add(stableLink);
  BookmarkablePageLink destructionLink=new BookmarkablePageLink("String_Node_Str",Destruction.class,params);
  if (!buildings.containsKey(BuildingType.DESTRUCTION)) {
    destructionLink.setVisible(false);
  }
  add(destructionLink);
  BookmarkablePageLink upgradeLink=new BookmarkablePageLink("String_Node_Str",Upgrades.class,params);
  if (!buildings.containsKey(BuildingType.UPGRADE)) {
    upgradeLink.setVisible(false);
  }
  add(upgradeLink);
  add(new BookmarkablePageLink("String_Node_Str",Troops.class,params));
}

Fixed version (ground truth):
public BasePanel(String id,long squareId){
  super(id);
  this.squareId=squareId;
  square=squareDAO.findById(squareId);
  fetchBuildings();
  FeedbackPanel feedbackPanel=new FeedbackPanel("String_Node_Str");
  add(feedbackPanel);
  setupForm();
  PageParameters params=new PageParameters();
  params.add("String_Node_Str",squareId);
  BookmarkablePageLink barracksLink=new BookmarkablePageLink("String_Node_Str",Barracks.class,params);
  if (!buildings.containsKey(BuildingType.BARRACKS)) {
    barracksLink.setVisible(false);
  }
  add(barracksLink);
  BookmarkablePageLink stableLink=new BookmarkablePageLink("String_Node_Str",Stable.class,params);
  if (!buildings.containsKey(BuildingType.STABLE)) {
    stableLink.setVisible(false);
  }
  add(stableLink);
  BookmarkablePageLink destructionLink=new BookmarkablePageLink("String_Node_Str",Destruction.class,params);
  if (!buildings.containsKey(BuildingType.DESTRUCTION)) {
    destructionLink.setVisible(false);
  }
  add(destructionLink);
  BookmarkablePageLink upgradeLink=new BookmarkablePageLink("String_Node_Str",Upgrades.class,params);
  if (!buildings.containsKey(BuildingType.UPGRADE)) {
    upgradeLink.setVisible(false);
  }
  add(upgradeLink);
  add(new BookmarkablePageLink("String_Node_Str",Troops.class,params));
}
Program: 45113
Project: 45113
Buggy source:
private Form<?> createForm(String form,final String button,final BuildingType type){
  Form<?> newForm=new Form<Object>(form);
  final Building building=buildings.get(type);
  AjaxButton newButton=new AjaxButton(button){
    @Override protected void onSubmit(    AjaxRequestTarget target,    Form<?> form){
      if (building != null) {
        Integer newLevel=building.getLevel() + 1;
        building.setLevel(newLevel);
        buildingsDao.beginTransaction();
        buildingsDao.update(building);
        buildingsDao.commitTransaction();
        info("String_Node_Str");
      }
 else {
        Building building=new Building();
        building.setLevel(1);
        building.setType(type);
        building.setUpgrading(false);
        building.setSquare(square);
        buildingsDao.beginTransaction();
        buildingsDao.insert(building);
        buildingsDao.commitTransaction();
        info("String_Node_Str");
      }
      target.addComponent(form);
    }
    @Override protected void onError(    AjaxRequestTarget target,    Form<?> form){
    }
  }
;
  if (building != null) {
    if (building.getLevel() > 9) {
      newButton.setModel(new Model<String>("String_Node_Str"));
      newButton.setEnabled(false);
    }
 else {
      Integer newLevel=building.getLevel() + 1;
      newButton.setModel(new Model<String>("String_Node_Str" + newLevel));
    }
    if (building.getUpgrading()) {
      newButton.setEnabled(false);
    }
  }
 else {
    newButton.setModel(new Model<String>("String_Node_Str"));
  }
  newForm.add(newButton);
  return newForm;
}

Fixed version (ground truth):
private Form<?> createForm(String form,final String button,final BuildingType type){
  Form<?> newForm=new Form<Object>(form);
  final Building building=buildings.get(type);
  AjaxButton newButton=new AjaxButton(button){
    @Override protected void onSubmit(    AjaxRequestTarget target,    Form<?> form){
      Building building=buildings.get(type);
      if (building != null) {
        Integer newLevel=building.getLevel() + 1;
        building.setLevel(newLevel);
        buildingsDao.beginTransaction();
        buildingsDao.update(building);
        buildingsDao.commitTransaction();
        updateBildingCounter(building,this);
        info("String_Node_Str");
      }
 else {
        building=new Building();
        building.setLevel(1);
        building.setType(type);
        building.setUpgrading(false);
        building.setSquare(square);
        buildingsDao.beginTransaction();
        buildingsDao.insert(building);
        buildingsDao.commitTransaction();
        updateBildingCounter(building,this);
      }
      target.add(buildWood);
      target.add(buildClay);
      target.add(buildStable);
      target.add(buildBarracks);
      target.add(buildUpgrades);
      target.add(buildDestruction);
      target.add(buildGrain);
      target.add(buildIron);
    }
    @Override protected void onError(    AjaxRequestTarget target,    Form<?> form){
    }
  }
;
  updateBildingCounter(building,newButton);
  newForm.add(newButton);
  return newForm;
}
Program: 45114
Project: 45114
Buggy source:
@Override protected void onSubmit(AjaxRequestTarget target,Form<?> form){
  if (building != null) {
    Integer newLevel=building.getLevel() + 1;
    building.setLevel(newLevel);
    buildingsDao.beginTransaction();
    buildingsDao.update(building);
    buildingsDao.commitTransaction();
    info("String_Node_Str");
  }
 else {
    Building building=new Building();
    building.setLevel(1);
    building.setType(type);
    building.setUpgrading(false);
    building.setSquare(square);
    buildingsDao.beginTransaction();
    buildingsDao.insert(building);
    buildingsDao.commitTransaction();
    info("String_Node_Str");
  }
  target.addComponent(form);
}

Fixed version (ground truth):
@Override protected void onSubmit(AjaxRequestTarget target,Form<?> form){
  Building building=buildings.get(type);
  if (building != null) {
    Integer newLevel=building.getLevel() + 1;
    building.setLevel(newLevel);
    buildingsDao.beginTransaction();
    buildingsDao.update(building);
    buildingsDao.commitTransaction();
    updateBildingCounter(building,this);
    info("String_Node_Str");
  }
 else {
    building=new Building();
    building.setLevel(1);
    building.setType(type);
    building.setUpgrading(false);
    building.setSquare(square);
    buildingsDao.beginTransaction();
    buildingsDao.insert(building);
    buildingsDao.commitTransaction();
    updateBildingCounter(building,this);
  }
  target.add(buildWood);
  target.add(buildClay);
  target.add(buildStable);
  target.add(buildBarracks);
  target.add(buildUpgrades);
  target.add(buildDestruction);
  target.add(buildGrain);
  target.add(buildIron);
}
Program: 45115
Project: 45115
Buggy source:
private void setupForm(){
  Form<?> buildWood=createForm("String_Node_Str","String_Node_Str",BuildingType.WOOD);
  Form<?> buildClay=createForm("String_Node_Str","String_Node_Str",BuildingType.CLAY);
  Form<?> buildStable=createForm("String_Node_Str","String_Node_Str",BuildingType.STABLE);
  Form<?> buildBarracks=createForm("String_Node_Str","String_Node_Str",BuildingType.BARRACKS);
  Form<?> buildUpgrades=createForm("String_Node_Str","String_Node_Str",BuildingType.UPGRADE);
  Form<?> buildDestruction=createForm("String_Node_Str","String_Node_Str",BuildingType.DESTRUCTION);
  Form<?> buildGrain=createForm("String_Node_Str","String_Node_Str",BuildingType.GRAIN);
  Form<?> buildIron=createForm("String_Node_Str","String_Node_Str",BuildingType.IRON);
  add(buildWood);
  add(buildClay);
  add(buildStable);
  add(buildBarracks);
  add(buildUpgrades);
  add(buildDestruction);
  add(buildGrain);
  add(buildIron);
}

Fixed version (ground truth):
private void setupForm(){
  buildWood=createForm("String_Node_Str","String_Node_Str",BuildingType.WOOD);
  buildClay=createForm("String_Node_Str","String_Node_Str",BuildingType.CLAY);
  buildStable=createForm("String_Node_Str","String_Node_Str",BuildingType.STABLE);
  buildBarracks=createForm("String_Node_Str","String_Node_Str",BuildingType.BARRACKS);
  buildUpgrades=createForm("String_Node_Str","String_Node_Str",BuildingType.UPGRADE);
  buildDestruction=createForm("String_Node_Str","String_Node_Str",BuildingType.DESTRUCTION);
  buildGrain=createForm("String_Node_Str","String_Node_Str",BuildingType.GRAIN);
  buildIron=createForm("String_Node_Str","String_Node_Str",BuildingType.IRON);
  add(buildWood);
  add(buildClay);
  add(buildStable);
  add(buildBarracks);
  add(buildUpgrades);
  add(buildDestruction);
  add(buildGrain);
  add(buildIron);
}
Program: 45116
Project: 45116
Buggy source:
public void loadBasePanel(long squareId){
  setContent(new BasePanel(this.getContentId(),squareId){
    @Override public void onCancel(    AjaxRequestTarget target){
    }
    @Override public void onSelect(    AjaxRequestTarget target,    String selection){
    }
  }
);
}

Fixed version (ground truth):
public void loadBasePanel(long squareId){
  setContent(new BasePanel(this.getContentId(),squareId){
    @Override public void onCancel(    AjaxRequestTarget target){
    }
    @Override public void onSelect(    AjaxRequestTarget target,    String selection){
    }
    @Override public void onSubmitButton(    AjaxRequestTarget target,    long squareId){
      setTitle("String_Node_Str");
    }
  }
);
}
Program: 45117
Project: 45117
Buggy source:
public BasePanel(String id,long squareId){
  super(id);
  baseutils=new BaseUtils();
  square=squareDAO.findById(squareId);
  setMapuser();
  fetchBuildings();
  feedbackPanel=new FeedbackPanel("String_Node_Str");
  add(feedbackPanel);
  PageParameters params=new PageParameters();
  params.add("String_Node_Str",squareId);
  setupLinks(params);
  setupForm();
  checkVisiblityOfLinks();
}

Fixed version (ground truth):
public BasePanel(String id,long squareId){
  super(id);
  baseutils=new BaseUtils();
  square=squareDao.findById(squareId);
  setMapuser();
  fetchBuildings();
  feedbackPanel=new FeedbackPanel("String_Node_Str");
  add(feedbackPanel);
  PageParameters params=new PageParameters();
  params.add("String_Node_Str",squareId);
  setupLinks(params);
  setupForm();
  checkVisiblityOfLinks();
}
Program: 45119
Project: 45119
Buggy source:
@Override protected void onSubmit(AjaxRequestTarget target,Form<?> form){
  Building building=buildings.get(type);
  if (building != null) {
    Integer newLevel=building.getLevel() + 1;
    building.setLevel(newLevel);
    buildingsDao.beginTransaction();
    buildingsDao.update(building);
    buildingsDao.commitTransaction();
    updateBildingCounter(building,this);
    info("String_Node_Str");
  }
 else {
    building=new Building();
    building.setLevel(1);
    building.setType(type);
    building.setUpgrading(false);
    building.setSquare(square);
    square.getBuildings().add(building);
    mapUser.getSquares().add(square);
    buildingsDao.beginTransaction();
    buildingsDao.insert(building);
    squareDAO.insert(square);
    mapUserDao.insert(mapUser);
    buildingsDao.commitTransaction();
    updateBildingCounter(building,this);
    buildings.put(type,building);
    info("String_Node_Str");
  }
  target.add(buildWood);
  target.add(buildClay);
  target.add(buildStable);
  target.add(buildBarracks);
  target.add(buildUpgrades);
  target.add(buildDestruction);
  target.add(buildGrain);
  target.add(buildIron);
  checkVisiblityOfLinks();
  add(barracksLink);
  add(stableLink);
  add(destructionLink);
  add(upgradeLink);
  add(troopsLink);
  add(feedbackPanel);
}

Fixed version (ground truth):
@Override protected void onSubmit(AjaxRequestTarget target,Form<?> form){
  Building building=buildings.get(type);
  if (building != null) {
    Integer newLevel=building.getLevel() + 1;
    building.setLevel(newLevel);
    buildingsDao.beginTransaction();
    buildingsDao.update(building);
    buildingsDao.commitTransaction();
    updateBildingCounter(building,this);
    info("String_Node_Str");
  }
 else {
    building=new Building();
    building.setLevel(1);
    building.setType(type);
    building.setUpgrading(false);
    building.setSquare(square);
    square.getBuildings().add(building);
    mapUser.getSquares().add(square);
    buildingsDao.beginTransaction();
    buildingsDao.insert(building);
    squareDao.insert(square);
    mapUserDao.insert(mapUser);
    buildingsDao.commitTransaction();
    updateBildingCounter(building,this);
    buildings.put(type,building);
    info("String_Node_Str");
  }
  target.add(buildWood);
  target.add(buildClay);
  target.add(buildStable);
  target.add(buildBarracks);
  target.add(buildUpgrades);
  target.add(buildDestruction);
  target.add(buildGrain);
  target.add(buildIron);
  checkVisiblityOfLinks();
  add(barracksLink);
  add(stableLink);
  add(destructionLink);
  add(upgradeLink);
  add(troopsLink);
  add(feedbackPanel);
}
Program: 45120
Project: 45120
Buggy source:
private void setMapuser(){
  String query="String_Node_Str";
  SwagWebSession session=(SwagWebSession)getSession();
  Map<String,String> values=new HashMap<String,String>();
  values.put("String_Node_Str",session.getUsername());
  values.put("String_Node_Str",session.getMapname());
  List<MapUser> buffer=mapUserDAO.findByQuery(query,values);
  if (!buffer.isEmpty()) {
    mapUser=buffer.get(0);
  }
 else {
    setResponsePage(MapPage.class);
  }
  if (!mapUser.getSquares().contains(square)) {
    setResponsePage(MapPage.class);
  }
}

Fixed version (ground truth):
private void setMapuser(){
  String query="String_Node_Str";
  SwagWebSession session=(SwagWebSession)getSession();
  Map<String,String> values=new HashMap<String,String>();
  values.put("String_Node_Str",session.getUsername());
  values.put("String_Node_Str",session.getMapname());
  List<MapUser> buffer=mapUserDao.findByQuery(query,values);
  if (!buffer.isEmpty()) {
    mapUser=buffer.get(0);
  }
 else {
    setResponsePage(MapPage.class);
  }
  if (!mapUser.getSquares().contains(square)) {
    setResponsePage(MapPage.class);
  }
}
Program: 45121
Project: 45121
Buggy source:
public void loadBasePanel(long squareId){
  setContent(new BasePanel(this.getContentId(),squareId){
    private static final long serialVersionUID=-1675999722693245461L;
    void onCancel(    AjaxRequestTarget target){
      setTitle("String_Node_Str");
      MapModalWindow.this.onCancel(target);
    }
    void onSelect(    AjaxRequestTarget target,    String selection){
      setTitle("String_Node_Str");
      MapModalWindow.this.onSelect(target,selection);
    }
  }
);
}

Fixed version (ground truth):
public void loadBasePanel(long squareId){
  setContent(new BasePanel(this.getContentId(),squareId){
    @Override public void onCancel(    AjaxRequestTarget target){
    }
    @Override public void onSelect(    AjaxRequestTarget target,    String selection){
    }
  }
);
}
Program: 45122
Project: 45122
Buggy source:
/** 
 * TODO optimizing 
 * @param squares
 * @return
 */
private Square findFreeSquareForHomeBase(List<Square> squares){
  for (  Square sq : squares) {
    if (!sq.getIsHomeBase()) {
      if (sq.getBaseBuildings() == null || sq.getBaseBuildings().isEmpty()) {
        if (sq.getResourceBuildings() == null || sq.getBaseBuildings().isEmpty()) {
          return sq;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * TODO optimizing
 * @param squares
 * @return
 */
private Square findFreeSquareForHomeBase(List<Square> squares){
  for (  Square sq : squares) {
    if (!sq.getIsHomeBase() && sq.getBaseBuildings().isEmpty() && sq.getResourceBuildings().isEmpty()) {
      return sq;
    }
  }
  return null;
}
Program: 45123
Project: 45123
Buggy source:
@Override protected void onSubmit(){
  try {
    mapname=(String)allmaps.getDefaultModel().getObject();
    Map playground=mapDao.findByName(mapname);
    String username=((SwagWebSession)getSession()).getUsername();
    User user=userDao.findByUsername(username);
    List<MapUser> mapUsers=playground.getUsers();
    mapUsers=new ArrayList<MapUser>();
    Square startsquare=findFreeSquareForHomeBase(playground.getSquares());
    if (startsquare != null) {
      List<Square> usersquares=new ArrayList<Square>();
      startsquare.setIsHomeBase(true);
      usersquares.add(startsquare);
      MapUser mapUser=new MapUser();
      mapUser.setMap(playground);
      mapUser.setUser(user);
      mapUser.setSquares(usersquares);
      mapUsers.add(mapUser);
      playground.setUsers(mapUsers);
      mapUserDao.beginTransaction();
      mapUserDao.insert(mapUser);
      mapUserDao.commitTransaction();
      mapDao.insert(playground);
      squareDao.insert(startsquare);
      mapUserDao.commitTransaction();
      info("String_Node_Str" + mapname);
    }
 else {
      info("String_Node_Str" + mapname);
    }
  }
 catch (  NoResultException e) {
    info(e.getMessage());
  }
}

Fixed version (ground truth):
@Override protected void onSubmit(){
  mapUserDao.beginTransaction();
  try {
    mapname=(String)allmaps.getDefaultModel().getObject();
    Map playground=mapDao.findByName(mapname);
    String username=((SwagWebSession)getSession()).getUsername();
    User user=userDao.findByUsername(username);
    Square startsquare=findFreeSquareForHomeBase(playground.getSquares());
    if (startsquare != null) {
      List<Square> usersquares=new ArrayList<Square>();
      startsquare.setIsHomeBase(true);
      usersquares.add(startsquare);
      MapUser mapUser=new MapUser();
      mapUser.setMap(playground);
      mapUser.setUser(user);
      mapUser.setSquares(usersquares);
      playground.getUsers().add(mapUser);
      mapUserDao.insert(mapUser);
      mapUserDao.commitTransaction();
      mapDao.insert(playground);
      squareDao.insert(startsquare);
      info("String_Node_Str" + mapname);
    }
 else {
      info("String_Node_Str" + mapname);
    }
  }
 catch (  NoResultException e) {
    info(e.getMessage());
  }
 finally {
    mapUserDao.commitTransaction();
  }
}
Program: 45124
Project: 45124
Buggy source:
@Override public final void onMessage(Message msg){
  try {
    Method handler=getClass().getMethod("String_Node_Str",msg.getClass());
    this.replyTo=msg.getJMSReplyTo();
    Object payload=getPayload(msg);
    handler.invoke(this,payload);
  }
 catch (  SecurityException e) {
    e.printStackTrace();
  }
catch (  NoSuchMethodException e) {
    e.printStackTrace();
  }
catch (  IllegalArgumentException e) {
    e.printStackTrace();
  }
catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
catch (  InvocationTargetException e) {
    e.printStackTrace();
  }
catch (  JMSException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public final void onMessage(Message msg){
  try {
    Object payload=getPayload(msg);
    Method handler=getClass().getMethod("String_Node_Str",payload.getClass());
    this.replyTo=msg.getJMSReplyTo();
    handler.invoke(this,payload);
  }
 catch (  SecurityException e) {
    e.printStackTrace();
  }
catch (  NoSuchMethodException e) {
    e.printStackTrace();
  }
catch (  IllegalArgumentException e) {
    e.printStackTrace();
  }
catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
catch (  InvocationTargetException e) {
    e.printStackTrace();
  }
catch (  JMSException e) {
    e.printStackTrace();
  }
}
Program: 45125
Project: 45125
Buggy source:
public InPage(PageParameters parameters){
  add(new InTopNavigation("String_Node_Str"));
  add(new InNavigation("String_Node_Str"));
  add(new InSideNavigation("String_Node_Str"));
}

Fixed version (ground truth):
public InPage(PageParameters parameters){
  add(new InTopNavigation("String_Node_Str"));
  add(new InNavigation("String_Node_Str"));
  SwagWebSession session=(SwagWebSession)getSession();
  if (session.getRoles().hasRole(Roles.ADMIN)) {
    add(new InSideNavigation("String_Node_Str"));
  }
 else {
    add(new Label("String_Node_Str","String_Node_Str"));
  }
}
Program: 45127
Project: 45127
Buggy source:
protected static <E extends AbstractDTO>String toString(Iterable<E> es){
  if (es == null)   return null;
  String out="String_Node_Str";
  Iterator<E> it=es.iterator();
  if (!it.hasNext())   return "String_Node_Str";
  out+=it.next();
  while (it.hasNext()) {
    out+="String_Node_Str" + it.next();
  }
  return out + "String_Node_Str";
}

Fixed version (ground truth):
protected static <E extends AbstractDTO>String toString(Iterable<E> es){
  if (es == null) {
    return null;
  }
  String out="String_Node_Str";
  Iterator<E> it=es.iterator();
  if (!it.hasNext()) {
    return "String_Node_Str";
  }
  out+=it.next();
  while (it.hasNext()) {
    out+="String_Node_Str" + it.next();
  }
  return out + "String_Node_Str";
}
Program: 45130
Project: 45130
Buggy source:
/** 
 * Setzt die uebergebene Referenz <i>setGui_ref</i> auf die gleichnamige Objektvariable,  initialisiert das <i>DefaultTableModel</i> der Host-Einstellungs-Tabelle und ruft zum Schluss die <i>drawTab()</i>-Methode des Objekts auf, welche das eigentliche Zeichnen  des JPanels ubernimmt.
 * @see #drawTab()
 */
SettingsTabHosts(TinyAdminSettingsGUI setGui_ref){
  this.setGui_ref=setGui_ref;
  hostTableMod_ref=new DefaultTableModel(null,HOST_TABLENAMES);
  drawTab();
}

Fixed version (ground truth):
/** 
 * Setzt die uebergebene Referenz <i>setGui_ref</i> auf die gleichnamige Objektvariable,  initialisiert das <i>DefaultTableModel</i> der Host-Einstellungs-Tabelle und ruft zum Schluss die <i>drawTab()</i>-Methode des Objekts auf, welche das eigentliche Zeichnen  des JPanels ubernimmt.
 * @see #drawTab()
 */
SettingsTabHosts(TinyAdminSettingsGUI setGui_ref){
  this.setGui_ref=setGui_ref;
  hostTableMod_ref=new CustomTableModel(null,HOST_TABLENAMES);
  drawTab();
}
Program: 45131
Project: 45131
Buggy source:
/** 
 * Liefert eine Referenz auf das gehaltene DefaultTableModel <i>hostTableMod_ref</i> zurueck. Dieses beinhaltet die in der Tabelle gehaltenen Einstellungen fuer alle Hosts.
 * @return Referenz auf das DefaultTableModel der Tabelle mit Host-Einstellungen.
 */
DefaultTableModel getHostTabMod(){
  return hostTableMod_ref;
}

Fixed version (ground truth):
/** 
 * Liefert eine Referenz auf das gehaltene CustomTableModel <i>hostTableMod_ref</i> zurueck. Dieses beinhaltet die in der Tabelle gehaltenen Einstellungen fuer alle Hosts.
 * @return Referenz auf das DefaultTableModel der Tabelle mit Host-Einstellungen.
 * @see CustomTableModel
 */
DefaultTableModel getHostTabMod(){
  return hostTableMod_ref;
}
Program: 45133
Project: 45133
Buggy source:
public static void main(String[] args){
  Scanner scanner=new Scanner("String_Node_Str" + "String_Node_Str");
  try {
    scanner.scan();
    System.out.println(scanner.code);
    System.out.println("String_Node_Str");
    for (int i=0; i < scanner.tokens.size(); i++) {
      System.out.println("String_Node_Str" + scanner.tokens.get(i).getType().toString() + "String_Node_Str"+ ((String)scanner.tokens.get(i).getValue())+ "String_Node_Str");
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  Scanner scanner=new Scanner("String_Node_Str" + "String_Node_Str");
  try {
    scanner.scan();
    System.out.println(scanner.code);
    System.out.println("String_Node_Str");
    for (int i=0; i < scanner.tokens.size(); i++) {
      System.out.println("String_Node_Str" + scanner.tokens.get(i).getType().toString() + "String_Node_Str"+ ((String)scanner.tokens.get(i).getValue())+ "String_Node_Str");
    }
  }
 catch (  SyntaxException e) {
    System.out.println(e);
  }
}
Program: 45134
Project: 45134
Buggy source:
private void parseString() throws SyntaxException {
  if (this.code.charAt(this.pointer) != '"') {
    return;
  }
  this.pointer++;
  String str="String_Node_Str";
  int startPos=this.pointer;
  while (((this.code.charAt(this.pointer) != '"')) && (this.pointer < this.code.length())) {
    str+=this.code.charAt(this.pointer);
    this.pointer++;
  }
  if (this.pointer == this.code.length()) {
    throw new SyntaxException(startPos,"String_Node_Str");
  }
  this.tokens.add(new Token(TokenType.String,str));
}

Fixed version (ground truth):
private void parseString() throws SyntaxException {
  if (this.code.charAt(this.pointer) != '"') {
    return;
  }
  this.pointer++;
  String str="String_Node_Str";
  int startPos=this.pointer;
  while ((this.pointer < this.code.length()) && ((this.code.charAt(this.pointer) != '"'))) {
    str+=this.code.charAt(this.pointer);
    this.pointer++;
  }
  if (this.pointer == this.code.length()) {
    throw new SyntaxException(startPos,"String_Node_Str");
  }
  this.tokens.add(new Token(TokenType.String,str));
}
Program: 45135
Project: 45135
Buggy source:
/** 
 * Scans string for tokens Scans for numbers (1.5, 1, 0, 0.5, .5, etc.), strings ("Hello!"),  code literals ({ somecode() }), array/list start and end ([ and ]) removes comments
 * @return ArrayList List of tokens
 * @throws Exception
 */
public void scan() throws Exception {
  char c;
  for (this.pointer=0; this.pointer < this.code.length() - 1; this.pointer++) {
    this.skipSpaces();
    c=this.code.charAt(this.pointer);
    if ((c >= '0') && (c <= '9')) {
      this.parseNumber();
    }
 else     if (c == '"') {
      this.parseString();
    }
 else     if (c == '{') {
      this.parseCode();
    }
 else     if (c == '[') {
      this.tokens.add(new Token(TokenType.OpenSquareBracket));
    }
 else     if (c == ']') {
      this.tokens.add(new Token(TokenType.CloseSquareBracket));
    }
    if ((c == '/') && this.code.charAt(this.pointer + 1) == '*') {
      this.skipComment();
    }
 else {
      this.parseLiteral();
    }
  }
}

Fixed version (ground truth):
/** 
 * Scans string for tokens Scans for numbers (1.5, 1, 0, 0.5, .5, etc.), strings ("Hello!"),  code literals ({ somecode() }), array/list start and end ([ and ]) removes comments
 * @return ArrayList List of tokens
 * @throws SyntaxException
 */
public void scan() throws SyntaxException {
  char c;
  for (this.pointer=0; this.pointer < this.code.length() - 1; this.pointer++) {
    this.skipSpaces();
    c=this.code.charAt(this.pointer);
    if ((c >= '0') && (c <= '9')) {
      this.parseNumber();
    }
 else     if (c == '"') {
      this.parseString();
    }
 else     if (c == '{') {
      this.parseCode();
    }
 else     if (c == '[') {
      this.tokens.add(new Token(TokenType.OpenSquareBracket));
    }
 else     if (c == ']') {
      this.tokens.add(new Token(TokenType.CloseSquareBracket));
    }
    if ((c == '/') && this.code.charAt(this.pointer + 1) == '*') {
      this.skipComment();
    }
 else {
      this.parseLiteral();
    }
  }
}
Program: 45137
Project: 45137
Buggy source:
@Override public void map(PactString word,PactInteger wordOccurences,Collector<PactInteger,PactInteger> out){
  out.collect(ONE,ONE);
}

Fixed version (ground truth):
@Override public void map(PactString word,PactDouble wordOccurences,Collector<PactInteger,PactInteger> out){
  out.collect(ONE,ONE);
}
Program: 45138
Project: 45138
Buggy source:
/** 
 * Changes the behavior of   {@link EnvVars#overrideAll(Map)} whichdrops variables which have value a null or a 0-length value: This implementation doesn't. <p>This is a fix for JENKINS-10045.</p>
 * @see EnvVars#overrideAll(Map)
 */
public static void overrideAll(EnvVars env,Map<String,String> all){
  for (  Map.Entry<String,String> e : all.entrySet()) {
    override(env,e.getKey(),e.getValue());
  }
}

Fixed version (ground truth):
/** 
 * Changes the behavior of   {@link EnvVars#overrideAll(Map)} whichdrops variables which have value a null or a 0-length value: This implementation doesn't. <p>This is a fix for JENKINS-10045.</p>
 * @param env - Environment variables
 * @param all - Map of strings to strings?
 * @see EnvVars#overrideAll(Map)
 */
public static void overrideAll(EnvVars env,Map<String,String> all){
  for (  Map.Entry<String,String> e : all.entrySet()) {
    override(env,e.getKey(),e.getValue());
  }
}
Program: 45139
Project: 45139
Buggy source:
/** 
 * @see #override(hudson.EnvVars,String,String)
 * @see EnvVars#override(String,String)
 */
private static void override(EnvVars env,String key,String value){
  int idx=key.indexOf('+');
  if (idx > 0) {
    String realKey=key.substring(0,idx);
    String v=env.get(realKey);
    if (v == null) {
      v=value;
    }
 else {
      Platform platform=null;
      try {
        platform=(Platform)EnvVars.class.getField("String_Node_Str").get(env);
      }
 catch (      Exception e) {
      }
      char ch=platform == null ? File.pathSeparatorChar : platform.pathSeparator;
      v=value + ch + v;
    }
    env.put(realKey,v);
    return;
  }
  env.put(key,value);
}

Fixed version (ground truth):
/** 
 * @see #override(hudson.EnvVars,String,String)
 * @see EnvVars#override(String,String)
 * @param env - Environment variables
 * @param key - Key
 * @param value - Value
 */
private static void override(EnvVars env,String key,String value){
  int idx=key.indexOf('+');
  if (idx > 0) {
    String realKey=key.substring(0,idx);
    String v=env.get(realKey);
    if (v == null) {
      v=value;
    }
 else {
      Platform platform=null;
      try {
        platform=(Platform)EnvVars.class.getField("String_Node_Str").get(env);
      }
 catch (      Exception e) {
      }
      char ch=platform == null ? File.pathSeparatorChar : platform.pathSeparator;
      v=value + ch + v;
    }
    env.put(realKey,v);
    return;
  }
  env.put(key,value);
}
Program: 45140
Project: 45140
Buggy source:
/** 
 * This populates the Username//Password credential dropdown on the config page.
 * @return  Returns a list of credentials to populate the combobox with.
 */
public static ListBoxModel doFillCredentialsIdItems(@AncestorInPath Job<?,?> owner,@QueryParameter String source){
  if (owner == null || !owner.hasPermission(Item.EXTENDED_READ)) {
    return new ListBoxModel();
  }
  return new StandardUsernameListBoxModel().withEmptySelection().withAll(availableCredentials(owner,new EnvVars().expand(source)));
}

Fixed version (ground truth):
/** 
 * This populates the Username//Password credential dropdown on the config page.
 * @param context - Owner
 * @param remote - Source
 * @return  Returns a list of credentials to populate the combobox with.
 */
public static ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item context,@QueryParameter String remote){
  return doFillCredentialsItems(context,remote,StandardUsernamePasswordCredentials.class);
}