nus-yam/ex-repair huggingface dataset:
Program: 15112
Project: 15112
Buggy source:
private void doCreateGroups(final String names,final String path){
  if (currentSelected == null || currentSelected.size() != 1) {
    return;
  }
  final String accountId=this.currentSelected.toArray(new SearchResultRow[0])[0].getField(0);
  this.clientFactory.getShellView().getFooterView().showStatus(StatusType.LOADING,"String_Node_Str" + names + "String_Node_Str",0);
  this.clientFactory.getBackendService().createGroups(this.clientFactory.getLocalSession().getSession(),accountId,names,path,new AsyncCallback<ArrayList<String>>(){
    @Override public void onFailure(    Throwable caught){
      clientFactory.getShellView().getFooterView().showStatus(StatusType.ERROR,"String_Node_Str",FooterView.DEFAULT_STATUS_CLEAR_DELAY);
      clientFactory.getShellView().getLogView().log(LogType.ERROR,"String_Node_Str" + names + "String_Node_Str"+ accountId+ "String_Node_Str"+ caught.getMessage());
    }
    @Override public void onSuccess(    ArrayList<String> created){
      clientFactory.getShellView().getFooterView().showStatus(StatusType.NONE,created.size() + "String_Node_Str",FooterView.DEFAULT_STATUS_CLEAR_DELAY);
      clientFactory.getShellView().getLogView().log(LogType.INFO,"String_Node_Str" + created + "String_Node_Str"+ accountId);
    }
  }
);
}

Fixed version (ground truth):
private void doCreateGroups(final String names,final String path){
  if (currentSelected == null || currentSelected.size() != 1) {
    return;
  }
  final String accountId=this.currentSelected.toArray(new SearchResultRow[0])[0].getField(0);
  this.clientFactory.getShellView().getFooterView().showStatus(StatusType.LOADING,"String_Node_Str" + names + "String_Node_Str",0);
  this.clientFactory.getBackendService().createGroups(this.clientFactory.getLocalSession().getSession(),accountId,names,path,new AsyncCallback<ArrayList<String>>(){
    @Override public void onFailure(    Throwable caught){
      clientFactory.getShellView().getFooterView().showStatus(StatusType.ERROR,"String_Node_Str",FooterView.DEFAULT_STATUS_CLEAR_DELAY);
      clientFactory.getShellView().getLogView().log(LogType.ERROR,"String_Node_Str" + names + "String_Node_Str"+ accountId+ "String_Node_Str"+ caught.getMessage());
    }
    @Override public void onSuccess(    ArrayList<String> created){
      if (created == null || created.size() < 1) {
        clientFactory.getShellView().getFooterView().showStatus(StatusType.ERROR,"String_Node_Str",FooterView.DEFAULT_STATUS_CLEAR_DELAY);
        clientFactory.getShellView().getLogView().log(LogType.ERROR,"String_Node_Str" + names + "String_Node_Str"+ accountId+ "String_Node_Str");
      }
 else {
        clientFactory.getShellView().getFooterView().showStatus(StatusType.NONE,created.size() + "String_Node_Str",FooterView.DEFAULT_STATUS_CLEAR_DELAY);
        clientFactory.getShellView().getLogView().log(LogType.INFO,"String_Node_Str" + created + "String_Node_Str"+ accountId);
      }
    }
  }
);
}
Program: 15113
Project: 15113
Buggy source:
public static void deleteCertificate(User requestUser,SearchResultRow certSerialized) throws EucalyptusServiceException {
  try {
    int i=0;
    String certId=certSerialized.getField(i++);
    i++;
    i++;
    String accountName=certSerialized.getField(i++);
    String userName=certSerialized.getField(i++);
    Account account=Accounts.lookupAccountByName(accountName);
    User user=account.lookupUserByName(userName);
    EuarePermission.authorizeDeleteUserCertificate(requestUser,account,user);
    user.removeKey(certId);
  }
 catch (  EucalyptusServiceException e) {
    LOG.debug(e,e);
    throw e;
  }
catch (  Exception e) {
    LOG.error("String_Node_Str" + certSerialized,e);
    LOG.debug(e,e);
    throw new EucalyptusServiceException("String_Node_Str" + certSerialized + "String_Node_Str"+ e.getMessage());
  }
}

Fixed version (ground truth):
public static void deleteCertificate(User requestUser,SearchResultRow certSerialized) throws EucalyptusServiceException {
  try {
    int i=0;
    String certId=certSerialized.getField(i++);
    i++;
    i++;
    String accountName=certSerialized.getField(i++);
    String userName=certSerialized.getField(i++);
    Account account=Accounts.lookupAccountByName(accountName);
    User user=account.lookupUserByName(userName);
    EuarePermission.authorizeDeleteUserCertificate(requestUser,account,user);
    user.removeCertificate(certId);
  }
 catch (  EucalyptusServiceException e) {
    LOG.debug(e,e);
    throw e;
  }
catch (  Exception e) {
    LOG.error("String_Node_Str" + certSerialized,e);
    LOG.debug(e,e);
    throw new EucalyptusServiceException("String_Node_Str" + certSerialized + "String_Node_Str"+ e.getMessage());
  }
}
Program: 15114
Project: 15114
Buggy source:
public static void deleteAccessKey(User requestUser,SearchResultRow keySerialized) throws EucalyptusServiceException {
  try {
    int i=0;
    String keyId=keySerialized.getField(i++);
    i++;
    String accountName=keySerialized.getField(i++);
    String userName=keySerialized.getField(i++);
    Account account=Accounts.lookupAccountByName(accountName);
    User user=account.lookupUserByName(userName);
    EuarePermission.authorizeDeleteUserAccessKey(requestUser,account,user);
    user.removeKey(keyId);
  }
 catch (  EucalyptusServiceException e) {
    LOG.debug(e,e);
    throw e;
  }
catch (  Exception e) {
    LOG.error("String_Node_Str" + keySerialized,e);
    LOG.debug(e,e);
    throw new EucalyptusServiceException("String_Node_Str" + keySerialized + "String_Node_Str"+ e.getMessage());
  }
}

Fixed version (ground truth):
public static void deleteAccessKey(User requestUser,SearchResultRow keySerialized) throws EucalyptusServiceException {
  try {
    int i=0;
    String keyId=keySerialized.getField(i++);
    i++;
    i++;
    String accountName=keySerialized.getField(i++);
    String userName=keySerialized.getField(i++);
    Account account=Accounts.lookupAccountByName(accountName);
    User user=account.lookupUserByName(userName);
    EuarePermission.authorizeDeleteUserAccessKey(requestUser,account,user);
    user.removeKey(keyId);
  }
 catch (  EucalyptusServiceException e) {
    LOG.debug(e,e);
    throw e;
  }
catch (  Exception e) {
    LOG.error("String_Node_Str" + keySerialized,e);
    LOG.debug(e,e);
    throw new EucalyptusServiceException("String_Node_Str" + keySerialized + "String_Node_Str"+ e.getMessage());
  }
}
Program: 15115
Project: 15115
Buggy source:
public static void deleteCertificate(User requestUser,SearchResultRow certSerialized) throws EucalyptusServiceException {
  try {
    int i=0;
    String certId=certSerialized.getField(i++);
    i++;
    i++;
    String accountName=certSerialized.getField(i++);
    String userName=certSerialized.getField(i++);
    Account account=Accounts.lookupAccountByName(accountName);
    User user=account.lookupUserByName(userName);
    EuarePermission.authorizeDeleteUserCertificate(requestUser,account,user);
    user.removeKey(certId);
  }
 catch (  EucalyptusServiceException e) {
    LOG.debug(e,e);
    throw e;
  }
catch (  Exception e) {
    LOG.error("String_Node_Str" + certSerialized,e);
    LOG.debug(e,e);
    throw new EucalyptusServiceException("String_Node_Str" + certSerialized + "String_Node_Str"+ e.getMessage());
  }
}

Fixed version (ground truth):
public static void deleteCertificate(User requestUser,SearchResultRow certSerialized) throws EucalyptusServiceException {
  try {
    int i=0;
    String certId=certSerialized.getField(i++);
    i++;
    i++;
    String accountName=certSerialized.getField(i++);
    String userName=certSerialized.getField(i++);
    Account account=Accounts.lookupAccountByName(accountName);
    User user=account.lookupUserByName(userName);
    EuarePermission.authorizeDeleteUserCertificate(requestUser,account,user);
    user.removeCertificate(certId);
  }
 catch (  EucalyptusServiceException e) {
    LOG.debug(e,e);
    throw e;
  }
catch (  Exception e) {
    LOG.error("String_Node_Str" + certSerialized,e);
    LOG.debug(e,e);
    throw new EucalyptusServiceException("String_Node_Str" + certSerialized + "String_Node_Str"+ e.getMessage());
  }
}
Program: 15116
Project: 15116
Buggy source:
public static void deleteAccessKey(User requestUser,SearchResultRow keySerialized) throws EucalyptusServiceException {
  try {
    int i=0;
    String keyId=keySerialized.getField(i++);
    i++;
    String accountName=keySerialized.getField(i++);
    String userName=keySerialized.getField(i++);
    Account account=Accounts.lookupAccountByName(accountName);
    User user=account.lookupUserByName(userName);
    EuarePermission.authorizeDeleteUserAccessKey(requestUser,account,user);
    user.removeKey(keyId);
  }
 catch (  EucalyptusServiceException e) {
    LOG.debug(e,e);
    throw e;
  }
catch (  Exception e) {
    LOG.error("String_Node_Str" + keySerialized,e);
    LOG.debug(e,e);
    throw new EucalyptusServiceException("String_Node_Str" + keySerialized + "String_Node_Str"+ e.getMessage());
  }
}

Fixed version (ground truth):
public static void deleteAccessKey(User requestUser,SearchResultRow keySerialized) throws EucalyptusServiceException {
  try {
    int i=0;
    String keyId=keySerialized.getField(i++);
    i++;
    i++;
    String accountName=keySerialized.getField(i++);
    String userName=keySerialized.getField(i++);
    Account account=Accounts.lookupAccountByName(accountName);
    User user=account.lookupUserByName(userName);
    EuarePermission.authorizeDeleteUserAccessKey(requestUser,account,user);
    user.removeKey(keyId);
  }
 catch (  EucalyptusServiceException e) {
    LOG.debug(e,e);
    throw e;
  }
catch (  Exception e) {
    LOG.error("String_Node_Str" + keySerialized,e);
    LOG.debug(e,e);
    throw new EucalyptusServiceException("String_Node_Str" + keySerialized + "String_Node_Str"+ e.getMessage());
  }
}
Program: 15117
Project: 15117
Buggy source:
public static boolean isAuthorized(String vendor,String resourceType,String resourceName,Account resourceAccount,String action,User requestUser){
  Context context=null;
  try {
    context=Contexts.lookup();
    Map<Contract.Type,Contract> contracts=context.getContracts();
    policyEngine.evaluateAuthorization(vendor + "String_Node_Str" + resourceType,resourceName,resourceAccount,action,requestUser,contracts);
    return true;
  }
 catch (  IllegalContextAccessException e) {
    LOG.debug("String_Node_Str" + resourceType + "String_Node_Str"+ resourceName+ "String_Node_Str"+ resourceAccount.getName()+ "String_Node_Str"+ requestUser.getName(),e);
  }
catch (  AuthException e) {
    LOG.error("String_Node_Str" + resourceType + "String_Node_Str"+ resourceName+ "String_Node_Str"+ resourceAccount.getName()+ "String_Node_Str"+ requestUser.getName(),e);
  }
catch (  Throwable e) {
    LOG.debug("String_Node_Str" + resourceType + "String_Node_Str"+ resourceName+ "String_Node_Str"+ resourceAccount.getName()+ "String_Node_Str"+ requestUser.getName(),e);
  }
  return false;
}

Fixed version (ground truth):
public static boolean isAuthorized(String vendor,String resourceType,String resourceName,Account resourceAccount,String action,User requestUser){
  Context context=null;
  try {
    context=Contexts.lookup();
  }
 catch (  IllegalContextAccessException e) {
    LOG.debug("String_Node_Str",e);
  }
  try {
    Map<Contract.Type,Contract> contracts=context != null ? context.getContracts() : new HashMap<Contract.Type,Contract>();
    policyEngine.evaluateAuthorization(vendor + "String_Node_Str" + resourceType,resourceName,resourceAccount,action,requestUser,contracts);
    return true;
  }
 catch (  AuthException e) {
    LOG.error("String_Node_Str" + resourceType + "String_Node_Str"+ resourceName+ "String_Node_Str"+ resourceAccount.getName()+ "String_Node_Str"+ requestUser.getName(),e);
  }
catch (  Throwable e) {
    LOG.debug("String_Node_Str" + resourceType + "String_Node_Str"+ resourceName+ "String_Node_Str"+ resourceAccount.getName()+ "String_Node_Str"+ requestUser.getName(),e);
  }
  return false;
}
Program: 15118
Project: 15118
Buggy source:
public static LdapClient authenticateClient(LdapIntegrationConfiguration lic) throws LdapException {
  LdapContext context=LdapAuthenticatorFactory.getLdapAuthenticator(lic.getAuthMethod()).authenticate(lic.getServerUrl(),lic.getAuthMethod(),lic.isUseSsl(),lic.isIgnoreSslCertValidation(),lic.getAuthPrincipal(),lic.getAuthCredentials(),lic.getKrb5Conf());
  return new LdapClient(context);
}

Fixed version (ground truth):
public static LdapClient authenticateClient(LdapIntegrationConfiguration lic) throws LdapException {
  LdapContext context=LdapAuthenticatorFactory.getLdapAuthenticator(lic.getAuthMethod()).authenticate(lic.getServerUrl(),lic.getAuthMethod(),lic.isUseSsl(),lic.isIgnoreSslCertValidation(),lic.getAuthPrincipal(),AuthenticationUtil.decryptPassword(lic.getAuthCredentials()),lic.getKrb5Conf());
  return new LdapClient(context);
}
Program: 15119
Project: 15119
Buggy source:
public void sumFromPeriodType(Period period,String type){
  if (period == null || type == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  long timeSecs=(period.getEndingMs() - period.getBeginningMs()) / 1000;
  if (type.equalsIgnoreCase("String_Node_Str")) {
    this.m1SmallNum=this.m1SmallNum + 1;
    this.m1SmallTimeSecs=this.m1SmallTimeSecs + timeSecs;
  }
 else   if (type.equalsIgnoreCase("String_Node_Str")) {
    this.c1MediumNum=this.c1MediumNum + 1;
    this.c1MediumTimeSecs=this.c1MediumTimeSecs + timeSecs;
  }
 else   if (type.equalsIgnoreCase("String_Node_Str")) {
    this.m1LargeNum=this.m1LargeNum + 1;
    this.m1LargeTimeSecs=this.m1LargeTimeSecs + timeSecs;
  }
 else   if (type.equalsIgnoreCase("String_Node_Str")) {
    this.m1XLargeNum=this.m1XLargeNum + 1;
    this.m1XLargeTimeSecs=this.m1XLargeTimeSecs + timeSecs;
  }
 else   if (type.equalsIgnoreCase("String_Node_Str")) {
    this.c1XLargeNum=this.c1XLargeNum + 1;
    this.c1XLargeTimeSecs=this.c1XLargeTimeSecs + timeSecs;
  }
 else {
    System.err.println("String_Node_Str" + type);
  }
}

Fixed version (ground truth):
public void sumFromPeriodType(Period period,String type){
  if (period == null || type == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  long timeSecs=(period.getEndingMs() - period.getBeginningMs()) / 1000;
  if (type.equalsIgnoreCase("String_Node_Str")) {
    this.m1SmallNum=this.m1SmallNum + 1;
    this.m1SmallTimeSecs=this.m1SmallTimeSecs + timeSecs;
  }
 else   if (type.equalsIgnoreCase("String_Node_Str")) {
    this.c1MediumNum=this.c1MediumNum + 1;
    this.c1MediumTimeSecs=this.c1MediumTimeSecs + timeSecs;
  }
 else   if (type.equalsIgnoreCase("String_Node_Str")) {
    this.m1LargeNum=this.m1LargeNum + 1;
    this.m1LargeTimeSecs=this.m1LargeTimeSecs + timeSecs;
  }
 else   if (type.equalsIgnoreCase("String_Node_Str")) {
    this.m1XLargeNum=this.m1XLargeNum + 1;
    this.m1XLargeTimeSecs=this.m1XLargeTimeSecs + timeSecs;
  }
 else   if (type.equalsIgnoreCase("String_Node_Str")) {
    this.c1XLargeNum=this.c1XLargeNum + 1;
    this.c1XLargeTimeSecs=this.c1XLargeTimeSecs + timeSecs;
  }
 else {
    throw new RuntimeException("String_Node_Str" + type);
  }
}
Program: 15120
Project: 15120
Buggy source:
private static void verifyTimestamp(Node node) throws WSSecurityException {
  TimestampProcessor tsProc=new TimestampProcessor();
  LOG.debug("String_Node_Str" + node);
  Vector retResults=new Vector();
  tsProc.handleToken((Element)node,null,null,null,null,retResults,WSSConfig.getDefaultWSConfig());
  Timestamp ts=(Timestamp)((WSSecurityEngineResult)retResults.get(0)).get(WSSecurityEngineResult.TAG_TIMESTAMP);
  LOG.debug("String_Node_Str" + ts);
  Date expires=ts.getExpires().getTime();
  if (!SecurityContext.validateTimestampPeriod(expires)) {
    LOG.warn("String_Node_Str");
  }
  Calendar now=Calendar.getInstance();
  now.add(Calendar.SECOND,-20);
  if (now.after(ts.getCreated())) {
    throw new WSSecurityException("String_Node_Str");
  }
}

Fixed version (ground truth):
private static void verifyTimestamp(Node node) throws WSSecurityException {
  TimestampProcessor tsProc=new TimestampProcessor();
  LOG.debug("String_Node_Str" + node);
  Vector retResults=new Vector();
  tsProc.handleToken((Element)node,null,null,null,null,retResults,WSSConfig.getDefaultWSConfig());
  Timestamp ts=(Timestamp)((WSSecurityEngineResult)retResults.get(0)).get(WSSecurityEngineResult.TAG_TIMESTAMP);
  LOG.debug("String_Node_Str" + ts);
  Date expires=ts.getExpires().getTime();
  if (!SecurityContext.validateTimestampPeriod(expires)) {
    LOG.warn("String_Node_Str");
  }
  Calendar now=Calendar.getInstance();
  now.add(Calendar.SECOND,20);
  if (now.before(ts.getCreated())) {
    throw new WSSecurityException("String_Node_Str");
  }
}
Program: 15124
Project: 15124
Buggy source:
public boolean init() throws Exception {
  Logs.init();
  BootstrapArgs.init();
  Security.addProvider(new BouncyCastleProvider());
  try {
    if (!BootstrapArgs.isInitializeSystem()) {
      Bootstrap.init();
      Bootstrap.Stage stage=Bootstrap.transition();
      stage.load();
    }
    return true;
  }
 catch (  BootstrapException e) {
    e.printStackTrace();
    throw e;
  }
catch (  Throwable t) {
    t.printStackTrace();
    LOG.fatal(t,t);
    System.exit(1);
    return false;
  }
}

Fixed version (ground truth):
public boolean init() throws Exception {
  Logs.init();
  BootstrapArgs.init();
  Security.addProvider(new BouncyCastleProvider());
  try {
    if (!BootstrapArgs.isInitializeSystem()) {
      Bootstrap.init();
      Bootstrap.Stage stage=Bootstrap.transition();
      stage.load();
    }
    return true;
  }
 catch (  BootstrapException e) {
    e.printStackTrace();
    throw e;
  }
catch (  Throwable t) {
    t.printStackTrace();
    LOG.fatal(t,t);
    System.exit(123);
    return false;
  }
}
Program: 15125
Project: 15125
Buggy source:
@Override public void receive(List<Host> hosts){
  Component euca=Components.lookup(Eucalyptus.class);
  if (!Bootstrap.isFinished()) {
    return;
  }
  for (  final Host host : hosts) {
    Hosts.update(host);
    if (!host.hasBootstrapped() && !host.hasDatabase() && !host.isLocalHost()) {
      try {
        ServiceConfiguration config=euca.getBuilder().lookupByHost(host.getBindAddress().getHostAddress());
        LOG.debug("String_Node_Str" + host);
        HostManager.send(host.getGroupsId(),new Initialize());
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex,ex);
        LOG.debug("String_Node_Str" + host);
        HostManager.send(host.getGroupsId(),new NoInitialize());
      }
    }
 else     if (!host.hasBootstrapped()) {
      LOG.debug("String_Node_Str" + host);
      HostManager.send(host.getGroupsId(),new NoInitialize());
    }
  }
}

Fixed version (ground truth):
@Override public void receive(List<Host> hosts){
  Component euca=Components.lookup(Eucalyptus.class);
  if (!Bootstrap.isFinished()) {
    return;
  }
  for (  final Host host : hosts) {
    Hosts.update(host);
    if (!host.hasBootstrapped() && !host.hasDatabase() && !host.isLocalHost()) {
      try {
        ServiceConfiguration config=euca.getBuilder().lookupByHost(host.getBindAddress().getHostAddress());
        LOG.debug("String_Node_Str" + host);
        HostManager.send(host.getGroupsId(),new Initialize());
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex);
        LOG.debug("String_Node_Str" + host);
        HostManager.send(host.getGroupsId(),new NoInitialize());
      }
    }
 else     if (!host.hasBootstrapped()) {
      LOG.debug("String_Node_Str" + host);
      HostManager.send(host.getGroupsId(),new NoInitialize());
    }
  }
}
Program: 15126
Project: 15126
Buggy source:
@Override public Boolean checkAdd(String partition,String name,String host,Integer port) throws ServiceRegistrationException {
  try {
    if (!Internets.testGoodAddress(host)) {
      throw new EucalyptusCloudException("String_Node_Str");
    }
  }
 catch (  EucalyptusCloudException e) {
    throw new ServiceRegistrationException(e.getMessage(),e);
  }
catch (  Exception e) {
    throw new ServiceRegistrationException("String_Node_Str" + e.getMessage(),e);
  }
  ServiceConfiguration existingName=null;
  try {
    existingName=this.lookupByName(name);
  }
 catch (  ServiceRegistrationException ex1) {
    LOG.trace("String_Node_Str" + name);
  }
  ServiceConfiguration existingHost=null;
  try {
    existingHost=this.lookupByHost(host);
  }
 catch (  ServiceRegistrationException ex1) {
    LOG.trace("String_Node_Str" + host);
  }
  if (existingName != null && existingHost != null) {
    return false;
  }
 else   if (existingName == null && existingHost == null) {
    return true;
  }
 else   if (existingName != null) {
    throw new ServiceRegistrationException("String_Node_Str" + name + "String_Node_Str"+ existingName.getHostName());
  }
 else   if (existingHost != null) {
    throw new ServiceRegistrationException("String_Node_Str" + host + "String_Node_Str"+ existingHost.getName());
  }
 else {
    throw new ServiceRegistrationException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public Boolean checkAdd(String partition,String name,String host,Integer port) throws ServiceRegistrationException {
  try {
    if (!Internets.testGoodAddress(host)) {
      throw new EucalyptusCloudException("String_Node_Str");
    }
  }
 catch (  EucalyptusCloudException e) {
    throw new ServiceRegistrationException(e.getMessage(),e);
  }
catch (  Exception e) {
    throw new ServiceRegistrationException("String_Node_Str" + e.getMessage(),e);
  }
  ServiceConfiguration existingName=null;
  try {
    existingName=this.lookupByName(name);
  }
 catch (  PersistenceException ex1) {
    LOG.trace("String_Node_Str" + name);
  }
  ServiceConfiguration existingHost=null;
  try {
    existingHost=this.lookupByHost(host);
  }
 catch (  PersistenceException ex1) {
    LOG.trace("String_Node_Str" + host);
  }
  if (existingName != null && existingHost != null) {
    return false;
  }
 else   if (existingName == null && existingHost == null) {
    return true;
  }
 else   if (existingName != null) {
    throw new ServiceRegistrationException("String_Node_Str" + name + "String_Node_Str"+ existingName.getHostName());
  }
 else   if (existingHost != null) {
    throw new ServiceRegistrationException("String_Node_Str" + host + "String_Node_Str"+ existingHost.getName());
  }
 else {
    throw new ServiceRegistrationException("String_Node_Str");
  }
}
Program: 15127
Project: 15127
Buggy source:
@Override public Boolean checkRemove(String partition,String name) throws ServiceRegistrationException {
  try {
    this.lookupByName(name);
    return true;
  }
 catch (  ServiceRegistrationException e) {
    throw e;
  }
catch (  Throwable e) {
    LOG.error(e,e);
    return false;
  }
}

Fixed version (ground truth):
@Override public Boolean checkRemove(String partition,String name) throws ServiceRegistrationException {
  try {
    this.lookupByName(name);
    return true;
  }
 catch (  PersistenceException e) {
    throw new ServiceRegistrationException(e);
  }
catch (  Throwable e) {
    LOG.error(e,e);
    return false;
  }
}
Program: 15130
Project: 15130
Buggy source:
private void cleanup(){
  try {
    if (this.session.get() != null) {
      this.session.clear();
    }
    this.delegate=null;
    if (this.em != null) {
      this.em.close();
    }
    this.em=null;
  }
  finally {
    outstanding.remove(this.txUuid);
  }
}

Fixed version (ground truth):
private void cleanup(){
  try {
    if (this.session != null && this.session.get() != null) {
      this.session.clear();
    }
    this.delegate=null;
    if (this.em != null) {
      this.em.close();
    }
    this.em=null;
  }
  finally {
    outstanding.remove(this.txUuid);
  }
}
Program: 15133
Project: 15133
Buggy source:
@Override public void handleUpstream(final ChannelHandlerContext ctx,final ChannelEvent channelEvent) throws Exception {
  if (Logs.EXTREME) {
    LOG.trace(LogUtil.dumpObject(channelEvent));
  }
  if (channelEvent instanceof MessageEvent) {
    final MessageEvent msgEvent=(MessageEvent)channelEvent;
    this.incomingMessage(msgEvent);
    ctx.sendUpstream(channelEvent);
  }
 else {
    ctx.sendUpstream(channelEvent);
  }
}

Fixed version (ground truth):
@Override public void handleUpstream(final ChannelHandlerContext ctx,final ChannelEvent channelEvent) throws Exception {
  if (Logs.EXTREME) {
    LOG.trace(LogUtil.dumpObject(channelEvent));
  }
  if (channelEvent instanceof MessageEvent) {
    final MessageEvent msgEvent=(MessageEvent)channelEvent;
    this.incomingMessage(ctx,msgEvent);
    ctx.sendUpstream(channelEvent);
  }
 else {
    ctx.sendUpstream(channelEvent);
  }
}
Program: 15135
Project: 15135
Buggy source:
public void stop() throws ServiceRegistrationException {
  final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(this,State.DISABLED,State.STOPPED);
  Threads.lookup(ClusterController.class,Cluster.class).submit(transition);
  ListenerRegistry.getInstance().deregister(Hertz.class,this);
  ListenerRegistry.getInstance().deregister(ClockTick.class,this);
  Clusters.getInstance().deregister(this.getName());
}

Fixed version (ground truth):
public void stop() throws ServiceRegistrationException {
  final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(this,State.DISABLED,State.STOPPED);
  try {
    Threads.lookup(ClusterController.class,Cluster.class).submit(transition).get();
  }
 catch (  InterruptedException ex) {
    Thread.currentThread().interrupt();
  }
catch (  ExecutionException ex) {
    LOG.error(ex,ex);
  }
 finally {
    ListenerRegistry.getInstance().deregister(Hertz.class,this);
    ListenerRegistry.getInstance().deregister(ClockTick.class,this);
    Clusters.getInstance().deregister(this.getName());
  }
}
Program: 15136
Project: 15136
Buggy source:
public void start() throws ServiceRegistrationException {
  Clusters.getInstance().registerDisabled(this);
  try {
    ListenerRegistry.getInstance().register(ClockTick.class,Cluster.this);
    ListenerRegistry.getInstance().register(Hertz.class,Cluster.this);
  }
 catch (  Exception ex1) {
    LOG.error(ex1,ex1);
  }
  if (!State.DISABLED.equals(this.stateMachine.getState())) {
    final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(Cluster.this,State.PENDING,State.AUTHENTICATING,State.STARTING,State.STARTING_NOTREADY,State.NOTREADY,State.DISABLED);
    try {
      transition.call().get();
    }
 catch (    Exception ex) {
      Logs.exhaust().error(ex,ex);
      throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
    }
  }
}

Fixed version (ground truth):
public void start() throws ServiceRegistrationException {
  try {
    Clusters.getInstance().registerDisabled(this);
    ListenerRegistry.getInstance().register(ClockTick.class,Cluster.this);
    ListenerRegistry.getInstance().register(Hertz.class,Cluster.this);
    if (!State.DISABLED.equals(this.stateMachine.getState())) {
      final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(Cluster.this,State.PENDING,State.AUTHENTICATING,State.STARTING,State.STARTING_NOTREADY,State.NOTREADY,State.DISABLED);
      try {
        transition.call().get();
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex,ex);
        throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
      }
    }
  }
 catch (  Exception ex) {
    this.stop();
  }
}
Program: 15138
Project: 15138
Buggy source:
public NetworkToken extantAllocation(String accountId,String networkName,String networkUuid,int vlan) throws NetworkAlreadyExistsException {
  AccountFullName accountFn=Accounts.lookupAccountFullNameById(accountId);
  NetworkToken netToken=new NetworkToken(this.clusterName,accountFn,networkName,networkUuid,vlan);
  if (!ClusterState.availableVlans.remove(vlan)) {
    throw new NetworkAlreadyExistsException();
  }
  return netToken;
}

Fixed version (ground truth):
public NetworkToken extantAllocation(String accountId,String networkName,String networkUuid,int vlan) throws NetworkAlreadyExistsException {
  AccountFullName accountFn;
  try {
    accountFn=Accounts.lookupAccountFullNameById(accountId);
  }
 catch (  Exception ex) {
    try {
      accountFn=Accounts.lookupAccountFullNameByUserId(accountId);
    }
 catch (    RuntimeException ex1) {
      LOG.error(ex1,ex1);
      throw ex1;
    }
  }
  NetworkToken netToken=new NetworkToken(this.clusterName,accountFn,networkName,networkUuid,vlan);
  if (!ClusterState.availableVlans.remove(vlan)) {
    throw new NetworkAlreadyExistsException();
  }
  return netToken;
}
Program: 15139
Project: 15139
Buggy source:
public void enable() throws ServiceRegistrationException {
  if (State.ENABLING.ordinal() > this.stateMachine.getState().ordinal()) {
    try {
      final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(this,State.PENDING,State.AUTHENTICATING,State.STARTING,State.STARTING_NOTREADY,State.NOTREADY,State.DISABLED,State.ENABLING,State.ENABLING_RESOURCES,State.ENABLING_NET,State.ENABLING_VMS,State.ENABLING_ADDRS,State.ENABLING_VMS_PASS_TWO,State.ENABLING_ADDRS_PASS_TWO,State.ENABLED);
      ServiceRegistrationException fail=null;
      for (int i=0; i < CLUSTER_STARTUP_SYNC_RETRIES; i++) {
        CheckedListenableFuture<Cluster> res=Threads.lookup(ClusterController.class,Cluster.class).submit(transition).get();
        try {
          res.get();
          fail=null;
          break;
        }
 catch (        Exception ex) {
          Logs.exhaust().error(ex,ex);
          fail=new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
        }
      }
      if (fail != null) {
        throw fail;
      }
    }
 catch (    NoSuchElementException ex) {
      throw ex;
    }
catch (    ServiceRegistrationException ex) {
      throw ex;
    }
catch (    Exception ex) {
      LOG.error(ex,ex);
      throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
    }
  }
}

Fixed version (ground truth):
public void enable() throws ServiceRegistrationException {
  if (State.ENABLING.ordinal() > this.stateMachine.getState().ordinal()) {
    try {
      CheckedListenableFuture<Cluster> result=Automata.sequenceTransitions(this,State.PENDING,State.AUTHENTICATING,State.STARTING,State.STARTING_NOTREADY,State.NOTREADY,State.DISABLED,State.ENABLING,State.ENABLING_RESOURCES,State.ENABLING_NET,State.ENABLING_VMS,State.ENABLING_ADDRS,State.ENABLING_VMS_PASS_TWO,State.ENABLING_ADDRS_PASS_TWO,State.ENABLED).call();
      result.get();
    }
 catch (    InterruptedException ex) {
      Thread.currentThread().interrupt();
    }
catch (    Exception ex) {
      Logs.exhaust().debug(ex,ex);
      throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
    }
  }
}
Program: 15140
Project: 15140
Buggy source:
public void stop() throws ServiceRegistrationException {
  final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(this,State.DISABLED,State.STOPPED);
  try {
    Threads.lookup(ClusterController.class,Cluster.class).submit(transition).get();
  }
 catch (  InterruptedException ex) {
    Thread.currentThread().interrupt();
  }
catch (  ExecutionException ex) {
    LOG.error(ex,ex);
  }
 finally {
    ListenerRegistry.getInstance().deregister(Hertz.class,this);
    ListenerRegistry.getInstance().deregister(ClockTick.class,this);
    Clusters.getInstance().deregister(this.getName());
  }
}

Fixed version (ground truth):
public void stop() throws ServiceRegistrationException {
  try {
    Automata.sequenceTransitions(this,State.DISABLED,State.STOPPED).call().get();
  }
 catch (  InterruptedException ex) {
    Thread.currentThread().interrupt();
  }
catch (  Exception ex) {
    Logs.exhaust().debug(ex,ex);
    throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
  }
 finally {
    ListenerRegistry.getInstance().deregister(Hertz.class,this);
    ListenerRegistry.getInstance().deregister(ClockTick.class,this);
    Clusters.getInstance().deregister(this.getName());
  }
}
Program: 15141
Project: 15141
Buggy source:
public void start() throws ServiceRegistrationException {
  try {
    Clusters.getInstance().registerDisabled(this);
    ListenerRegistry.getInstance().register(ClockTick.class,Cluster.this);
    ListenerRegistry.getInstance().register(Hertz.class,Cluster.this);
    if (!State.DISABLED.equals(this.stateMachine.getState())) {
      final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(Cluster.this,State.PENDING,State.AUTHENTICATING,State.STARTING,State.STARTING_NOTREADY,State.NOTREADY,State.DISABLED);
      try {
        transition.call().get();
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex,ex);
        throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
      }
    }
  }
 catch (  Exception ex) {
    this.stop();
  }
}

Fixed version (ground truth):
public void start() throws ServiceRegistrationException {
  try {
    Clusters.getInstance().registerDisabled(this);
    ListenerRegistry.getInstance().register(ClockTick.class,this);
    ListenerRegistry.getInstance().register(Hertz.class,this);
    if (!State.DISABLED.equals(this.stateMachine.getState())) {
      Automata.sequenceTransitions(this,State.PENDING,State.AUTHENTICATING,State.STARTING,State.STARTING_NOTREADY,State.NOTREADY,State.DISABLED).call().get();
    }
  }
 catch (  InterruptedException ex) {
    Thread.currentThread().interrupt();
  }
catch (  NoSuchElementException ex) {
    this.stop();
    Logs.exhaust().debug(ex,ex);
    throw ex;
  }
catch (  ServiceRegistrationException ex) {
    this.stop();
    Logs.exhaust().debug(ex,ex);
    throw ex;
  }
catch (  Exception ex) {
    this.stop();
    Logs.exhaust().debug(ex,ex);
    throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
  }
}
Program: 15143
Project: 15143
Buggy source:
public void disable() throws ServiceRegistrationException {
  try {
    if (State.NOTREADY.equals(this.getStateMachine().getState())) {
      final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(this,State.ENABLED,State.DISABLED);
      Threads.lookup(ClusterController.class,Cluster.class).submit(transition).get();
    }
 else     if (State.ENABLED.equals(this.getStateMachine().getState())) {
      final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(this,State.NOTREADY,State.DISABLED);
      Threads.lookup(ClusterController.class,Cluster.class).submit(transition).get();
    }
  }
 catch (  InterruptedException ex) {
    Thread.currentThread().interrupt();
  }
catch (  ExecutionException ex) {
    Logs.exhaust().debug(ex,ex);
    throw new ServiceRegistrationException("String_Node_Str" + ex.getMessage(),ex);
  }
}

Fixed version (ground truth):
public void disable() throws ServiceRegistrationException {
  try {
    if (State.NOTREADY.equals(this.getStateMachine().getState())) {
      Automata.sequenceTransitions(this,State.ENABLED,State.DISABLED).call().get();
    }
 else     if (State.ENABLED.equals(this.getStateMachine().getState())) {
      Automata.sequenceTransitions(this,State.NOTREADY,State.DISABLED).call().get();
    }
  }
 catch (  InterruptedException ex) {
    Thread.currentThread().interrupt();
  }
catch (  Exception ex) {
    Logs.exhaust().debug(ex,ex);
    throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
  }
}
Program: 15149
Project: 15149
Buggy source:
public void fire(){
  try {
    this.transition.enter(AtomicMarkedState.this.parent);
    AtomicMarkedState.this.commit();
    try {
      this.transition.after(AtomicMarkedState.this.parent);
    }
 catch (    Throwable t) {
      LOG.error(t,t);
    }
  }
 catch (  Throwable t) {
    AtomicMarkedState.this.error(t);
  }
}

Fixed version (ground truth):
public void fire(){
  try {
    this.transition.enter(AtomicMarkedState.this.parent);
    this.transition.after(AtomicMarkedState.this.parent);
    AtomicMarkedState.this.commit();
  }
 catch (  Throwable t) {
    AtomicMarkedState.this.error(t);
  }
}
Program: 15150
Project: 15150
Buggy source:
@Override public ServiceConfiguration apply(ServiceConfiguration config){
  if (!Bootstrap.isFinished()) {
    LOG.debug(this.toString() + "String_Node_Str" + config);
    return config;
  }
 else   if (!config.getStateMachine().isBusy()) {
    State initialState=config.lookupState();
    State nextState=config.lookupState();
    if (State.NOTREADY.equals(initialState) || State.BROKEN.equals(initialState)) {
      nextState=State.DISABLED;
    }
 else     if (initialState.ordinal() < State.NOTREADY.ordinal()) {
      return config;
    }
    try {
      Future<ServiceConfiguration> result=ServiceTransitions.transitionChain(config,nextState);
      ServiceConfiguration endConfig=result.get();
      State endState=endConfig.lookupState();
      LOG.debug(this.toString() + "String_Node_Str" + endConfig+ "String_Node_Str"+ initialState+ "String_Node_Str"+ nextState+ "String_Node_Str"+ endState);
      return endConfig;
    }
 catch (    InterruptedException ex) {
      Thread.currentThread().interrupt();
      return config;
    }
catch (    Exception ex) {
      LOG.error(ex,ex);
      throw new UndeclaredThrowableException(ex);
    }
  }
 else {
    return config;
  }
}

Fixed version (ground truth):
@Override public ServiceConfiguration apply(ServiceConfiguration config){
  if (!Bootstrap.isFinished()) {
    LOG.debug(this.toString() + "String_Node_Str" + config);
    return config;
  }
 else {
    State initialState=config.lookupState();
    State nextState=config.lookupState();
    if (State.NOTREADY.equals(initialState) || State.BROKEN.equals(initialState)) {
      nextState=State.DISABLED;
    }
 else     if (initialState.ordinal() < State.NOTREADY.ordinal()) {
      return config;
    }
    try {
      Future<ServiceConfiguration> result=ServiceTransitions.transitionChain(config,nextState);
      ServiceConfiguration endConfig=result.get();
      State endState=endConfig.lookupState();
      LOG.debug(this.toString() + "String_Node_Str" + endConfig+ "String_Node_Str"+ initialState+ "String_Node_Str"+ nextState+ "String_Node_Str"+ endState);
      return endConfig;
    }
 catch (    InterruptedException ex) {
      Thread.currentThread().interrupt();
      return config;
    }
catch (    Exception ex) {
      LOG.error(ex,ex);
      throw new UndeclaredThrowableException(ex);
    }
  }
}
Program: 15151
Project: 15151
Buggy source:
private final void doFail(Throwable failure){
  this.LOG.trace(EventRecord.here(BasicCallbackProcessor.class,EventType.CALLBACK,this.callback.getClass().toString(),"String_Node_Str" + failure.getClass().getSimpleName() + "String_Node_Str"));
  this.LOG.trace(failure.getMessage(),failure);
  if (this.callback instanceof Callback.Checked) {
    ((Checked)this.callback).fireException(failure);
  }
 else   if (this.callback instanceof Callback.Completion) {
    ((Callback.Completion)this.callback).fire();
  }
}

Fixed version (ground truth):
private final void doFail(Throwable failure){
  this.LOG.trace(EventRecord.here(BasicCallbackProcessor.class,EventType.CALLBACK,this.callback.getClass().toString(),"String_Node_Str" + failure.getClass().getSimpleName() + "String_Node_Str"));
  this.LOG.trace(failure.getMessage(),failure);
  if (this.callback instanceof Callback.Checked) {
    ((Checked)this.callback).fireException(failure);
  }
 else   if (this.callback instanceof Callback.Completion) {
    ((Callback.Completion)this.callback).fireException(failure);
  }
}
Program: 15152
Project: 15152
Buggy source:
public void enable() throws ServiceRegistrationException {
  if (!State.ENABLED.equals(this.stateMachine.getState())) {
    try {
      final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(this,State.PENDING,State.AUTHENTICATING,State.STARTING,State.STARTING_NOTREADY,State.NOTREADY,State.DISABLED,State.ENABLING,State.ENABLING_RESOURCES,State.ENABLING_NET,State.ENABLING_VMS,State.ENABLING_ADDRS,State.ENABLING_VMS_PASS_TWO,State.ENABLING_ADDRS_PASS_TWO,State.ENABLED);
      CheckedListenableFuture<Cluster> res=Threads.lookup(ClusterController.class,Cluster.class).submit(transition).get();
      try {
        res.get();
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex,ex);
        throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
      }
    }
 catch (    NoSuchElementException ex) {
      throw ex;
    }
catch (    Exception ex) {
      LOG.error(ex,ex);
      throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
    }
  }
}

Fixed version (ground truth):
public void enable() throws ServiceRegistrationException {
  if (State.ENABLED.ordinal() > this.stateMachine.getState().ordinal()) {
    try {
      final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(this,State.PENDING,State.AUTHENTICATING,State.STARTING,State.STARTING_NOTREADY,State.NOTREADY,State.DISABLED,State.ENABLING,State.ENABLING_RESOURCES,State.ENABLING_NET,State.ENABLING_VMS,State.ENABLING_ADDRS,State.ENABLING_VMS_PASS_TWO,State.ENABLING_ADDRS_PASS_TWO,State.ENABLED);
      CheckedListenableFuture<Cluster> res=Threads.lookup(ClusterController.class,Cluster.class).submit(transition).get();
      try {
        res.get();
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex,ex);
        throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
      }
    }
 catch (    NoSuchElementException ex) {
      throw ex;
    }
catch (    Exception ex) {
      LOG.error(ex,ex);
      throw new ServiceRegistrationException("String_Node_Str" + this.configuration + "String_Node_Str"+ ex.getMessage(),ex);
    }
  }
}
Program: 15153
Project: 15153
Buggy source:
public void disable() throws ServiceRegistrationException {
  final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(this,State.ENABLED,State.DISABLED);
  Threads.lookup(ClusterController.class,Cluster.class).submit(transition);
}

Fixed version (ground truth):
public void disable() throws ServiceRegistrationException {
  if (State.NOTREADY.equals(this.getStateMachine().getState())) {
    final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(this,State.ENABLED,State.DISABLED);
    Threads.lookup(ClusterController.class,Cluster.class).submit(transition);
  }
 else   if (State.ENABLED.equals(this.getStateMachine().getState())) {
    final Callable<CheckedListenableFuture<Cluster>> transition=Automata.sequenceTransitions(this,State.NOTREADY,State.DISABLED);
    Threads.lookup(ClusterController.class,Cluster.class).submit(transition);
  }
}
Program: 15155
Project: 15155
Buggy source:
/** 
 * @see com.eucalyptus.util.async.Request#dispatch(java.lang.String)
 * @param cluster
 * @return
 */
@Override public CheckedListenableFuture<R> dispatch(final ServiceConfiguration serviceConfig){
  Future<CheckedListenableFuture<R>> res=Threads.lookup(Empyrean.class,AsyncRequest.class,serviceConfig.getFullName().toString()).limitTo(NUM_WORKERS).submit(new Callable<CheckedListenableFuture<R>>(){
    @Override public CheckedListenableFuture<R> call() throws Exception {
      return AsyncRequest.this.execute(serviceConfig).getResponse();
    }
  }
);
  try {
    res.get().get();
    return res.get();
  }
 catch (  ExecutionException ex) {
    LOG.error(ex,ex);
    return Futures.predestinedFailedFuture(ex);
  }
catch (  InterruptedException ex) {
    Thread.currentThread().interrupt();
    LOG.error(ex,ex);
    return Futures.predestinedFailedFuture(ex);
  }
}

Fixed version (ground truth):
/** 
 * @see com.eucalyptus.util.async.Request#dispatch(java.lang.String)
 * @param cluster
 * @return
 */
@Override public CheckedListenableFuture<R> dispatch(final ServiceConfiguration serviceConfig){
  try {
    ServiceEndpoint serviceEndpoint=serviceConfig.lookupEndpoint();
    serviceEndpoint.enqueue(this);
    return this.getResponse();
  }
 catch (  Exception ex1) {
    Future<CheckedListenableFuture<R>> res=Threads.lookup(Empyrean.class,AsyncRequest.class,serviceConfig.getFullName().toString()).limitTo(NUM_WORKERS).submit(new Callable<CheckedListenableFuture<R>>(){
      @Override public CheckedListenableFuture<R> call() throws Exception {
        return AsyncRequest.this.execute(serviceConfig).getResponse();
      }
    }
);
    try {
      res.get().get();
    }
 catch (    ExecutionException ex) {
      LOG.error(ex,ex);
    }
catch (    InterruptedException ex) {
      Thread.currentThread().interrupt();
      LOG.error(ex,ex);
    }
    return this.getResponse();
  }
}
Program: 15156
Project: 15156
Buggy source:
protected MessageCallback(Q request){
  super();
  this.request.set(request);
}

Fixed version (ground truth):
protected MessageCallback(Q request){
  super();
  if (request.getUserId() == null) {
    request.setUser(FakePrincipals.SYSTEM_USER);
  }
  this.request.set(request);
}
Program: 15157
Project: 15157
Buggy source:
@Override public boolean apply(AttachedVolume arg0){
  try {
    vm.removeVolumeAttachment(arg0.getVolumeId());
    Dispatcher scDispatcher=ServiceDispatcher.lookup(sc);
    scDispatcher.send(new DetachStorageVolumeType(cluster.getNode(vm.getServiceTag()).getIqn(),arg0.getVolumeId()));
    return true;
  }
 catch (  Throwable e) {
    LOG.error("String_Node_Str" + arg0.getVolumeId() + "String_Node_Str"+ e.getMessage(),e);
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean apply(AttachedVolume arg0){
  try {
    final ServiceConfiguration sc=Partitions.lookupService(Storage.class,vm.getPartition());
    vm.removeVolumeAttachment(arg0.getVolumeId());
    Dispatcher scDispatcher=ServiceDispatcher.lookup(sc);
    scDispatcher.send(new DetachStorageVolumeType(cluster.getNode(vm.getServiceTag()).getIqn(),arg0.getVolumeId()));
    return true;
  }
 catch (  Throwable e) {
    LOG.error("String_Node_Str" + arg0.getVolumeId() + "String_Node_Str"+ e.getMessage(),e);
    return false;
  }
}
Program: 15158
Project: 15158
Buggy source:
private static void cleanUpAttachedVolumes(final VmInstance vm){
  try {
    final Cluster cluster=Clusters.getInstance().lookup(vm.getClusterName());
    final ServiceConfiguration sc=Partitions.lookupService(Storage.class,vm.getPartition());
    vm.eachVolumeAttachment(new Predicate<AttachedVolume>(){
      @Override public boolean apply(      AttachedVolume arg0){
        try {
          vm.removeVolumeAttachment(arg0.getVolumeId());
          Dispatcher scDispatcher=ServiceDispatcher.lookup(sc);
          scDispatcher.send(new DetachStorageVolumeType(cluster.getNode(vm.getServiceTag()).getIqn(),arg0.getVolumeId()));
          return true;
        }
 catch (        Throwable e) {
          LOG.error("String_Node_Str" + arg0.getVolumeId() + "String_Node_Str"+ e.getMessage(),e);
          return false;
        }
      }
    }
);
  }
 catch (  Exception ex) {
    LOG.error("String_Node_Str" + vm.getInstanceId() + "String_Node_Str"+ vm.getPartition()+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private static void cleanUpAttachedVolumes(final VmInstance vm){
  try {
    final Cluster cluster=Clusters.getInstance().lookup(vm.getClusterName());
    vm.eachVolumeAttachment(new Predicate<AttachedVolume>(){
      @Override public boolean apply(      AttachedVolume arg0){
        try {
          final ServiceConfiguration sc=Partitions.lookupService(Storage.class,vm.getPartition());
          vm.removeVolumeAttachment(arg0.getVolumeId());
          Dispatcher scDispatcher=ServiceDispatcher.lookup(sc);
          scDispatcher.send(new DetachStorageVolumeType(cluster.getNode(vm.getServiceTag()).getIqn(),arg0.getVolumeId()));
          return true;
        }
 catch (        Throwable e) {
          LOG.error("String_Node_Str" + arg0.getVolumeId() + "String_Node_Str"+ e.getMessage(),e);
          return false;
        }
      }
    }
);
  }
 catch (  Exception ex) {
    LOG.error("String_Node_Str" + vm.getInstanceId() + "String_Node_Str"+ vm.getPartition()+ "String_Node_Str");
  }
}