nus-yam/ex-repair huggingface dataset:
Program: 14931
Project: 14931
Buggy source:
public void initializeTable(int pageSize,ArrayList<SearchResultFieldDesc> fieldDescs){
  tablePanel.clear();
  final MultiSelectionModel<SearchResultRow> selectionModel=new MultiSelectionModel<SearchResultRow>(SearchResultRow.KEY_PROVIDER);
  selectionModel.addSelectionChangeHandler(new Handler(){
    @Override public void onSelectionChange(    SelectionChangeEvent event){
      Set<SearchResultRow> rows=selectionModel.getSelectedSet();
      LOG.log(Level.INFO,"String_Node_Str" + rows);
      presenter.onSelectionChange(rows);
    }
  }
);
  table=new SearchResultTable(pageSize,fieldDescs,this.presenter,selectionModel);
  tablePanel.add(table);
  table.load();
}

Fixed version (ground truth):
public void initializeTable(int pageSize,ArrayList<SearchResultFieldDesc> fieldDescs){
  tablePanel.clear();
  selectionModel.addSelectionChangeHandler(new Handler(){
    @Override public void onSelectionChange(    SelectionChangeEvent event){
      Set<SearchResultRow> rows=selectionModel.getSelectedSet();
      LOG.log(Level.INFO,"String_Node_Str" + rows);
      presenter.onSelectionChange(rows);
    }
  }
);
  table=new SearchResultTable(pageSize,fieldDescs,this.presenter,selectionModel);
  tablePanel.add(table);
  table.load();
}
Program: 14932
Project: 14932
Buggy source:
public void initializeTable(int pageSize,ArrayList<SearchResultFieldDesc> fieldDescs){
  tablePanel.clear();
  final MultiSelectionModel<SearchResultRow> selectionModel=new MultiSelectionModel<SearchResultRow>(SearchResultRow.KEY_PROVIDER);
  selectionModel.addSelectionChangeHandler(new Handler(){
    @Override public void onSelectionChange(    SelectionChangeEvent event){
      Set<SearchResultRow> rows=selectionModel.getSelectedSet();
      LOG.log(Level.INFO,"String_Node_Str" + rows);
      presenter.onSelectionChange(rows);
    }
  }
);
  table=new SearchResultTable(pageSize,fieldDescs,this.presenter,selectionModel);
  tablePanel.add(table);
  table.load();
}

Fixed version (ground truth):
public void initializeTable(int pageSize,ArrayList<SearchResultFieldDesc> fieldDescs){
  tablePanel.clear();
  selectionModel.addSelectionChangeHandler(new Handler(){
    @Override public void onSelectionChange(    SelectionChangeEvent event){
      Set<SearchResultRow> rows=selectionModel.getSelectedSet();
      LOG.log(Level.INFO,"String_Node_Str" + rows);
      presenter.onSelectionChange(rows);
    }
  }
);
  table=new SearchResultTable(pageSize,fieldDescs,this.presenter,selectionModel);
  tablePanel.add(table);
  table.load();
}
Program: 14933
Project: 14933
Buggy source:
public void initializeTable(int pageSize,ArrayList<SearchResultFieldDesc> fieldDescs){
  tablePanel.clear();
  final MultiSelectionModel<SearchResultRow> selectionModel=new MultiSelectionModel<SearchResultRow>(SearchResultRow.KEY_PROVIDER);
  selectionModel.addSelectionChangeHandler(new Handler(){
    @Override public void onSelectionChange(    SelectionChangeEvent event){
      Set<SearchResultRow> rows=selectionModel.getSelectedSet();
      LOG.log(Level.INFO,"String_Node_Str" + rows);
      presenter.onSelectionChange(rows);
    }
  }
);
  table=new SearchResultTable(pageSize,fieldDescs,this.presenter,selectionModel);
  tablePanel.add(table);
  table.load();
}

Fixed version (ground truth):
public void initializeTable(int pageSize,ArrayList<SearchResultFieldDesc> fieldDescs){
  tablePanel.clear();
  selectionModel.addSelectionChangeHandler(new Handler(){
    @Override public void onSelectionChange(    SelectionChangeEvent event){
      Set<SearchResultRow> rows=selectionModel.getSelectedSet();
      LOG.log(Level.INFO,"String_Node_Str" + rows);
      presenter.onSelectionChange(rows);
    }
  }
);
  table=new SearchResultTable(pageSize,fieldDescs,this.presenter,selectionModel);
  tablePanel.add(table);
  table.load();
}
Program: 14934
Project: 14934
Buggy source:
public void initializeTable(int pageSize,ArrayList<SearchResultFieldDesc> fieldDescs){
  tablePanel.clear();
  final MultiSelectionModel<SearchResultRow> selectionModel=new MultiSelectionModel<SearchResultRow>(SearchResultRow.KEY_PROVIDER);
  selectionModel.addSelectionChangeHandler(new Handler(){
    @Override public void onSelectionChange(    SelectionChangeEvent event){
      Set<SearchResultRow> rows=selectionModel.getSelectedSet();
      LOG.log(Level.INFO,"String_Node_Str" + rows);
      presenter.onSelectionChange(rows);
    }
  }
);
  table=new SearchResultTable(pageSize,fieldDescs,this.presenter,selectionModel);
  tablePanel.add(table);
  table.load();
}

Fixed version (ground truth):
public void initializeTable(int pageSize,ArrayList<SearchResultFieldDesc> fieldDescs){
  tablePanel.clear();
  selectionModel.addSelectionChangeHandler(new Handler(){
    @Override public void onSelectionChange(    SelectionChangeEvent event){
      Set<SearchResultRow> rows=selectionModel.getSelectedSet();
      LOG.log(Level.INFO,"String_Node_Str" + rows);
      presenter.onSelectionChange(rows);
    }
  }
);
  table=new SearchResultTable(pageSize,fieldDescs,this.presenter,selectionModel);
  tablePanel.add(table);
  table.load();
}
Program: 14935
Project: 14935
Buggy source:
public void initializeTable(int pageSize,ArrayList<SearchResultFieldDesc> fieldDescs){
  tablePanel.clear();
  final MultiSelectionModel<SearchResultRow> selectionModel=new MultiSelectionModel<SearchResultRow>(SearchResultRow.KEY_PROVIDER);
  selectionModel.addSelectionChangeHandler(new Handler(){
    @Override public void onSelectionChange(    SelectionChangeEvent event){
      Set<SearchResultRow> rows=selectionModel.getSelectedSet();
      LOG.log(Level.INFO,"String_Node_Str" + rows);
      presenter.onSelectionChange(rows);
    }
  }
);
  table=new SearchResultTable(pageSize,fieldDescs,this.presenter,selectionModel);
  tablePanel.add(table);
  table.load();
}

Fixed version (ground truth):
public void initializeTable(int pageSize,ArrayList<SearchResultFieldDesc> fieldDescs){
  tablePanel.clear();
  selectionModel.addSelectionChangeHandler(new Handler(){
    @Override public void onSelectionChange(    SelectionChangeEvent event){
      Set<SearchResultRow> rows=selectionModel.getSelectedSet();
      LOG.log(Level.INFO,"String_Node_Str" + rows);
      presenter.onSelectionChange(rows);
    }
  }
);
  table=new SearchResultTable(pageSize,fieldDescs,this.presenter,selectionModel);
  tablePanel.add(table);
  table.load();
}
Program: 14936
Project: 14936
Buggy source:
public void initializeTable(int pageSize,ArrayList<SearchResultFieldDesc> fieldDescs){
  tablePanel.clear();
  final SingleSelectionModel<SearchResultRow> selectionModel=new SingleSelectionModel<SearchResultRow>(SearchResultRow.KEY_PROVIDER);
  selectionModel.addSelectionChangeHandler(new Handler(){
    @Override public void onSelectionChange(    SelectionChangeEvent event){
      SearchResultRow row=selectionModel.getSelectedObject();
      LOG.log(Level.INFO,"String_Node_Str" + row);
      presenter.onSelectionChange(row);
    }
  }
);
  table=new SearchResultTable(pageSize,fieldDescs,this.presenter,selectionModel);
  tablePanel.add(table);
  table.load();
}

Fixed version (ground truth):
public void initializeTable(int pageSize,ArrayList<SearchResultFieldDesc> fieldDescs){
  tablePanel.clear();
  selectionModel.addSelectionChangeHandler(new Handler(){
    @Override public void onSelectionChange(    SelectionChangeEvent event){
      SearchResultRow row=selectionModel.getSelectedObject();
      LOG.log(Level.INFO,"String_Node_Str" + row);
      presenter.onSelectionChange(row);
    }
  }
);
  table=new SearchResultTable(pageSize,fieldDescs,this.presenter,selectionModel);
  tablePanel.add(table);
  table.load();
}
Program: 14937
Project: 14937
Buggy source:
public String mapState(){
switch (this.getState()) {
case GENERATING:
    return "String_Node_Str";
case EXTANT:
  return "String_Node_Str";
default :
return "String_Node_Str";
}
}

Fixed version (ground truth):
public String mapState(){
switch (this.getState()) {
case GENERATING:
case NIHIL:
    return "String_Node_Str";
case EXTANT:
  return "String_Node_Str";
default :
return "String_Node_Str";
}
}
Program: 14940
Project: 14940
Buggy source:
VmBootRecord(BootableSet bootSet,byte[] userData,SshKeyPair sshKeyPair,VmType vmType){
  super();
  this.machineImage=(ImageInfo)bootSet.getMachine();
  this.kernel=bootSet.getKernel();
  this.ramdisk=bootSet.getRamdisk();
  this.platform=bootSet.getMachine().getPlatform().name();
  this.userData=userData;
  this.sshKeyPair=KeyPairs.noKey().equals(sshKeyPair) || (sshKeyPair == null) ? null : sshKeyPair;
  this.vmType=vmType;
}

Fixed version (ground truth):
VmBootRecord(BootableSet bootSet,byte[] userData,SshKeyPair sshKeyPair,VmType vmType){
  super();
  this.machineImage=(ImageInfo)bootSet.getMachine();
  if (bootSet.hasKernel())   this.kernel=bootSet.getKernel();
  if (bootSet.hasRamdisk())   this.ramdisk=bootSet.getRamdisk();
  this.platform=bootSet.getMachine().getPlatform().name();
  this.userData=userData;
  this.sshKeyPair=KeyPairs.noKey().equals(sshKeyPair) || (sshKeyPair == null) ? null : sshKeyPair;
  this.vmType=vmType;
}
Program: 14941
Project: 14941
Buggy source:
private boolean checkInterval(){
  return !((lastTime + refreshInterval()) > System.currentTimeMillis());
}

Fixed version (ground truth):
private boolean checkInterval(){
  return (lastTime + refreshInterval()) < System.currentTimeMillis();
}
Program: 14943
Project: 14943
Buggy source:
private String getNetworkTopology(){
  if (checkInterval()) {
    return topoString.get();
  }
 else {
    lock.lock();
    try {
      topoString.set(generateTopology());
      lastTime=System.currentTimeMillis();
      return topoString.get();
    }
  finally {
      lock.unlock();
    }
  }
}

Fixed version (ground truth):
private String getNetworkTopology(){
  return generateTopology();
}
Program: 14944
Project: 14944
Buggy source:
public static ScriptEngine getGroovyEngine(){
synchronized (Groovyness.class) {
    if (groovyEngine == null) {
      GroovySystem.getMetaClassRegistry().setMetaClassCreationHandle(new ExpandoMetaClassCreationHandle());
      ScriptEngineManager manager=new ScriptEngineManager();
      groovyEngine=manager.getEngineByName("String_Node_Str");
    }
    return groovyEngine;
  }
}

Fixed version (ground truth):
private static ScriptEngine getGroovyEngine(){
synchronized (Groovyness.class) {
    if (groovyEngine == null) {
      GroovySystem.getMetaClassRegistry().setMetaClassCreationHandle(new ExpandoMetaClassCreationHandle());
      ScriptEngineManager manager=new ScriptEngineManager(getGroovyClassLoader());
      groovyEngine=manager.getEngineByName("String_Node_Str");
    }
    return groovyEngine;
  }
}
Program: 14945
Project: 14945
Buggy source:
public static <T>T newInstance(String fileName) throws ScriptExecutionFailedException {
  GroovyObject groovyObject=null;
  try {
    ClassLoader parent=ClassLoader.getSystemClassLoader();
    GroovyClassLoader loader=new GroovyClassLoader(parent);
    File f=new File(fileName);
    if (!f.exists()) {
      f=new File(SubDirectory.SCRIPTS + File.separator + fileName+ (fileName.endsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str"));
    }
    Class groovyClass=loader.parseClass(f);
    groovyObject=(GroovyObject)groovyClass.newInstance();
  }
 catch (  Exception e) {
    LOG.error(e,e);
    throw new ScriptExecutionFailedException(e);
  }
  try {
    return (T)groovyObject;
  }
 catch (  ClassCastException e) {
    LOG.debug(e,e);
    throw new ScriptExecutionFailedException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
public static <T>T newInstance(String fileName) throws ScriptExecutionFailedException {
  GroovyObject groovyObject=null;
  try {
    File f=new File(fileName);
    if (!f.exists()) {
      f=new File(SubDirectory.SCRIPTS + File.separator + fileName+ (fileName.endsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str"));
    }
    GroovyClassLoader loader=getGroovyClassLoader();
    Class groovyClass=loader.parseClass(f);
    groovyObject=(GroovyObject)groovyClass.newInstance();
  }
 catch (  Exception e) {
    LOG.error(e,e);
    throw new ScriptExecutionFailedException(e);
  }
  try {
    return (T)groovyObject;
  }
 catch (  ClassCastException e) {
    LOG.debug(e,e);
    throw new ScriptExecutionFailedException(e.getMessage(),e);
  }
}
Program: 14947
Project: 14947
Buggy source:
/** 
 * {@inheritDoc #handleException(Throwable)}
 * @return
 * @throws Throwable
 */
public boolean init() throws Throwable {
  Logs.init();
  Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler(){
    @Override public void uncaughtException(    Thread t,    Throwable e){
      try {
        String stack=Joiner.on("String_Node_Str").join(Thread.currentThread().getStackTrace());
        LOG.error(stack);
        LOG.error(e,e);
      }
 catch (      Exception ex) {
        try {
          System.out.println(Joiner.on("String_Node_Str").join(Thread.currentThread().getStackTrace()));
          e.printStackTrace();
          ex.printStackTrace();
        }
 catch (        Exception ex1) {
          System.out.println("String_Node_Str");
          System.out.println("String_Node_Str" + t.toString());
          System.out.println("String_Node_Str" + e.getClass());
          System.out.println("String_Node_Str" + e.getMessage());
          System.out.println("String_Node_Str");
          for (          Map.Entry<Thread,StackTraceElement[]> ent : Thread.getAllStackTraces().entrySet()) {
          }
        }
      }
    }
  }
);
  BootstrapArgs.init();
  Security.addProvider(new BouncyCastleProvider());
  try {
    if (!BootstrapArgs.isInitializeSystem()) {
      Bootstrap.init();
      Bootstrap.Stage stage=Bootstrap.transition();
      stage.load();
    }
    return true;
  }
 catch (  Throwable t) {
    SystemBootstrapper.handleException(t);
    return false;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc #handleException(Throwable)}
 * @return
 * @throws Throwable
 */
public boolean init() throws Throwable {
  ExpandoMetaClass.enableGlobally();
  Logs.init();
  Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler(){
    @Override public void uncaughtException(    Thread t,    Throwable e){
      try {
        String stack=Joiner.on("String_Node_Str").join(Thread.currentThread().getStackTrace());
        LOG.error(stack);
        LOG.error(e,e);
      }
 catch (      Exception ex) {
        try {
          System.out.println(Joiner.on("String_Node_Str").join(Thread.currentThread().getStackTrace()));
          e.printStackTrace();
          ex.printStackTrace();
        }
 catch (        Exception ex1) {
          System.out.println("String_Node_Str");
          System.out.println("String_Node_Str" + t.toString());
          System.out.println("String_Node_Str" + e.getClass());
          System.out.println("String_Node_Str" + e.getMessage());
          System.out.println("String_Node_Str");
          for (          Map.Entry<Thread,StackTraceElement[]> ent : Thread.getAllStackTraces().entrySet()) {
          }
        }
      }
    }
  }
);
  BootstrapArgs.init();
  Security.addProvider(new BouncyCastleProvider());
  try {
    if (!BootstrapArgs.isInitializeSystem()) {
      Bootstrap.init();
      Bootstrap.Stage stage=Bootstrap.transition();
      stage.load();
    }
    return true;
  }
 catch (  Throwable t) {
    SystemBootstrapper.handleException(t);
    return false;
  }
}
Program: 14948
Project: 14948
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public static <T>List<T> query(final T example){
  final Example qbe=Example.create(example).enableLike(MatchMode.EXACT);
  final List<T> resultList=(List<T>)getTransaction(example).getTxState().getSession().createCriteria(example.getClass()).setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY).setCacheable(true).add(qbe).list();
  return Lists.newArrayList(Sets.newHashSet(resultList));
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public static <T>List<T> query(final T example,boolean readOnly){
  final Example qbe=Example.create(example).enableLike(MatchMode.EXACT);
  final List<T> resultList=(List<T>)getTransaction(example).getTxState().getSession().createCriteria(example.getClass()).setReadOnly(readOnly).setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY).setCacheable(true).add(qbe).list();
  return Lists.newArrayList(Sets.newHashSet(resultList));
}
Program: 14950
Project: 14950
Buggy source:
public static Object eval(String code) throws ScriptExecutionFailedException {
  try {
    return getGroovyEngine().eval(code);
  }
 catch (  Exception e) {
    LOG.debug(e,e);
    throw new ScriptExecutionFailedException("String_Node_Str" + code,e);
  }
}

Fixed version (ground truth):
public static <T>T eval(String code) throws ScriptExecutionFailedException {
  try {
    return (T)getGroovyEngine().eval(code);
  }
 catch (  Exception e) {
    LOG.debug(e,e);
    throw new ScriptExecutionFailedException("String_Node_Str" + code,e);
  }
}
Program: 14952
Project: 14952
Buggy source:
@Override public void assignSystemAddress(final VmInstance vm) throws NotEnoughResourcesException {
  final Address addr=this.allocateSystemAddress(vm.getPartition());
  AsyncRequests.newRequest(addr.assign(vm).getCallback()).then(new Callback.Success<BaseMessage>(){
    public void fire(    BaseMessage response){
      vm.updatePublicAddress(addr.getName());
    }
  }
).dispatch(addr.getPartition());
}

Fixed version (ground truth):
@Override public void assignSystemAddress(final VmInstance vm) throws NotEnoughResourcesException {
  final Address addr=this.allocateSystemAddress(vm.lookupPartition());
  AsyncRequests.newRequest(addr.assign(vm).getCallback()).then(new Callback.Success<BaseMessage>(){
    public void fire(    BaseMessage response){
      vm.updatePublicAddress(addr.getName());
    }
  }
).dispatch(addr.getPartition());
}
Program: 14953
Project: 14953
Buggy source:
public CancelBundleTaskResponseType cancelBundleTask(final CancelBundleTaskType request) throws EucalyptusCloudException {
  final CancelBundleTaskResponseType reply=request.getReply();
  reply.set_return(true);
  final Context ctx=Contexts.lookup();
  try {
    final VmInstance v=VmInstances.lookupByBundleId(request.getBundleId());
    if (RestrictedTypes.checkPrivilege(request,PolicySpec.VENDOR_EC2,PolicySpec.EC2_RESOURCE_INSTANCE,v.getInstanceId(),v.getOwner())) {
      v.getBundleTask().setState("String_Node_Str");
      LOG.info(EventRecord.here(BundleCallback.class,EventType.BUNDLE_CANCELING,ctx.getUserFullName().toString(),v.getBundleTask().getBundleId(),v.getInstanceId()));
      final Cluster cluster=Clusters.getInstance().lookup(v.getPartition());
      request.setInstanceId(v.getInstanceId());
      reply.setTask(v.getBundleTask());
      AsyncRequests.newRequest(new CancelBundleCallback(request)).dispatch(cluster.getConfiguration());
      return reply;
    }
 else {
      throw new EucalyptusCloudException("String_Node_Str" + request.getBundleId());
    }
  }
 catch (  final NoSuchElementException e) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getBundleId());
  }
}

Fixed version (ground truth):
public CancelBundleTaskResponseType cancelBundleTask(final CancelBundleTaskType request) throws EucalyptusCloudException {
  final CancelBundleTaskResponseType reply=request.getReply();
  reply.set_return(true);
  final Context ctx=Contexts.lookup();
  try {
    final VmInstance v=VmInstances.lookupByBundleId(request.getBundleId());
    if (RestrictedTypes.checkPrivilege(request,PolicySpec.VENDOR_EC2,PolicySpec.EC2_RESOURCE_INSTANCE,v.getInstanceId(),v.getOwner())) {
      v.getBundleTask().setState("String_Node_Str");
      LOG.info(EventRecord.here(BundleCallback.class,EventType.BUNDLE_CANCELING,ctx.getUserFullName().toString(),v.getBundleTask().getBundleId(),v.getInstanceId()));
      final Cluster cluster=Clusters.getInstance().lookup(v.lookupPartition());
      request.setInstanceId(v.getInstanceId());
      reply.setTask(v.getBundleTask());
      AsyncRequests.newRequest(new CancelBundleCallback(request)).dispatch(cluster.getConfiguration());
      return reply;
    }
 else {
      throw new EucalyptusCloudException("String_Node_Str" + request.getBundleId());
    }
  }
 catch (  final NoSuchElementException e) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getBundleId());
  }
}
Program: 14954
Project: 14954
Buggy source:
private VmInstance makeVmInstance(ResourceToken token) throws TransactionException, ResourceAllocationException {
  EntityTransaction db=Entities.get(VmInstance.class);
  try {
    Allocation allocInfo=token.getAllocationInfo();
    VmInstance vmInst=new VmInstance(allocInfo.getOwnerFullName(),token.getInstanceId(),token.getInstanceUuid(),allocInfo.getReservationId(),token.getLaunchIndex(),allocInfo.getRequest().getAvailabilityZone(),allocInfo.getUserData(),allocInfo.getBootSet(),allocInfo.getSshKeyPair(),allocInfo.getVmType(),allocInfo.getNetworkGroups(),token.getNetworkIndex());
    token.getNetworkIndex().set(vmInst);
    token.setVmInstance(vmInst);
    db.commit();
    return vmInst;
  }
 catch (  ResourceAllocationException ex) {
    db.rollback();
    Logs.extreme().error(ex,ex);
    throw ex;
  }
catch (  Exception ex) {
    db.rollback();
    Logs.extreme().error(ex,ex);
    throw new TransactionExecutionException(ex);
  }
}

Fixed version (ground truth):
private VmInstance makeVmInstance(ResourceToken token) throws TransactionException, ResourceAllocationException {
  EntityTransaction db=Entities.get(VmInstance.class);
  try {
    Allocation allocInfo=token.getAllocationInfo();
    VmInstance vmInst=new VmInstance(allocInfo.getOwnerFullName(),token.getInstanceId(),token.getInstanceUuid(),allocInfo.getReservationId(),token.getLaunchIndex(),allocInfo.getRequest().getAvailabilityZone(),allocInfo.getUserData(),allocInfo.getBootSet(),allocInfo.getSshKeyPair(),allocInfo.getVmType(),allocInfo.getNetworkGroups(),token.getNetworkIndex());
    vmInst=Entities.persist(vmInst);
    token.getNetworkIndex().set(vmInst);
    db.commit();
    token.setVmInstance(vmInst);
    return vmInst;
  }
 catch (  ResourceAllocationException ex) {
    db.rollback();
    Logs.extreme().error(ex,ex);
    throw ex;
  }
catch (  Exception ex) {
    db.rollback();
    Logs.extreme().error(ex,ex);
    throw new TransactionExecutionException(ex);
  }
}
Program: 14955
Project: 14955
Buggy source:
private void store(){
  try {
    ListenerRegistry.getInstance().fireEvent(new InstanceEvent(this.getInstanceUuid(),this.getDisplayName(),this.vmType.getName(),this.getOwner().getUserId(),this.getOwnerUserName(),this.getOwner().getAccountNumber(),this.getOwnerAccountName(),this.clusterName,this.partitionName,this.networkBytes,this.blockBytes));
  }
 catch (  final EventFailedException ex) {
    LOG.error(ex,ex);
  }
  final EntityTransaction db=Entities.get(VmInstance.class);
  try {
    Entities.merge(this);
    db.commit();
  }
 catch (  final Exception ex) {
    db.rollback();
    LOG.debug(ex);
  }
}

Fixed version (ground truth):
private void store(){
  try {
    ListenerRegistry.getInstance().fireEvent(new InstanceEvent(this.getInstanceUuid(),this.getDisplayName(),this.vmType.getName(),this.getOwner().getUserId(),this.getOwnerUserName(),this.getOwner().getAccountNumber(),this.getOwnerAccountName(),this.clusterName,this.partitionName,this.networkBytes,this.blockBytes));
  }
 catch (  final EventFailedException ex) {
    LOG.error(ex,ex);
  }
  final EntityTransaction db=Entities.get(VmInstance.class);
  if (!Entities.isPersistent(this)) {
    db.rollback();
  }
 else {
    try {
      Entities.merge(this);
      db.commit();
    }
 catch (    final Exception ex) {
      db.rollback();
      LOG.debug(ex);
    }
  }
}
Program: 14956
Project: 14956
Buggy source:
public Allocation allocate(final Allocation allocInfo) throws Exception {
  long quantity=allocInfo.getAllocationTokens().size();
  Context ctx=allocInfo.getContext();
  User requestUser=ctx.getUser();
  UserFullName userFullName=ctx.getUserFullName();
  String action=PolicySpec.requestToAction(allocInfo.getRequest());
  String vmType=allocInfo.getVmType().getName();
  if (!Permissions.canAllocate(PolicySpec.VENDOR_EC2,PolicySpec.EC2_RESOURCE_VMTYPE,vmType,action,requestUser,1L)) {
    throw new EucalyptusCloudException("String_Node_Str" + vmType + "String_Node_Str"+ requestUser.getName());
  }
  if (!Permissions.canAllocate(PolicySpec.VENDOR_EC2,PolicySpec.EC2_RESOURCE_INSTANCE,"String_Node_Str",action,requestUser,quantity)) {
    throw new EucalyptusCloudException("String_Node_Str" + quantity + "String_Node_Str"+ requestUser.getName());
  }
  String reservationId=VmInstances.getId(allocInfo.getReservationIndex(),-1).replaceAll("String_Node_Str","String_Node_Str");
  int vmIndex=0;
  EntityTransaction db=Entities.get(VmInstance.class);
  try {
    for (    ResourceToken token : allocInfo.getAllocationTokens()) {
      VmInstance vmInst=makeVmInstance(token);
    }
    db.commit();
  }
 catch (  ResourceAllocationException ex) {
    db.rollback();
    Logs.extreme().error(ex,ex);
    throw ex;
  }
catch (  Exception ex) {
    db.rollback();
    Logs.extreme().error(ex,ex);
    throw new TransactionExecutionException(ex);
  }
  return allocInfo;
}

Fixed version (ground truth):
public Allocation allocate(final Allocation allocInfo) throws Exception {
  long quantity=allocInfo.getAllocationTokens().size();
  Context ctx=allocInfo.getContext();
  User requestUser=ctx.getUser();
  UserFullName userFullName=ctx.getUserFullName();
  String action=PolicySpec.requestToAction(allocInfo.getRequest());
  String vmType=allocInfo.getVmType().getName();
  if (!Permissions.canAllocate(PolicySpec.VENDOR_EC2,PolicySpec.EC2_RESOURCE_VMTYPE,vmType,action,requestUser,1L)) {
    throw new EucalyptusCloudException("String_Node_Str" + vmType + "String_Node_Str"+ requestUser.getName());
  }
  if (!Permissions.canAllocate(PolicySpec.VENDOR_EC2,PolicySpec.EC2_RESOURCE_INSTANCE,"String_Node_Str",action,requestUser,quantity)) {
    throw new EucalyptusCloudException("String_Node_Str" + quantity + "String_Node_Str"+ requestUser.getName());
  }
  String reservationId=VmInstances.getId(allocInfo.getReservationIndex(),-1).replaceAll("String_Node_Str","String_Node_Str");
  int vmIndex=0;
  for (  ResourceToken token : allocInfo.getAllocationTokens()) {
    VmInstance vmInst=makeVmInstance(token);
  }
  return allocInfo;
}
Program: 14957
Project: 14957
Buggy source:
private VmInstance makeVmInstance(ResourceToken token) throws TransactionException, ResourceAllocationException {
  Allocation allocInfo=token.getAllocationInfo();
  VmInstance vmInst=new VmInstance(allocInfo.getOwnerFullName(),token.getInstanceId(),token.getInstanceUuid(),allocInfo.getReservationId(),token.getLaunchIndex(),allocInfo.getRequest().getAvailabilityZone(),allocInfo.getUserData(),allocInfo.getBootSet(),allocInfo.getSshKeyPair(),allocInfo.getVmType(),allocInfo.getNetworkGroups(),token.getNetworkIndex());
  vmInst=Entities.persist(vmInst);
  token.getNetworkIndex().set(vmInst);
  vmInst=VmInstances.register(vmInst);
  token.setVmInstance(vmInst);
  return vmInst;
}

Fixed version (ground truth):
private VmInstance makeVmInstance(ResourceToken token) throws TransactionException, ResourceAllocationException {
  EntityTransaction db=Entities.get(VmInstance.class);
  try {
    Allocation allocInfo=token.getAllocationInfo();
    VmInstance vmInst=new VmInstance(allocInfo.getOwnerFullName(),token.getInstanceId(),token.getInstanceUuid(),allocInfo.getReservationId(),token.getLaunchIndex(),allocInfo.getRequest().getAvailabilityZone(),allocInfo.getUserData(),allocInfo.getBootSet(),allocInfo.getSshKeyPair(),allocInfo.getVmType(),allocInfo.getNetworkGroups(),token.getNetworkIndex());
    vmInst=Entities.persist(vmInst);
    token.setVmInstance(vmInst);
    db.commit();
    return vmInst;
  }
 catch (  ResourceAllocationException ex) {
    db.rollback();
    Logs.extreme().error(ex,ex);
    throw ex;
  }
catch (  Exception ex) {
    db.rollback();
    Logs.extreme().error(ex,ex);
    throw new TransactionExecutionException(ex);
  }
}
Program: 14958
Project: 14958
Buggy source:
private void updateClusterConfiguration(final DescribeNetworksResponseType reply){
  try {
    Transactions.one(this.getSubject().getConfiguration(),updateCallback(reply));
  }
 catch (  TransactionException ex) {
    LOG.error(ex,ex);
  }
}

Fixed version (ground truth):
private void updateClusterConfiguration(final DescribeNetworksResponseType reply){
  EntityTransaction db=Entities.get(NetworkStateCallback.class);
  try {
    ClusterConfiguration config=Entities.uniqueResult(this.getSubject().getConfiguration());
    config.setNetworkMode(reply.getMode());
    config.setUseNetworkTags(reply.getUseVlans() == 1);
    config.setMinNetworkTag(reply.getVlanMin());
    config.setMaxNetworkTag(reply.getVlanMax());
    config.setAddressesPerNetwork(reply.getAddrsPerNet());
    config.setVnetNetmask(reply.getVnetNetmask());
    config.setVnetSubnet(reply.getVnetSubnet());
    db.commit();
  }
 catch (  Exception ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
    throw ex;
  }
}
Program: 14959
Project: 14959
Buggy source:
@Override public void fire(ClusterConfiguration input){
  input.setNetworkMode(reply.getMode());
  input.setUseNetworkTags(reply.getUseVlans() == 1);
  input.setMinNetworkTag(reply.getVlanMin());
  input.setMaxNetworkTag(reply.getVlanMax());
  input.setAddressesPerNetwork(reply.getAddrsPerNet());
  input.setVnetNetmask(reply.getVnetNetmask());
  input.setVnetSubnet(reply.getVnetSubnet());
}

Fixed version (ground truth):
/** 
 * @see com.eucalyptus.util.async.MessageCallback#fire(edu.ucsb.eucalyptus.msgs.BaseMessage)
 * @param reply
 */
@Override public void fire(final DescribeNetworksResponseType reply){
  NetworkStateCallback.this.updateClusterConfiguration(reply);
  NetworkGroups.updateNetworkRangeConfiguration();
}
Program: 14960
Project: 14960
Buggy source:
protected VmInstance(){
  this.instanceId=null;
  this.launchTime=null;
  this.launchIndex=null;
  this.blockBytes=null;
  this.networkBytes=null;
  this.reservationId=null;
  this.clusterName=null;
  this.partitionName=null;
  this.userData=null;
  this.platform=null;
  this.sshKeyPair=null;
  this.vmType=null;
  this.privateNetwork=null;
  this.vbrString=null;
}

Fixed version (ground truth):
protected VmInstance(){
  this.instanceId=null;
  this.launchTime=null;
  this.launchIndex=null;
  this.blockBytes=null;
  this.networkBytes=null;
  this.reservationId=null;
  this.clusterName=null;
  this.partitionName=null;
  this.userData=null;
  this.platform=null;
  this.sshKeyPair=null;
  this.vmType=null;
  this.privateNetwork=null;
  this.vbrString=null;
  this.imageId=null;
  this.kernelId=null;
  this.ramdiskId=null;
}
Program: 14962
Project: 14962
Buggy source:
public SetReference<PrivateNetworkIndex,VmInstance> allocateNetworkIndex() throws TransactionException {
  EntityTransaction db=Entities.get(ExtantNetwork.class);
  SetReference<PrivateNetworkIndex,VmInstance> ref=null;
  try {
    ExtantNetwork exNet=Entities.merge(this);
    PrivateNetworkIndex netIdx=null;
    for (    Long i : Numbers.shuffled(NetworkGroups.networkIndexInterval())) {
      try {
        Entities.uniqueResult(PrivateNetworkIndex.create(this,i));
        continue;
      }
 catch (      Exception ex) {
        try {
          netIdx=PrivateNetworkIndex.create(exNet,i);
          netIdx=Entities.persist(netIdx);
          exNet.getIndexes().add(netIdx);
          exNet=Entities.merge(exNet);
          break;
        }
 catch (        Exception ex1) {
          continue;
        }
      }
    }
    if (netIdx != null) {
      try {
        ref=netIdx.allocate();
        Entities.merge(this);
        db.commit();
        return ref;
      }
 catch (      Exception ex1) {
        db.rollback();
        throw new TransactionExecutionException("String_Node_Str" + this.displayName);
      }
    }
 else {
      throw new TransactionExecutionException("String_Node_Str" + this.displayName);
    }
  }
 catch (  TransactionException ex) {
    throw ex;
  }
catch (  Exception ex) {
    throw new TransactionExecutionException("String_Node_Str" + this.displayName,ex);
  }
}

Fixed version (ground truth):
public SetReference<PrivateNetworkIndex,VmInstance> allocateNetworkIndex() throws TransactionException {
  if (!NetworkGroups.networkingConfiguration().hasNetworking()) {
    return PrivateNetworkIndex.bogus().allocate();
  }
 else   if (!Entities.isPersistent(this)) {
    throw new TransientEntityException(this.toString());
  }
 else {
    EntityTransaction db=Entities.get(ExtantNetwork.class);
    SetReference<PrivateNetworkIndex,VmInstance> ref=null;
    try {
      PrivateNetworkIndex netIdx=null;
      for (      Long i : Numbers.shuffled(NetworkGroups.networkIndexInterval())) {
        try {
          Entities.uniqueResult(PrivateNetworkIndex.create(this,i));
          continue;
        }
 catch (        Exception ex) {
          try {
            netIdx=PrivateNetworkIndex.create(this,i);
            this.getIndexes().add(netIdx);
            break;
          }
 catch (          Exception ex1) {
            continue;
          }
        }
      }
      if (netIdx != null) {
        return netIdx.allocate();
      }
 else {
        throw new TransactionExecutionException("String_Node_Str" + this.displayName);
      }
    }
 catch (    TransactionException ex) {
      throw ex;
    }
catch (    Exception ex) {
      throw new TransactionExecutionException("String_Node_Str" + this.displayName,ex);
    }
  }
}
Program: 14964
Project: 14964
Buggy source:
public Address allocateSystemAddress(final String partition) throws NotEnoughResourcesException {
  return this.allocateSystemAddresses(Partitions.lookupByName(partition),1).get(0);
}

Fixed version (ground truth):
public Address allocateSystemAddress(final Partition partition) throws NotEnoughResourcesException {
  return this.allocateSystemAddresses(partition,1).get(0);
}
Program: 14965
Project: 14965
Buggy source:
@Override public void assignSystemAddress(final VmInstance vm) throws NotEnoughResourcesException {
  final Address addr=this.allocateSystemAddress(vm.getPartition());
  AsyncRequests.newRequest(addr.assign(vm).getCallback()).then(new Callback.Success<BaseMessage>(){
    @Override public void fire(    final BaseMessage response){
      vm.updatePublicAddress(addr.getName());
    }
  }
).dispatch(addr.getPartition());
}

Fixed version (ground truth):
@Override public void assignSystemAddress(final VmInstance vm) throws NotEnoughResourcesException {
  final Address addr=this.allocateSystemAddress(vm.lookupPartition());
  AsyncRequests.newRequest(addr.assign(vm).getCallback()).then(new Callback.Success<BaseMessage>(){
    @Override public void fire(    final BaseMessage response){
      vm.updatePublicAddress(addr.getName());
    }
  }
).dispatch(addr.getPartition());
}
Program: 14966
Project: 14966
Buggy source:
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(      final AttachedVolume arg0){
        try {
          final ServiceConfiguration sc=Partitions.lookupService(Storage.class,vm.getPartition());
          vm.removeVolumeAttachment(arg0.getVolumeId());
          final Dispatcher scDispatcher=ServiceDispatcher.lookup(sc);
          scDispatcher.send(new DetachStorageVolumeType(cluster.getNode(vm.getServiceTag()).getIqn(),arg0.getVolumeId()));
          return true;
        }
 catch (        final Throwable e) {
          LOG.error("String_Node_Str" + arg0.getVolumeId() + "String_Node_Str"+ e.getMessage(),e);
          return false;
        }
      }
    }
);
  }
 catch (  final 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(      final AttachedVolume arg0){
        try {
          final ServiceConfiguration sc=Partitions.lookupService(Storage.class,vm.lookupPartition());
          vm.removeVolumeAttachment(arg0.getVolumeId());
          final Dispatcher scDispatcher=ServiceDispatcher.lookup(sc);
          scDispatcher.send(new DetachStorageVolumeType(cluster.getNode(vm.getServiceTag()).getIqn(),arg0.getVolumeId()));
          return true;
        }
 catch (        final Throwable e) {
          LOG.error("String_Node_Str" + arg0.getVolumeId() + "String_Node_Str"+ e.getMessage(),e);
          return false;
        }
      }
    }
);
  }
 catch (  final Exception ex) {
    LOG.error("String_Node_Str" + vm.getInstanceId() + "String_Node_Str"+ vm.getPartition()+ "String_Node_Str");
  }
}
Program: 14967
Project: 14967
Buggy source:
public static void cleanUp(final VmInstance vm){
  try {
    final String networkFqName=!vm.getNetworkRulesGroups().isEmpty() ? vm.getOwner().getAccountNumber() + "String_Node_Str" + vm.getNetworkNames().first() : null;
    final Cluster cluster=Clusters.getInstance().lookup(vm.getPartition());
    VmInstances.cleanUpAttachedVolumes(vm);
    Address address=null;
    final Request<TerminateInstancesType,TerminateInstancesResponseType> req=AsyncRequests.newRequest(new TerminateCallback(vm.getInstanceId()));
    if (NetworkGroups.networkingConfiguration().hasNetworking()) {
      try {
        address=Addresses.getInstance().lookup(vm.getPublicAddress());
      }
 catch (      final NoSuchElementException e) {
      }
catch (      final Throwable e1) {
        LOG.debug(e1,e1);
      }
    }
    req.then(VmInstances.getCleanUpCallback(address,vm,networkFqName,cluster));
    req.dispatch(cluster.getConfiguration());
  }
 catch (  final Throwable e) {
    LOG.error(e,e);
  }
}

Fixed version (ground truth):
public static void cleanUp(final VmInstance vm){
  try {
    final String networkFqName=!vm.getNetworkRulesGroups().isEmpty() ? vm.getOwner().getAccountNumber() + "String_Node_Str" + vm.getNetworkNames().first() : null;
    final Cluster cluster=Clusters.getInstance().lookup(vm.lookupPartition());
    VmInstances.cleanUpAttachedVolumes(vm);
    Address address=null;
    final Request<TerminateInstancesType,TerminateInstancesResponseType> req=AsyncRequests.newRequest(new TerminateCallback(vm.getInstanceId()));
    if (NetworkGroups.networkingConfiguration().hasNetworking()) {
      try {
        address=Addresses.getInstance().lookup(vm.getPublicAddress());
      }
 catch (      final NoSuchElementException e) {
      }
catch (      final Throwable e1) {
        LOG.debug(e1,e1);
      }
    }
    req.then(VmInstances.getCleanUpCallback(address,vm,networkFqName,cluster));
    req.dispatch(cluster.getConfiguration());
  }
 catch (  final Throwable e) {
    LOG.error(e,e);
  }
}
Program: 14969
Project: 14969
Buggy source:
protected VmInstance(){
  this.instanceId=null;
  this.launchTime=null;
  this.launchIndex=null;
  this.blockBytes=null;
  this.networkBytes=null;
  this.reservationId=null;
  this.clusterName=null;
  this.partitionName=null;
  this.userData=null;
  this.platform=null;
  this.sshKeyPair=null;
  this.vmType=null;
  this.privateNetwork=null;
  this.bootSet=null;
}

Fixed version (ground truth):
protected VmInstance(){
  this.instanceId=null;
  this.launchTime=null;
  this.launchIndex=null;
  this.blockBytes=null;
  this.networkBytes=null;
  this.reservationId=null;
  this.clusterName=null;
  this.partitionName=null;
  this.userData=null;
  this.platform=null;
  this.sshKeyPair=null;
  this.vmType=null;
  this.privateNetwork=null;
}
Program: 14970
Project: 14970
Buggy source:
public String getImageId(){
  return this.bootSet.getMachine().getDisplayName();
}

Fixed version (ground truth):
public String getImageId(){
  return this.imageId;
}
Program: 14972
Project: 14972
Buggy source:
protected VmInstance(){
  this.instanceId=null;
  this.launchTime=null;
  this.launchIndex=null;
  this.blockBytes=null;
  this.networkBytes=null;
  this.reservationId=null;
  this.clusterName=null;
  this.partitionName=null;
  this.userData=null;
  this.platform=null;
  this.sshKeyPair=null;
  this.vmType=null;
  this.privateNetwork=null;
}

Fixed version (ground truth):
protected VmInstance(){
  this.instanceId=null;
  this.launchTime=null;
  this.launchIndex=null;
  this.blockBytes=null;
  this.networkBytes=null;
  this.reservationId=null;
  this.clusterName=null;
  this.partitionName=null;
  this.userData=null;
  this.platform=null;
  this.sshKeyPair=null;
  this.vmType=null;
  this.privateNetwork=null;
  this.vbrString=null;
}
Program: 14973
Project: 14973
Buggy source:
private void updateClusterConfiguration(final DescribeNetworksResponseType reply){
  EntityTransaction db=Entities.get(NetworkStateCallback.class);
  try {
    ClusterConfiguration config=Entities.uniqueResult(this.getSubject().getConfiguration());
    config.setNetworkMode(reply.getMode());
    config.setUseNetworkTags(reply.getUseVlans() == 1);
    config.setMinNetworkTag(reply.getVlanMin());
    config.setMaxNetworkTag(reply.getVlanMax());
    config.setAddressesPerNetwork(reply.getAddrsPerNet());
    config.setVnetNetmask(reply.getVnetNetmask());
    config.setVnetSubnet(reply.getVnetSubnet());
    db.commit();
  }
 catch (  Exception ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
    throw ex;
  }
}

Fixed version (ground truth):
private void updateClusterConfiguration(final DescribeNetworksResponseType reply){
  EntityTransaction db=Entities.get(NetworkStateCallback.class);
  try {
    ClusterConfiguration config=Entities.uniqueResult(this.getSubject().getConfiguration());
    config.setNetworkMode(reply.getMode());
    config.setUseNetworkTags(reply.getUseVlans() == 1);
    config.setMinNetworkTag(reply.getVlanMin());
    config.setMaxNetworkTag(reply.getVlanMax());
    config.setAddressesPerNetwork(reply.getAddrsPerNet());
    config.setVnetNetmask(reply.getVnetNetmask());
    config.setVnetSubnet(reply.getVnetSubnet());
    db.commit();
  }
 catch (  Exception ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
  }
}
Program: 14974
Project: 14974
Buggy source:
public void getVbrAsString(final BootableSet bootSet,final VmType vmType){
  try {
    BindingManager.getDefaultBinding().toString(bootSet.populateVirtualBootRecord(vmType));
  }
 catch (  MetadataException ex1) {
    LOG.error(ex1,ex1);
  }
}

Fixed version (ground truth):
public String getVbrAsString(final BootableSet bootSet,final VmType vmType){
  try {
    return BindingManager.getDefaultBinding().toString(bootSet.populateVirtualBootRecord(vmType));
  }
 catch (  MetadataException ex1) {
    LOG.error(ex1,ex1);
    return null;
  }
}
Program: 14975
Project: 14975
Buggy source:
private void updateClusterConfiguration(final DescribeNetworksResponseType reply){
  EntityTransaction db=Entities.get(NetworkStateCallback.class);
  try {
    ClusterConfiguration config=Entities.uniqueResult(this.getSubject().getConfiguration());
    config.setNetworkMode(reply.getMode());
    config.setUseNetworkTags(reply.getUseVlans() == 1);
    config.setMinNetworkTag(reply.getVlanMin());
    config.setMaxNetworkTag(reply.getVlanMax());
    config.setAddressesPerNetwork(reply.getAddrsPerNet());
    config.setVnetNetmask(reply.getVnetNetmask());
    config.setVnetSubnet(reply.getVnetSubnet());
    db.commit();
  }
 catch (  Exception ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
  }
}

Fixed version (ground truth):
private void updateClusterConfiguration(final DescribeNetworksResponseType reply){
  EntityTransaction db=Entities.get(ClusterConfiguration.class);
  try {
    ClusterConfiguration config=Entities.uniqueResult(this.getSubject().getConfiguration());
    config.setNetworkMode(reply.getMode());
    config.setUseNetworkTags(reply.getUseVlans() == 1);
    config.setMinNetworkTag(reply.getVlanMin());
    config.setMaxNetworkTag(reply.getVlanMax());
    config.setAddressesPerNetwork(reply.getAddrsPerNet());
    config.setVnetNetmask(reply.getVnetNetmask());
    config.setVnetSubnet(reply.getVnetSubnet());
    db.commit();
  }
 catch (  Exception ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
  }
}
Program: 14976
Project: 14976
Buggy source:
public static void cleanUp(final VmInstance vm){
  try {
    final String networkFqName=!vm.getNetworkRulesGroups().isEmpty() ? vm.getOwner().getAccountNumber() + "String_Node_Str" + vm.getNetworkNames().first() : null;
    final Cluster cluster=Clusters.getInstance().lookup(vm.getClusterName());
    VmInstances.cleanUpAttachedVolumes(vm);
    Address address=null;
    final Request<TerminateInstancesType,TerminateInstancesResponseType> req=AsyncRequests.newRequest(new TerminateCallback(vm.getInstanceId()));
    if (NetworkGroups.networkingConfiguration().hasNetworking()) {
      try {
        address=Addresses.getInstance().lookup(vm.getPublicAddress());
      }
 catch (      final NoSuchElementException e) {
      }
catch (      final Throwable e1) {
        LOG.debug(e1,e1);
      }
    }
    req.then(VmInstances.getCleanUpCallback(address,vm,networkFqName,cluster));
    req.dispatch(cluster.getConfiguration());
  }
 catch (  final Throwable e) {
    LOG.error(e,e);
  }
}

Fixed version (ground truth):
public static void cleanUp(final VmInstance vm){
  try {
    final String networkFqName=!vm.getNetworkRulesGroups().isEmpty() ? vm.getOwner().getAccountNumber() + "String_Node_Str" + vm.getNetworkNames().first() : null;
    final Cluster cluster=Clusters.getInstance().lookup(vm.getPartition());
    VmInstances.cleanUpAttachedVolumes(vm);
    Address address=null;
    final Request<TerminateInstancesType,TerminateInstancesResponseType> req=AsyncRequests.newRequest(new TerminateCallback(vm.getInstanceId()));
    if (NetworkGroups.networkingConfiguration().hasNetworking()) {
      try {
        address=Addresses.getInstance().lookup(vm.getPublicAddress());
      }
 catch (      final NoSuchElementException e) {
      }
catch (      final Throwable e1) {
        LOG.debug(e1,e1);
      }
    }
    req.then(VmInstances.getCleanUpCallback(address,vm,networkFqName,cluster));
    req.dispatch(cluster.getConfiguration());
  }
 catch (  final Throwable e) {
    LOG.error(e,e);
  }
}
Program: 14977
Project: 14977
Buggy source:
@Override public void assignSystemAddress(final VmInstance vm) throws NotEnoughResourcesException {
  final Address addr=this.allocateSystemAddress(vm.getClusterName());
  AsyncRequests.newRequest(addr.assign(vm).getCallback()).then(new Callback.Success<BaseMessage>(){
    public void fire(    BaseMessage response){
      vm.updatePublicAddress(addr.getName());
    }
  }
).dispatch(addr.getPartition());
}

Fixed version (ground truth):
@Override public void assignSystemAddress(final VmInstance vm) throws NotEnoughResourcesException {
  final Address addr=this.allocateSystemAddress(vm.getPartition());
  AsyncRequests.newRequest(addr.assign(vm).getCallback()).then(new Callback.Success<BaseMessage>(){
    public void fire(    BaseMessage response){
      vm.updatePublicAddress(addr.getName());
    }
  }
).dispatch(addr.getPartition());
}
Program: 14978
Project: 14978
Buggy source:
public String getVbrAsString(final BootableSet bootSet,final VmType vmType){
  try {
    return BindingManager.getDefaultBinding().toString(bootSet.populateVirtualBootRecord(vmType));
  }
 catch (  MetadataException ex1) {
    LOG.error(ex1,ex1);
    return null;
  }
}

Fixed version (ground truth):
private String getVbrAsString(final BootableSet bootSet,final VmType vmType){
  try {
    return BindingManager.getDefaultBinding().toString(bootSet.populateVirtualBootRecord(vmType));
  }
 catch (  MetadataException ex1) {
    LOG.error(ex1,ex1);
    return null;
  }
}