nus-yam/ex-repair huggingface dataset:
Program: 14878
Project: 14878
Buggy source:
public MetadataRequest(String requestIp,String requestUrl){
  super();
  try {
    this.requestIp=requestIp;
    String[] path=requestUrl.replaceFirst("String_Node_Str","String_Node_Str").split("String_Node_Str");
    if (path.length > 0) {
      this.metadataName=path[0];
      if (path.length > 1) {
        this.localPath=path[1].replaceFirst("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
      }
 else {
        this.localPath="String_Node_Str";
      }
    }
 else {
      this.metadataName="String_Node_Str";
      this.localPath="String_Node_Str";
    }
    VmInstance findVm=null;
    try {
      try {
        findVm=VmInstances.lookupByPublicIp(requestIp);
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex);
      }
    }
 catch (    Exception ex2) {
      try {
        findVm=VmInstances.lookupByPrivateIp(requestIp);
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex);
      }
    }
    this.vm=findVm;
  }
  finally {
    LOG.debug((this.vm != null ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + this.requestIp+ "String_Node_Str"+ this.metadataName+ "String_Node_Str"+ this.localPath+ "String_Node_Str"+ requestUrl);
  }
}

Fixed version (ground truth):
public MetadataRequest(String requestIp,String requestUrl){
  super();
  try {
    this.requestIp=requestIp;
    String[] path=requestUrl.replaceFirst("String_Node_Str","String_Node_Str").split("String_Node_Str");
    if (path.length > 0) {
      this.metadataName=path[0];
      if (path.length > 1) {
        this.localPath=path[1].replaceFirst("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
      }
 else {
        this.localPath="String_Node_Str";
      }
    }
 else {
      this.metadataName="String_Node_Str";
      this.localPath="String_Node_Str";
    }
    VmInstance findVm=null;
    try {
      findVm=VmInstances.lookupByPublicIp(requestIp);
    }
 catch (    Exception ex2) {
      try {
        findVm=VmInstances.lookupByPrivateIp(requestIp);
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex);
      }
    }
    this.vm=findVm;
  }
  finally {
    LOG.debug((this.vm != null ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + this.requestIp+ "String_Node_Str"+ this.metadataName+ "String_Node_Str"+ this.localPath+ "String_Node_Str"+ requestUrl);
  }
}
Program: 14880
Project: 14880
Buggy source:
private static VmInstance maybeFindVm(final String instanceId,final String publicIp,final String privateIp){
  VmInstance vm=null;
  try {
    vm=VmInstances.lookup(instanceId);
  }
 catch (  NoSuchElementException ex) {
    try {
      vm=VmInstances.lookupByInstanceIp(privateIp);
    }
 catch (    final NoSuchElementException e) {
      Logs.exhaust().error(e);
    }
  }
  if (vm != null) {
    LOG.trace("String_Node_Str" + vm.getInstanceId() + "String_Node_Str"+ vm.getState()+ "String_Node_Str"+ publicIp);
    if (publicIp.equals(vm.getPublicAddress())) {
      LOG.trace("String_Node_Str" + vm.getInstanceId() + "String_Node_Str"+ vm.getState()+ "String_Node_Str"+ publicIp);
    }
  }
  return vm;
}

Fixed version (ground truth):
private static VmInstance maybeFindVm(final String instanceId,final String publicIp,final String privateIp){
  VmInstance vm=null;
  try {
    vm=VmInstances.lookup(instanceId);
  }
 catch (  NoSuchElementException ex) {
    try {
      vm=VmInstances.lookupByPrivateIp(privateIp);
    }
 catch (    final NoSuchElementException e) {
      Logs.exhaust().error(e);
    }
  }
  if (vm != null) {
    LOG.trace("String_Node_Str" + vm.getInstanceId() + "String_Node_Str"+ vm.getState()+ "String_Node_Str"+ publicIp);
    if (publicIp.equals(vm.getPublicAddress())) {
      LOG.trace("String_Node_Str" + vm.getInstanceId() + "String_Node_Str"+ vm.getState()+ "String_Node_Str"+ publicIp);
    }
  }
  return vm;
}
Program: 14881
Project: 14881
Buggy source:
public void clearVmAddress(){
  try {
    VmInstance vm=VmInstances.lookupByInstanceIp(super.getRequest().getDestination());
    if (vm.getPublicAddress().equals(super.getRequest().getSource())) {
      vm.updatePublicAddress(vm.getPrivateAddress());
    }
  }
 catch (  NoSuchElementException e) {
  }
catch (  Exception t) {
    LOG.debug(t,t);
  }
}

Fixed version (ground truth):
public void clearVmAddress(){
  try {
    VmInstance vm=VmInstances.lookupByPrivateIp(super.getRequest().getDestination());
    if (vm.getPublicAddress().equals(super.getRequest().getSource())) {
      vm.updatePublicAddress(vm.getPrivateAddress());
    }
  }
 catch (  NoSuchElementException e) {
  }
catch (  Exception t) {
    LOG.debug(t,t);
  }
}
Program: 14882
Project: 14882
Buggy source:
@Override public void fireException(Throwable e){
  try {
    VmInstance vm=VmInstances.lookupByInstanceIp(super.getRequest().getDestination());
    vm.updatePublicAddress(VmNetworkConfig.DEFAULT_IP);
  }
 catch (  Exception t) {
    LOG.debug(t,t);
  }
 finally {
    if (this.address.isPending()) {
      this.address.clearPending();
    }
  }
  LOG.error(e,e);
  LOG.warn("String_Node_Str" + LogUtil.dumpObject(this.address));
}

Fixed version (ground truth):
@Override public void fireException(Throwable e){
  try {
    VmInstance vm=VmInstances.lookupByPrivateIp(super.getRequest().getDestination());
    vm.updatePublicAddress(VmNetworkConfig.DEFAULT_IP);
  }
 catch (  Exception t) {
    LOG.debug(t,t);
  }
 finally {
    if (this.address.isPending()) {
      this.address.clearPending();
    }
  }
  LOG.error(e,e);
  LOG.warn("String_Node_Str" + LogUtil.dumpObject(this.address));
}
Program: 14883
Project: 14883
Buggy source:
public MetadataRequest(String requestIp,String requestUrl){
  super();
  try {
    this.requestIp=requestIp;
    String[] path=requestUrl.replaceFirst("String_Node_Str","String_Node_Str").split("String_Node_Str");
    if (path.length > 0) {
      this.metadataName=path[0];
      if (path.length > 1) {
        this.localPath=path[1].replaceFirst("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
      }
 else {
        this.localPath="String_Node_Str";
      }
    }
 else {
      this.metadataName="String_Node_Str";
      this.localPath="String_Node_Str";
    }
    VmInstance findVm=null;
    try {
      try {
        findVm=VmInstances.lookupByPublicIp(requestIp);
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex);
      }
    }
 catch (    Exception ex2) {
      try {
        findVm=VmInstances.lookupByInstanceIp(requestIp);
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex);
      }
    }
    this.vm=findVm;
  }
  finally {
    LOG.debug((this.vm != null ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + this.requestIp+ "String_Node_Str"+ this.metadataName+ "String_Node_Str"+ this.localPath+ "String_Node_Str"+ requestUrl);
  }
}

Fixed version (ground truth):
public MetadataRequest(String requestIp,String requestUrl){
  super();
  try {
    this.requestIp=requestIp;
    String[] path=requestUrl.replaceFirst("String_Node_Str","String_Node_Str").split("String_Node_Str");
    if (path.length > 0) {
      this.metadataName=path[0];
      if (path.length > 1) {
        this.localPath=path[1].replaceFirst("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
      }
 else {
        this.localPath="String_Node_Str";
      }
    }
 else {
      this.metadataName="String_Node_Str";
      this.localPath="String_Node_Str";
    }
    VmInstance findVm=null;
    try {
      try {
        findVm=VmInstances.lookupByPublicIp(requestIp);
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex);
      }
    }
 catch (    Exception ex2) {
      try {
        findVm=VmInstances.lookupByPrivateIp(requestIp);
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex);
      }
    }
    this.vm=findVm;
  }
  finally {
    LOG.debug((this.vm != null ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + this.requestIp+ "String_Node_Str"+ this.metadataName+ "String_Node_Str"+ this.localPath+ "String_Node_Str"+ requestUrl);
  }
}
Program: 14884
Project: 14884
Buggy source:
public static VmInstance lookupByPublicIp(final String ip) throws NoSuchElementException {
  EntityTransaction db=Entities.get(VmInstance.class);
  try {
    VmInstance vmExample=VmInstance.create();
    vmExample.setNetworkConfig(VmNetworkConfig.exampleWithPublicIp(ip));
    VmInstance vm=(VmInstance)Entities.createCriteria(VmInstance.class).add(Example.create(vmExample).enableLike(MatchMode.EXACT)).setCacheable(true).setMaxResults(1).setFetchSize(1).setFirstResult(0).uniqueResult();
    db.commit();
    return vm;
  }
 catch (  Exception ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
    throw new NoSuchElementException(ex.getMessage());
  }
}

Fixed version (ground truth):
public static VmInstance lookupByPublicIp(final String ip) throws NoSuchElementException {
  EntityTransaction db=Entities.get(VmInstance.class);
  try {
    VmInstance vmExample=VmInstance.create();
    vmExample.setNetworkConfig(VmNetworkConfig.exampleWithPublicIp(ip));
    VmInstance vm=(VmInstance)Entities.createCriteria(VmInstance.class).add(Example.create(vmExample).enableLike(MatchMode.EXACT)).setCacheable(true).setMaxResults(1).setFetchSize(1).setFirstResult(0).uniqueResult();
    if (vm == null) {
      throw new NoSuchElementException("String_Node_Str" + ip);
    }
    db.commit();
    return vm;
  }
 catch (  Exception ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
    throw new NoSuchElementException(ex.getMessage());
  }
}
Program: 14886
Project: 14886
Buggy source:
public static void handleReportedState(final VmInfo runVm){
  final VmState runVmState=VmState.Mapper.get(runVm.getStateName());
  EntityTransaction db=Entities.get(VmInstance.class);
  try {
    try {
      VmInstance vm=VmInstances.lookup(runVm.getInstanceId());
      try {
        if (VmState.SHUTTING_DOWN.equals(runVmState)) {
          VmStateCallback.handleReportedTeardown(vm,runVm);
        }
 else         if (VmStateSet.RUN.apply(vm)) {
          vm.doUpdate().apply(runVm);
        }
 else {
          return;
        }
      }
 catch (      Exception ex) {
        LOG.error(ex);
      }
    }
 catch (    NoSuchElementException ex1) {
      try {
        if (VmStateSet.RUN.contains(runVmState)) {
          VmInstance.RestoreAllocation.INSTANCE.apply(runVm);
        }
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
      }
    }
catch (    Exception ex1) {
      LOG.error(ex1,ex1);
    }
    db.commit();
  }
 catch (  Exception ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
  }
}

Fixed version (ground truth):
public static void handleReportedState(final VmInfo runVm){
  final VmState runVmState=VmState.Mapper.get(runVm.getStateName());
  EntityTransaction db=Entities.get(VmInstance.class);
  try {
    try {
      VmInstance vm=VmInstances.lookup(runVm.getInstanceId());
      try {
        if (VmState.SHUTTING_DOWN.equals(runVmState)) {
          VmStateCallback.handleReportedTeardown(vm,runVm);
        }
 else         if (VmStateSet.RUN.apply(vm)) {
          vm.doUpdate().apply(runVm);
        }
 else {
          return;
        }
      }
 catch (      Exception ex) {
        LOG.error(ex);
      }
    }
 catch (    TerminatedInstanceException ex1) {
      LOG.trace("String_Node_Str" + runVm.getInstanceId());
    }
catch (    NoSuchElementException ex1) {
      try {
        if (VmStateSet.RUN.contains(runVmState)) {
          VmInstance.RestoreAllocation.INSTANCE.apply(runVm);
        }
      }
 catch (      Exception ex) {
        LOG.error(ex,ex);
      }
    }
catch (    Exception ex1) {
      LOG.error(ex1,ex1);
    }
    db.commit();
  }
 catch (  Exception ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
  }
}
Program: 14887
Project: 14887
Buggy source:
public static void shutDown(final VmInstance vm) throws TransactionException {
  if (VmStateSet.DONE.apply(vm)) {
    if (terminateDescribeCache.containsKey(vm.getDisplayName())) {
      VmInstances.delete(vm);
    }
 else {
      VmInstances.terminated(vm);
    }
  }
 else {
    Transitions.SHUTDOWN.apply(vm);
  }
}

Fixed version (ground truth):
public static void shutDown(final VmInstance vm) throws TransactionException {
  if (!VmStateSet.DONE.apply(vm)) {
    Transitions.SHUTDOWN.apply(vm);
  }
}
Program: 14888
Project: 14888
Buggy source:
public NodeLogInfo getNodeLog(final String nodeIp) throws EucalyptusClusterException {
  final NodeInfo nodeInfo=Iterables.find(this.nodeMap.values(),new Predicate<NodeInfo>(){
    @Override public boolean apply(    final NodeInfo arg0){
      return nodeIp.equals(arg0.getName());
    }
  }
);
  if (nodeInfo == null) {
    throw new EucalyptusClusterException("String_Node_Str" + nodeIp);
  }
  if (this.logUpdate.compareAndSet(false,true)) {
    final Cluster self=this;
    try {
    }
 catch (    final Throwable t) {
      LOG.debug(t,t);
    }
 finally {
      this.logUpdate.set(false);
    }
  }
  return nodeInfo.getLogs();
}

Fixed version (ground truth):
public NodeLogInfo getNodeLog(final String nodeIp){
  final NodeInfo nodeInfo=Iterables.find(this.nodeMap.values(),new Predicate<NodeInfo>(){
    @Override public boolean apply(    final NodeInfo arg0){
      return nodeIp.equals(arg0.getName());
    }
  }
);
  if (nodeInfo == null) {
    throw new NoSuchElementException("String_Node_Str" + nodeIp);
  }
  if (this.logUpdate.compareAndSet(false,true)) {
    final Cluster self=this;
    try {
    }
 catch (    final Throwable t) {
      LOG.debug(t,t);
    }
 finally {
      this.logUpdate.set(false);
    }
  }
  return nodeInfo.getLogs();
}
Program: 14889
Project: 14889
Buggy source:
@Override public void fire(final VmRunResponseType reply){
  Logs.extreme().error(reply);
  EntityTransaction db=Entities.get(VmInstance.class);
  try {
    this.token.redeem();
    for (    final VmInfo vmInfo : reply.getVms()) {
      final VmInstance vm=VmInstances.lookup(vmInfo.getInstanceId());
      vm.updateAddresses(vmInfo.getNetParams().getIpAddress(),vmInfo.getNetParams().getIgnoredPublicIp());
    }
    db.commit();
  }
 catch (  Exception ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
    this.fireException(ex);
  }
}

Fixed version (ground truth):
@Override public void fire(final VmRunResponseType reply){
  if (!reply.get_return()) {
    throw new EucalyptusClusterException("String_Node_Str" + this.getRequest().getInstanceId());
  }
  Logs.extreme().error(reply);
  EntityTransaction db=Entities.get(VmInstance.class);
  try {
    this.token.redeem();
    for (    final VmInfo vmInfo : reply.getVms()) {
      final VmInstance vm=VmInstances.lookup(vmInfo.getInstanceId());
      vm.updateAddresses(vmInfo.getNetParams().getIpAddress(),vmInfo.getNetParams().getIgnoredPublicIp());
    }
    db.commit();
  }
 catch (  Exception ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
    throw new EucalyptusClusterException("String_Node_Str" + this.getRequest().getInstanceId() + "String_Node_Str"+ ex.getMessage(),ex);
  }
}
Program: 14890
Project: 14890
Buggy source:
@Override public void initialize(final VmRunType msg) throws Exception {
  EntityTransaction db=Entities.get(VmInstance.class);
  try {
    final VmInstance vm=VmInstances.lookup(msg.getInstanceId());
    msg.setUserId(vm.getOwnerUserId());
    msg.setOwnerId(vm.getOwnerUserId());
    msg.setAccountId(vm.getOwnerAccountNumber());
    if (!VmState.PENDING.equals(vm.getState())) {
      throw new EucalyptusClusterException("String_Node_Str");
    }
    try {
      this.token.submit();
    }
 catch (    final NoSuchTokenException e2) {
      LOG.debug(e2,e2);
    }
    db.commit();
  }
 catch (  final Exception e) {
    db.rollback();
    LOG.debug(e,e);
    throw e;
  }
}

Fixed version (ground truth):
@Override public void initialize(final VmRunType msg){
  EntityTransaction db=Entities.get(VmInstance.class);
  try {
    final VmInstance vm=VmInstances.lookup(msg.getInstanceId());
    msg.setUserId(vm.getOwnerUserId());
    msg.setOwnerId(vm.getOwnerUserId());
    msg.setAccountId(vm.getOwnerAccountNumber());
    if (!VmState.PENDING.equals(vm.getState())) {
      throw new EucalyptusClusterException("String_Node_Str");
    }
    try {
      this.token.submit();
    }
 catch (    final NoSuchTokenException e2) {
      LOG.debug(e2,e2);
    }
    db.commit();
  }
 catch (  final Exception e) {
    db.rollback();
    LOG.debug(e,e);
    throw new EucalyptusClusterException("String_Node_Str" + this.getRequest(),e);
  }
}
Program: 14892
Project: 14892
Buggy source:
@Override public void fire(R r){
  try {
    if (Logs.isExtrrreeeme()) {
      Logs.exhaust().debug(cb.getClass().getCanonicalName() + "String_Node_Str" + r);
    }
    cb.fire(r);
    AsyncRequest.this.result.set(r);
    try {
      AsyncRequest.this.callbackSequence.fire(r);
    }
 catch (    Exception ex) {
      LOG.error(ex,ex);
      AsyncRequest.this.result.setException(ex);
    }
  }
 catch (  RuntimeException ex) {
    LOG.error(ex,ex);
    AsyncRequest.this.result.setException(ex);
    AsyncRequest.this.callbackSequence.fireException(ex);
  }
catch (  Exception ex) {
    LOG.error(ex,ex);
    AsyncRequest.this.result.setException(ex);
    AsyncRequest.this.callbackSequence.fireException(ex);
  }
}

Fixed version (ground truth):
@Override public void fire(R r){
  try {
    if (Logs.isExtrrreeeme()) {
      Logs.exhaust().debug(cb.getClass().getCanonicalName() + "String_Node_Str" + r);
    }
    cb.fire(r);
    AsyncRequest.this.result.set(r);
    try {
      AsyncRequest.this.callbackSequence.fire(r);
    }
 catch (    Exception ex) {
      LOG.error(ex,ex);
      AsyncRequest.this.result.setException(ex);
    }
  }
 catch (  RuntimeException ex) {
    LOG.error(ex,ex);
    try {
      cb.fireException(ex);
    }
 catch (    Exception ex1) {
      LOG.error(ex1,ex1);
    }
    AsyncRequest.this.result.setException(ex);
    AsyncRequest.this.callbackSequence.fireException(ex);
  }
catch (  Exception ex) {
    LOG.error(ex,ex);
    try {
      cb.fireException(ex);
    }
 catch (    Exception ex1) {
      LOG.error(ex1,ex1);
    }
    AsyncRequest.this.result.setException(ex);
    AsyncRequest.this.callbackSequence.fireException(ex);
  }
}
Program: 14893
Project: 14893
Buggy source:
public Allocation allocate(final Allocation allocInfo) throws Exception {
  final long quantity=allocInfo.getAllocationTokens().size();
  final Context ctx=allocInfo.getContext();
  final User requestUser=ctx.getUser();
  final UserFullName userFullName=ctx.getUserFullName();
  final String action=PolicySpec.requestToAction(allocInfo.getRequest());
  final String vmType=allocInfo.getVmType().getName();
  for (  final ResourceToken token : allocInfo.getAllocationTokens()) {
    try {
      VmInstance vmInst=VmInstance.Create.INSTANCE.apply(token);
      token.setVmInstance(vmInst);
    }
 catch (    Exception ex) {
      LOG.error(ex,ex);
      throw new RuntimeException(ex);
    }
  }
  return allocInfo;
}

Fixed version (ground truth):
public Allocation allocate(final Allocation allocInfo) throws Exception {
  final String vmType=allocInfo.getVmType().getName();
  RestrictedTypes.allocate(vmType,Long.valueOf(allocInfo.getAllocationTokens().size()),allocInfo.getVmType().allocator());
  Function<Long,List<VmInstance>> allocator=new Function<Long,List<VmInstance>>(){
    @Override public List<VmInstance> apply(    Long input){
      List<VmInstance> vms=Lists.newArrayList();
      for (      final ResourceToken token : allocInfo.getAllocationTokens()) {
        try {
          VmInstance vmInst=VmInstance.Create.INSTANCE.apply(token);
          token.setVmInstance(vmInst);
        }
 catch (        Exception ex) {
          LOG.error(ex,ex);
          throw new RuntimeException(ex);
        }
      }
      return vms;
    }
  }
;
  RestrictedTypes.allocate(Long.valueOf(allocInfo.getAllocationTokens().size()),allocator);
  return allocInfo;
}
Program: 14895
Project: 14895
Buggy source:
@Override public void fire(final VmRunResponseType reply){
  if (!reply.get_return()) {
    throw new EucalyptusClusterException("String_Node_Str" + this.getRequest().getInstanceId());
  }
  Logs.extreme().error(reply);
  EntityTransaction db=Entities.get(VmInstance.class);
  try {
    this.token.redeem();
    for (    final VmInfo vmInfo : reply.getVms()) {
      final VmInstance vm=VmInstances.lookup(vmInfo.getInstanceId());
      vm.updateAddresses(vmInfo.getNetParams().getIpAddress(),vmInfo.getNetParams().getIgnoredPublicIp());
    }
    db.commit();
  }
 catch (  Exception ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
    throw new EucalyptusClusterException("String_Node_Str" + this.getRequest().getInstanceId() + "String_Node_Str"+ ex.getMessage(),ex);
  }
}

Fixed version (ground truth):
@Override public void fire(final VmRunResponseType reply){
  if (!reply.get_return()) {
    throw new EucalyptusClusterException("String_Node_Str" + this.getRequest().getInstanceId());
  }
  Logs.extreme().error(reply);
  Predicate<VmRunResponseType> redeemToken=new Predicate<VmRunResponseType>(){
    @Override public boolean apply(    final VmRunResponseType reply){
      EntityTransaction db=Entities.get(VmInstance.class);
      try {
        VmRunCallback.this.token.redeem();
        for (        final VmInfo vmInfo : reply.getVms()) {
          final VmInstance vm=VmInstances.lookup(vmInfo.getInstanceId());
          vm.updateAddresses(vmInfo.getNetParams().getIpAddress(),vmInfo.getNetParams().getIgnoredPublicIp());
        }
        db.commit();
        return true;
      }
 catch (      Exception ex) {
        Logs.exhaust().error(ex,ex);
        db.rollback();
        throw new EucalyptusClusterException("String_Node_Str" + VmRunCallback.this.getRequest().getInstanceId() + "String_Node_Str"+ ex.getMessage(),ex);
      }
    }
  }
;
  try {
    Entities.retry(reply,redeemToken);
  }
 catch (  RuntimeException ex) {
    LOG.error(ex,ex);
    throw ex;
  }
}
Program: 14896
Project: 14896
Buggy source:
public static VmInstance delete(final VmInstance vm) throws TransactionException {
  try {
    if (VmStateSet.DONE.apply(vm)) {
      cache(vm);
      return VmInstance.Transitions.DELETE.apply(vm);
    }
  }
 catch (  final Exception ex) {
    LOG.error(ex,ex);
  }
  return vm;
}

Fixed version (ground truth):
public static VmInstance delete(final VmInstance vm) throws TransactionException {
  try {
    if (VmStateSet.DONE.apply(vm)) {
      cache(vm);
      return Transitions.DELETE.apply(vm);
    }
  }
 catch (  final Exception ex) {
    LOG.error(ex,ex);
  }
  return vm;
}
Program: 14897
Project: 14897
Buggy source:
public static VmInstance terminated(final String key) throws NoSuchElementException {
  return Functions.compose(VmInstance.Transitions.TERMINATED,VmInstance.Lookup.INSTANCE).apply(key);
}

Fixed version (ground truth):
public static VmInstance terminated(final String key) throws NoSuchElementException {
  return Functions.compose(Transitions.TERMINATED,VmInstance.Lookup.INSTANCE).apply(key);
}
Program: 14898
Project: 14898
Buggy source:
public static VmInstance lookup(final String name) throws NoSuchElementException {
  if ((name != null) && terminateCache.containsKey(name)) {
    return terminateCache.get(name);
  }
 else {
    return VmInstance.Lookup.INSTANCE.apply(name);
  }
}

Fixed version (ground truth):
public static VmInstance lookup(final String name) throws NoSuchElementException {
  if ((name != null) && terminateCache.containsKey(name)) {
    return terminateCache.get(name);
  }
 else {
    return Lookup.INSTANCE.apply(name);
  }
}
Program: 14899
Project: 14899
Buggy source:
static VmInstance cache(VmInstance vm){
  if (!terminateCache.containsKey(vm.getDisplayName())) {
    final RunningInstancesItemType ret=VmInstances.transform(vm);
    terminateCache.put(vm.getDisplayName(),vm);
    terminateDescribeCache.put(vm.getDisplayName(),ret);
    return VmInstance.Transitions.DELETE.apply(vm);
  }
 else {
    return terminateCache.get(vm);
  }
}

Fixed version (ground truth):
static VmInstance cache(VmInstance vm){
  if (!terminateCache.containsKey(vm.getDisplayName())) {
    final RunningInstancesItemType ret=VmInstances.transform(vm);
    terminateCache.put(vm.getDisplayName(),vm);
    terminateDescribeCache.put(vm.getDisplayName(),ret);
    return Transitions.DELETE.apply(vm);
  }
 else {
    return terminateCache.get(vm);
  }
}
Program: 14900
Project: 14900
Buggy source:
public static VmInstance shutDown(VmInstance vm) throws TransactionException {
  if (VmStateSet.DONE.apply(vm)) {
    return VmInstances.delete(vm);
  }
 else {
    return VmInstance.Transitions.SHUTDOWN.apply(vm);
  }
}

Fixed version (ground truth):
public static VmInstance shutDown(VmInstance vm) throws TransactionException {
  if (VmStateSet.DONE.apply(vm)) {
    return VmInstances.delete(vm);
  }
 else {
    return Transitions.SHUTDOWN.apply(vm);
  }
}
Program: 14901
Project: 14901
Buggy source:
public static VmInstance register(final VmInstance vm){
  if (!terminateCache.containsKey(vm.getInstanceId())) {
    return VmInstance.Transitions.REGISTER.apply(vm);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
public static VmInstance register(final VmInstance vm){
  if (!terminateCache.containsKey(vm.getInstanceId())) {
    return Transitions.REGISTER.apply(vm);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
}
Program: 14902
Project: 14902
Buggy source:
@Override public String setValue(String s){
  if (Modifier.isFinal(this.field.getModifiers())) {
    return "String_Node_Str" + super.getQualifiedName();
  }
 else   if (Bootstrap.isFinished()) {
    try {
      Object o=super.getTypeParser().apply(s);
      this.fireChange(s);
      StaticDatabasePropertyEntry.update(this.getFieldCanonicalName(),this.getQualifiedName(),s);
      this.field.set(null,o);
      LOG.info("String_Node_Str" + super.getQualifiedName() + "String_Node_Str"+ s);
    }
 catch (    Exception e) {
      LOG.warn("String_Node_Str" + super.getQualifiedName() + "String_Node_Str"+ e.getMessage());
      Logs.extreme().debug(e,e);
    }
    return this.getValue();
  }
 else {
    return super.getDefaultValue();
  }
}

Fixed version (ground truth):
@Override public String setValue(String s){
  if (Modifier.isFinal(this.field.getModifiers())) {
    return "String_Node_Str" + super.getQualifiedName();
  }
 else   if (Bootstrap.isFinished()) {
    try {
      Object o=super.getTypeParser().apply(s);
      this.fireChange(s);
      StaticDatabasePropertyEntry.update(this.getFieldCanonicalName(),this.getQualifiedName(),s);
      this.field.set(null,o);
      Logs.extreme().trace("String_Node_Str" + super.getQualifiedName() + "String_Node_Str"+ s);
    }
 catch (    Exception e) {
      LOG.warn("String_Node_Str" + super.getQualifiedName() + "String_Node_Str"+ e.getMessage());
      Logs.extreme().debug(e,e);
    }
    return this.getValue();
  }
 else {
    return super.getDefaultValue();
  }
}
Program: 14903
Project: 14903
Buggy source:
public CreateSecurityGroupResponseType create(final CreateSecurityGroupType request) throws EucalyptusCloudException, MetadataException {
  final Context ctx=Contexts.lookup();
  final CreateSecurityGroupResponseType reply=(CreateSecurityGroupResponseType)request.getReply();
  try {
    NetworkGroups.create(ctx.getUserFullName(),request.getGroupName(),request.getGroupDescription());
    return reply;
  }
 catch (  Exception ex) {
    throw new EucalyptusCloudException("String_Node_Str" + ex.getMessage(),ex);
  }
}

Fixed version (ground truth):
public CreateSecurityGroupResponseType create(final CreateSecurityGroupType request) throws EucalyptusCloudException, MetadataException {
  final Context ctx=Contexts.lookup();
  final CreateSecurityGroupResponseType reply=(CreateSecurityGroupResponseType)request.getReply();
  try {
    NetworkGroups.create(ctx.getUserFullName(),request.getGroupName(),request.getGroupDescription());
    return reply;
  }
 catch (  final Exception ex) {
    throw new EucalyptusCloudException("String_Node_Str" + ex.getMessage(),ex);
  }
}
Program: 14904
Project: 14904
Buggy source:
public RevokeSecurityGroupIngressResponseType revoke(final RevokeSecurityGroupIngressType request) throws EucalyptusCloudException, MetadataException {
}

Fixed version (ground truth):
public RevokeSecurityGroupIngressResponseType revoke(final RevokeSecurityGroupIngressType request) throws EucalyptusCloudException, MetadataException {
  final Context ctx=Contexts.lookup();
  final RevokeSecurityGroupIngressResponseType reply=(RevokeSecurityGroupIngressResponseType)request.getReply();
  reply.markFailed();
  final List<IpPermissionType> ipPermissions=request.getIpPermissions();
  final List<NetworkRule> ruleList=NetworkGroups.ipPermissionsAsNetworkRules(ipPermissions);
  final Predicate<NetworkRule> filterContainsRule=new Predicate<NetworkRule>(){
    @Override public boolean apply(    final NetworkRule rule){
      for (      final NetworkRule r : ruleList) {
        if (r.equals(rule) && r.getNetworkPeers().equals(rule.getNetworkPeers()) && r.getIpRanges().equals(rule.getIpRanges())) {
          return true;
        }
      }
      return false;
    }
  }
;
  EntityTransaction db=Entities.get(NetworkGroup.class);
  try {
    final NetworkGroup ruleGroup=NetworkGroups.lookup(ctx.getUserFullName().asAccountFullName(),request.getGroupName());
    Predicate<NetworkRule> removeFailedPredicate=new Predicate<NetworkRule>(){
      @Override public boolean apply(      NetworkRule rule){
        return !ruleGroup.getNetworkRules().remove(rule);
      }
    }
;
    if (!RestrictedTypes.filterPrivileged().apply(ruleGroup)) {
      throw new EucalyptusCloudException("String_Node_Str" + request.getGroupName() + "String_Node_Str"+ ctx.getUser());
    }
    final List<NetworkRule> filtered=Lists.newArrayList(Iterables.filter(ruleGroup.getNetworkRules(),filterContainsRule));
    if (filtered.size() == ruleList.size()) {
      reply.set_return(!Iterables.all(filtered,removeFailedPredicate));
    }
 else     if ((ipPermissions.size() == 1) && (ipPermissions.get(0).getIpProtocol() == null)) {
      reply.set_return(!Iterables.all(ruleList,removeFailedPredicate));
    }
    db.commit();
  }
 catch (  Exception ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
    throw new EucalyptusCloudException("String_Node_Str" + ex.getMessage(),ex);
  }
  return reply;
}
Program: 14905
Project: 14905
Buggy source:
public DescribeSecurityGroupsResponseType describe(final DescribeSecurityGroupsType request) throws EucalyptusCloudException, MetadataException {
  final DescribeSecurityGroupsResponseType reply=request.getReply();
  final Context ctx=Contexts.lookup();
  NetworkGroups.createDefault(ctx.getUserFullName());
  final List<String> groupNames=request.getSecurityGroupSet();
  final Predicate<NetworkGroup> argListFilter=new Predicate<NetworkGroup>(){
    @Override public boolean apply(    final NetworkGroup arg0){
      return groupNames.isEmpty() || groupNames.contains(arg0.getName());
    }
  }
;
  Predicate<NetworkGroup> netFilter=Predicates.and(argListFilter,RestrictedTypes.filterPrivileged());
  OwnerFullName ownerFn=AccountFullName.getInstance(ctx.getAccount());
  if (Contexts.lookup().hasAdministrativePrivileges()) {
    ownerFn=null;
    netFilter=argListFilter;
  }
  final EntityTransaction db=Entities.get(NetworkGroup.class);
  try {
    List<NetworkGroup> networks=Entities.query(NetworkGroup.named(ownerFn,null));
    final Iterable<NetworkGroup> matches=Iterables.filter(networks,netFilter);
    final Iterable<SecurityGroupItemType> transformed=Iterables.transform(matches,TypeMappers.lookup(NetworkGroup.class,SecurityGroupItemType.class));
    Iterables.addAll(reply.getSecurityGroupInfo(),transformed);
    db.commit();
  }
 catch (  Exception ex) {
    db.rollback();
  }
  return reply;
}

Fixed version (ground truth):
public DescribeSecurityGroupsResponseType describe(final DescribeSecurityGroupsType request) throws EucalyptusCloudException, MetadataException {
  final DescribeSecurityGroupsResponseType reply=request.getReply();
  final Context ctx=Contexts.lookup();
  NetworkGroups.createDefault(ctx.getUserFullName());
  final List<String> groupNames=request.getSecurityGroupSet();
  final Predicate<NetworkGroup> argListFilter=new Predicate<NetworkGroup>(){
    @Override public boolean apply(    final NetworkGroup arg0){
      return groupNames.isEmpty() || groupNames.contains(arg0.getName());
    }
  }
;
  Predicate<NetworkGroup> netFilter=Predicates.and(argListFilter,RestrictedTypes.filterPrivileged());
  OwnerFullName ownerFn=AccountFullName.getInstance(ctx.getAccount());
  if (Contexts.lookup().hasAdministrativePrivileges()) {
    ownerFn=null;
    netFilter=argListFilter;
  }
  final EntityTransaction db=Entities.get(NetworkGroup.class);
  try {
    final List<NetworkGroup> networks=Entities.query(NetworkGroup.named(ownerFn,null));
    final Iterable<NetworkGroup> matches=Iterables.filter(networks,netFilter);
    final Iterable<SecurityGroupItemType> transformed=Iterables.transform(matches,TypeMappers.lookup(NetworkGroup.class,SecurityGroupItemType.class));
    Iterables.addAll(reply.getSecurityGroupInfo(),transformed);
    db.commit();
  }
 catch (  final Exception ex) {
    db.rollback();
  }
  return reply;
}
Program: 14908
Project: 14908
Buggy source:
public void setValue(String value){
  this.value=value;
}

Fixed version (ground truth):
public void setValue(final String value){
  this.value=value;
}
Program: 14909
Project: 14909
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (!getClass().equals(obj.getClass()))   return false;
  IpRange other=(IpRange)obj;
  if (this.value == null) {
    if (other.value != null)     return false;
  }
 else   if (!this.value.equals(other.value))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(final Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (!this.getClass().equals(obj.getClass()))   return false;
  final IpRange other=(IpRange)obj;
  if (this.value == null) {
    if (other.value != null)     return false;
  }
 else   if (!this.value.equals(other.value))   return false;
  return true;
}
Program: 14910
Project: 14910
Buggy source:
public RevokeSecurityGroupIngressResponseType revoke(final RevokeSecurityGroupIngressType request) throws EucalyptusCloudException, MetadataException {
  final Context ctx=Contexts.lookup();
  final RevokeSecurityGroupIngressResponseType reply=(RevokeSecurityGroupIngressResponseType)request.getReply();
  NetworkGroup ruleGroup=NetworkGroups.lookup(ctx.getUserFullName(),request.getGroupName());
  if (!ctx.hasAdministrativePrivileges() && !RestrictedTypes.filterPrivileged().apply(ruleGroup)) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getGroupName() + "String_Node_Str"+ ctx.getUser());
  }
  final List<NetworkRule> ruleList=Lists.newArrayList();
  for (  final IpPermissionType ipPerm : request.getIpPermissions()) {
    ruleList.addAll(NetworkGroups.IpPermissionTypeAsNetworkRule.INSTANCE.apply(ipPerm));
  }
  final List<NetworkRule> filtered=Lists.newArrayList(Iterables.filter(ruleGroup.getNetworkRules(),new Predicate<NetworkRule>(){
    @Override public boolean apply(    final NetworkRule rule){
      for (      final NetworkRule r : ruleList) {
        if (r.equals(rule) && r.getNetworkPeers().equals(rule.getNetworkPeers()) && r.getIpRanges().equals(rule.getIpRanges())) {
          return true;
        }
      }
      return false;
    }
  }
));
  if (filtered.size() == ruleList.size()) {
    try {
      for (      final NetworkRule r : filtered) {
        ruleGroup.getNetworkRules().remove(r);
      }
      ruleGroup=EntityWrapper.get(NetworkGroup.class).mergeAndCommit(ruleGroup);
    }
 catch (    final Exception ex) {
      Logs.extreme().error(ex,ex);
      throw new EucalyptusCloudException("String_Node_Str" + ex.getMessage(),ex);
    }
    return reply;
  }
 else   if ((request.getIpPermissions().size() == 1) && (request.getIpPermissions().get(0).getIpProtocol() == null)) {
    for (    final NetworkRule rule : ruleList) {
      if (ruleGroup.getNetworkRules().remove(rule)) {
        reply.set_return(true);
      }
    }
    if (reply.get_return()) {
      try {
        ruleGroup=EntityWrapper.get(ruleGroup).mergeAndCommit(ruleGroup);
      }
 catch (      final Exception ex) {
        Logs.extreme().error(ex,ex);
        throw new EucalyptusCloudException("String_Node_Str" + ex.getMessage(),ex);
      }
    }
    return reply;
  }
 else {
    return reply.markFailed();
  }
}

Fixed version (ground truth):
public RevokeSecurityGroupIngressResponseType revoke(final RevokeSecurityGroupIngressType request) throws EucalyptusCloudException, MetadataException {
}
Program: 14911
Project: 14911
Buggy source:
public void setGroupName(String groupName){
  this.groupName=groupName;
}

Fixed version (ground truth):
public void setGroupName(final String groupName){
  this.groupName=groupName;
}
Program: 14912
Project: 14912
Buggy source:
public int hashCode(){
  int result;
  result=otherAccountId.hashCode();
  result=31 * result + groupName.hashCode();
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int result;
  result=this.otherAccountId.hashCode();
  result=31 * result + this.groupName.hashCode();
  return result;
}
Program: 14913
Project: 14913
Buggy source:
public boolean equals(final Object o){
  if (this == o)   return true;
  if (o == null || !getClass().equals(o.getClass()))   return false;
  NetworkPeer that=(NetworkPeer)o;
  if (!groupName.equals(that.groupName))   return false;
  if (!otherAccountId.equals(that.otherAccountId))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(final Object o){
  if (this == o)   return true;
  if ((o == null) || !this.getClass().equals(o.getClass()))   return false;
  final NetworkPeer that=(NetworkPeer)o;
  if (!this.groupName.equals(that.groupName))   return false;
  if (!this.otherAccountId.equals(that.otherAccountId))   return false;
  return true;
}
Program: 14914
Project: 14914
Buggy source:
public List<NetworkRule> getAsNetworkRules(){
  List<NetworkRule> ruleList=new ArrayList<NetworkRule>();
  ruleList.add(new NetworkRule("String_Node_Str",0,65535,new NetworkPeer(this.getUserQueryKey(),this.getGroupName())));
  ruleList.add(new NetworkRule("String_Node_Str",0,65535,new NetworkPeer(this.getUserQueryKey(),this.getGroupName())));
  ruleList.add(new NetworkRule("String_Node_Str",-1,-1,new NetworkPeer(this.getUserQueryKey(),this.getGroupName())));
  return ruleList;
}

Fixed version (ground truth):
public List<NetworkRule> getAsNetworkRules(){
  final List<NetworkRule> ruleList=new ArrayList<NetworkRule>();
  ruleList.add(new NetworkRule("String_Node_Str",0,65535,new NetworkPeer(this.getUserQueryKey(),this.getGroupName())));
  ruleList.add(new NetworkRule("String_Node_Str",0,65535,new NetworkPeer(this.getUserQueryKey(),this.getGroupName())));
  ruleList.add(new NetworkRule("String_Node_Str",-1,-1,new NetworkPeer(this.getUserQueryKey(),this.getGroupName())));
  return ruleList;
}
Program: 14915
Project: 14915
Buggy source:
public void setUserQueryKey(String userQueryKey){
  this.otherAccountId=userQueryKey;
}

Fixed version (ground truth):
public void setUserQueryKey(final String userQueryKey){
  this.otherAccountId=userQueryKey;
}
Program: 14916
Project: 14916
Buggy source:
public void setIpRanges(Set<IpRange> ipRanges){
  this.ipRanges=ipRanges;
}

Fixed version (ground truth):
public void setIpRanges(final Set<IpRange> ipRanges){
  this.ipRanges=ipRanges;
}
Program: 14917
Project: 14917
Buggy source:
public void setProtocol(String protocol){
  this.protocol=protocol;
}

Fixed version (ground truth):
public void setProtocol(final String protocol){
  this.protocol=protocol;
}
Program: 14918
Project: 14918
Buggy source:
public void setLowPort(Integer lowPort){
  this.lowPort=lowPort;
}

Fixed version (ground truth):
public void setLowPort(final Integer lowPort){
  this.lowPort=lowPort;
}
Program: 14919
Project: 14919
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((highPort == null) ? 0 : highPort.hashCode());
  result=prime * result + ((lowPort == null) ? 0 : lowPort.hashCode());
  result=prime * result + ((protocol == null) ? 0 : protocol.hashCode());
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((this.highPort == null) ? 0 : this.highPort.hashCode());
  result=prime * result + ((this.lowPort == null) ? 0 : this.lowPort.hashCode());
  result=prime * result + ((this.protocol == null) ? 0 : this.protocol.hashCode());
  return result;
}
Program: 14920
Project: 14920
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (!getClass().equals(obj.getClass()))   return false;
  NetworkRule other=(NetworkRule)obj;
  if (highPort == null) {
    if (other.highPort != null)     return false;
  }
 else   if (!highPort.equals(other.highPort))   return false;
  if (lowPort == null) {
    if (other.lowPort != null)     return false;
  }
 else   if (!lowPort.equals(other.lowPort))   return false;
  if (protocol == null) {
    if (other.protocol != null)     return false;
  }
 else   if (!protocol.equals(other.protocol))   return false;
  if (ipRanges == null) {
    if (other.ipRanges != null)     return false;
  }
 else   if (!ipRanges.equals(other.ipRanges))   return false;
  if (networkPeers == null) {
    if (other.networkPeers != null)     return false;
  }
 else   if (!networkPeers.equals(other.networkPeers))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(final Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (!this.getClass().equals(obj.getClass()))   return false;
  final NetworkRule other=(NetworkRule)obj;
  if (this.highPort == null) {
    if (other.highPort != null)     return false;
  }
 else   if (!this.highPort.equals(other.highPort))   return false;
  if (this.lowPort == null) {
    if (other.lowPort != null)     return false;
  }
 else   if (!this.lowPort.equals(other.lowPort))   return false;
  if (this.protocol == null) {
    if (other.protocol != null)     return false;
  }
 else   if (!this.protocol.equals(other.protocol))   return false;
  if (this.ipRanges == null) {
    if (other.ipRanges != null)     return false;
  }
 else   if (!this.ipRanges.equals(other.ipRanges))   return false;
  if (this.networkPeers == null) {
    if (other.networkPeers != null)     return false;
  }
 else   if (!this.networkPeers.equals(other.networkPeers))   return false;
  return true;
}
Program: 14921
Project: 14921
Buggy source:
public void setHighPort(Integer highPort){
  this.highPort=highPort;
}

Fixed version (ground truth):
public void setHighPort(final Integer highPort){
  this.highPort=highPort;
}
Program: 14922
Project: 14922
Buggy source:
public void setNetworkPeers(Set<NetworkPeer> networkPeers){
  this.networkPeers=networkPeers;
}

Fixed version (ground truth):
public void setNetworkPeers(final Set<NetworkPeer> networkPeers){
  this.networkPeers=networkPeers;
}
Program: 14923
Project: 14923
Buggy source:
public AccountActivity(AccountPlace place,ClientFactory clientFactory){
  super(place,clientFactory);
}

Fixed version (ground truth):
public AccountActivity(AccountPlace place,ClientFactory clientFactory){
  super(place,clientFactory);
  this.selectionControl=clientFactory.getAccountView();
}
Program: 14924
Project: 14924
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: 14925
Project: 14925
Buggy source:
private void closeSelf(){
  this.controller.hideDetail();
}

Fixed version (ground truth):
private void closeSelf(){
  this.controller.hideDetail();
  this.presenter.onHide();
}
Program: 14926
Project: 14926
Buggy source:
public void onAction(String key){
}

Fixed version (ground truth):
@Override public void onAction(String key){
}
Program: 14927
Project: 14927
Buggy source:
public void onHide(){
  if (selectionControl != null) {
    selectionControl.clearSelection();
  }
}

Fixed version (ground truth):
@Override public void onHide(){
  if (this.view != null && this.view instanceof SelectionController) {
    ((SelectionController)this.view).clearSelection();
  }
}
Program: 14928
Project: 14928
Buggy source:
public AccountActivity(AccountPlace place,ClientFactory clientFactory){
  super(place,clientFactory);
  this.selectionControl=clientFactory.getAccountView();
}

Fixed version (ground truth):
public AccountActivity(AccountPlace place,ClientFactory clientFactory){
  super(place,clientFactory);
}
Program: 14929
Project: 14929
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: 14930
Project: 14930
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();
}