nus-yam/ex-repair huggingface dataset:
Program: 106848
Project: 106848
Buggy source:
private void initPeerScan(Connection conn){
  Date cutTime=DateUtil.currentGMTTime();
  List<ManagementServerHostVO> inactiveList=_mshostDao.getInactiveList(conn,new Date(cutTime.getTime() - heartbeatThreshold));
  if (inactiveList.size() > 0) {
    this.queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeRemoved,inactiveList));
  }
}

Fixed version (ground truth):
private void initPeerScan(){
  Date cutTime=DateUtil.currentGMTTime();
  List<ManagementServerHostVO> inactiveList=_mshostDao.getInactiveList(new Date(cutTime.getTime() - heartbeatThreshold));
  if (inactiveList.size() > 0) {
    this.queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeRemoved,inactiveList));
  }
}
Program: 106849
Project: 106849
Buggy source:
private Runnable getHeartbeatTask(){
  return new Runnable(){
    @Override public void run(){
      try {
        if (s_logger.isTraceEnabled()) {
          s_logger.trace("String_Node_Str" + _mshostId);
        }
        Connection conn=getHeartbeatConnection();
        _mshostDao.update(conn,_mshostId,getCurrentRunId(),DateUtil.currentGMTTime());
        if (s_logger.isTraceEnabled()) {
          s_logger.trace("String_Node_Str" + _mshostId);
        }
        if (!_peerScanInited) {
          _peerScanInited=true;
          initPeerScan(conn);
        }
        peerScan(conn);
      }
 catch (      CloudRuntimeException e) {
        s_logger.error("String_Node_Str",e.getCause());
        if (e.getCause() instanceof ClusterInvalidSessionException) {
          s_logger.error("String_Node_Str");
          queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeIsolated));
        }
        if (isRootCauseConnectionRelated(e.getCause())) {
          s_logger.error("String_Node_Str");
          queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeIsolated));
        }
        invalidHeartbeatConnection();
      }
catch (      Throwable e) {
        if (isRootCauseConnectionRelated(e.getCause())) {
          s_logger.error("String_Node_Str");
          queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeIsolated));
        }
        s_logger.error("String_Node_Str",e);
      }
    }
  }
;
}

Fixed version (ground truth):
private Runnable getHeartbeatTask(){
  return new Runnable(){
    @Override public void run(){
      Transaction txn=Transaction.open("String_Node_Str");
      try {
        txn.transitToUserManagedConnection(getHeartbeatConnection());
        if (s_logger.isTraceEnabled()) {
          s_logger.trace("String_Node_Str" + _mshostId);
        }
        _mshostDao.update(_mshostId,getCurrentRunId(),DateUtil.currentGMTTime());
        if (s_logger.isTraceEnabled()) {
          s_logger.trace("String_Node_Str" + _mshostId);
        }
        if (!_peerScanInited) {
          _peerScanInited=true;
          initPeerScan();
        }
        peerScan();
      }
 catch (      CloudRuntimeException e) {
        s_logger.error("String_Node_Str",e.getCause());
        if (e.getCause() instanceof ClusterInvalidSessionException) {
          s_logger.error("String_Node_Str");
          queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeIsolated));
        }
        if (isRootCauseConnectionRelated(e.getCause())) {
          s_logger.error("String_Node_Str");
          queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeIsolated));
        }
        invalidHeartbeatConnection();
      }
catch (      Throwable e) {
        if (isRootCauseConnectionRelated(e.getCause())) {
          s_logger.error("String_Node_Str");
          queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeIsolated));
        }
        s_logger.error("String_Node_Str",e);
      }
 finally {
        txn.close("String_Node_Str");
      }
    }
  }
;
}
Program: 106852
Project: 106852
Buggy source:
void invalidateRunSession(Connection conn,long id,long runid);

Fixed version (ground truth):
void invalidateRunSession(long id,long runid);
Program: 106853
Project: 106853
Buggy source:
void update(Connection conn,long id,long runId,State state,Date lastUpdate);

Fixed version (ground truth):
void update(long id,long runId,State state,Date lastUpdate);
Program: 106854
Project: 106854
Buggy source:
List<ManagementServerHostVO> getActiveList(Connection conn,Date cutTime);

Fixed version (ground truth):
List<ManagementServerHostVO> getActiveList(Date cutTime);
Program: 106855
Project: 106855
Buggy source:
List<ManagementServerHostVO> getInactiveList(Connection conn,Date cutTime);

Fixed version (ground truth):
List<ManagementServerHostVO> getInactiveList(Date cutTime);
Program: 106856
Project: 106856
Buggy source:
@Override public void invalidateRunSession(Connection conn,long id,long runid){
  PreparedStatement pstmt=null;
  try {
    pstmt=conn.prepareStatement("String_Node_Str");
    pstmt.setLong(1,id);
    pstmt.setLong(2,runid);
    pstmt.executeUpdate();
    conn.commit();
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + pstmt.toString(),e);
  }
 finally {
    if (pstmt != null) {
      try {
        pstmt.close();
      }
 catch (      Exception e) {
        s_logger.warn("String_Node_Str",e);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void invalidateRunSession(long id,long runid){
  Transaction txn=Transaction.currentTxn();
  PreparedStatement pstmt=null;
  try {
    pstmt=txn.prepareAutoCloseStatement("String_Node_Str");
    pstmt.setLong(1,id);
    pstmt.setLong(2,runid);
    pstmt.executeUpdate();
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + pstmt.toString(),e);
  }
}
Program: 106857
Project: 106857
Buggy source:
@Override public void update(Connection conn,long id,long runId,State state,Date lastUpdate){
  PreparedStatement pstmt=null;
  try {
    pstmt=conn.prepareStatement("String_Node_Str");
    pstmt.setString(1,state.toString());
    pstmt.setString(2,DateUtil.getDateDisplayString(TimeZone.getTimeZone("String_Node_Str"),lastUpdate));
    pstmt.setLong(3,id);
    pstmt.setLong(4,runId);
    int count=pstmt.executeUpdate();
    conn.commit();
    if (count < 1) {
      throw new CloudRuntimeException("String_Node_Str",new ClusterInvalidSessionException("String_Node_Str" + runId + "String_Node_Str"));
    }
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + pstmt.toString(),e);
  }
 finally {
    if (pstmt != null) {
      try {
        pstmt.close();
      }
 catch (      Exception e) {
        s_logger.warn("String_Node_Str",e);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void update(long id,long runId,State state,Date lastUpdate){
  Transaction txn=Transaction.currentTxn();
  PreparedStatement pstmt=null;
  try {
    pstmt=txn.prepareAutoCloseStatement("String_Node_Str");
    pstmt.setString(1,state.toString());
    pstmt.setString(2,DateUtil.getDateDisplayString(TimeZone.getTimeZone("String_Node_Str"),lastUpdate));
    pstmt.setLong(3,id);
    pstmt.setLong(4,runId);
    int count=pstmt.executeUpdate();
    if (count < 1) {
      throw new CloudRuntimeException("String_Node_Str",new ClusterInvalidSessionException("String_Node_Str" + runId + "String_Node_Str"));
    }
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + pstmt.toString(),e);
  }
}
Program: 106858
Project: 106858
Buggy source:
@Override @DB public boolean remove(Long id){
  Transaction txn=Transaction.currentTxn();
  try {
    txn.start();
    ManagementServerHostVO msHost=findById(id);
    msHost.setState(ManagementServerHost.State.Down);
    super.remove(id);
    txn.commit();
    return true;
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str",e);
    txn.rollback();
  }
  return false;
}

Fixed version (ground truth):
@Override @DB public boolean remove(Long id){
  Transaction txn=Transaction.currentTxn();
  try {
    txn.start();
    ManagementServerHostVO msHost=findById(id);
    msHost.setState(ManagementServerHost.State.Down);
    super.remove(id);
    txn.commit();
    return true;
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str",e);
  }
  return false;
}
Program: 106860
Project: 106860
Buggy source:
@Override public <K>K getNextInSequence(final Class<K> clazz,final String name){
}

Fixed version (ground truth):
@Override @DB(txn=false) public <K>K getNextInSequence(final Class<K> clazz,final String name){
}
Program: 106861
Project: 106861
Buggy source:
public static Transaction open(final String name,final short databaseId,final boolean forceDbChange){
  Transaction txn=tls.get();
  boolean isNew=false;
  if (txn == null) {
    if (s_logger.isTraceEnabled()) {
      s_logger.trace("String_Node_Str" + name);
    }
    txn=new Transaction(name,false,databaseId);
    tls.set(txn);
    isNew=true;
  }
 else   if (forceDbChange) {
    final short currentDbId=txn.getDatabaseId();
    if (currentDbId != databaseId) {
      txn.close(txn.getName());
      txn=new Transaction(name,false,databaseId);
      tls.set(txn);
      isNew=true;
    }
  }
  txn.takeOver(name,false);
  if (isNew) {
    s_logger.debug("String_Node_Str" + txn.getId());
    s_mbean.addTransaction(txn);
  }
  return txn;
}

Fixed version (ground truth):
public static Transaction open(final String name,final short databaseId,final boolean forceDbChange){
  Transaction txn=tls.get();
  boolean isNew=false;
  if (txn == null) {
    if (s_logger.isTraceEnabled()) {
      s_logger.trace("String_Node_Str" + name);
    }
    txn=new Transaction(name,false,databaseId);
    tls.set(txn);
    isNew=true;
  }
 else   if (forceDbChange) {
    final short currentDbId=txn.getDatabaseId();
    if (currentDbId != databaseId) {
      txn.close(txn.getName());
      txn=new Transaction(name,false,databaseId);
      tls.set(txn);
      isNew=true;
    }
  }
  txn.takeOver(name,false);
  if (isNew) {
    s_mbean.addTransaction(txn);
  }
  return txn;
}
Program: 106863
Project: 106863
Buggy source:
private void initPeerScan(Connection conn){
  Date cutTime=DateUtil.currentGMTTime();
  List<ManagementServerHostVO> inactiveList=_mshostDao.getInactiveList(conn,new Date(cutTime.getTime() - heartbeatThreshold));
  if (inactiveList.size() > 0) {
    this.queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeRemoved,inactiveList));
  }
}

Fixed version (ground truth):
private void initPeerScan(){
  Date cutTime=DateUtil.currentGMTTime();
  List<ManagementServerHostVO> inactiveList=_mshostDao.getInactiveList(new Date(cutTime.getTime() - heartbeatThreshold));
  if (inactiveList.size() > 0) {
    this.queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeRemoved,inactiveList));
  }
}
Program: 106864
Project: 106864
Buggy source:
private Runnable getHeartbeatTask(){
  return new Runnable(){
    @Override public void run(){
      try {
        if (s_logger.isTraceEnabled()) {
          s_logger.trace("String_Node_Str" + _mshostId);
        }
        Connection conn=getHeartbeatConnection();
        _mshostDao.update(conn,_mshostId,getCurrentRunId(),DateUtil.currentGMTTime());
        if (s_logger.isTraceEnabled()) {
          s_logger.trace("String_Node_Str" + _mshostId);
        }
        if (!_peerScanInited) {
          _peerScanInited=true;
          initPeerScan(conn);
        }
        peerScan(conn);
      }
 catch (      CloudRuntimeException e) {
        s_logger.error("String_Node_Str",e.getCause());
        if (e.getCause() instanceof ClusterInvalidSessionException) {
          s_logger.error("String_Node_Str");
          queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeIsolated));
        }
        if (isRootCauseConnectionRelated(e.getCause())) {
          s_logger.error("String_Node_Str");
          queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeIsolated));
        }
        invalidHeartbeatConnection();
      }
catch (      Throwable e) {
        if (isRootCauseConnectionRelated(e.getCause())) {
          s_logger.error("String_Node_Str");
          queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeIsolated));
        }
        s_logger.error("String_Node_Str",e);
      }
    }
  }
;
}

Fixed version (ground truth):
private Runnable getHeartbeatTask(){
  return new Runnable(){
    @Override public void run(){
      Transaction txn=Transaction.open("String_Node_Str");
      try {
        txn.transitToUserManagedConnection(getHeartbeatConnection());
        if (s_logger.isTraceEnabled()) {
          s_logger.trace("String_Node_Str" + _mshostId);
        }
        _mshostDao.update(_mshostId,getCurrentRunId(),DateUtil.currentGMTTime());
        if (s_logger.isTraceEnabled()) {
          s_logger.trace("String_Node_Str" + _mshostId);
        }
        if (!_peerScanInited) {
          _peerScanInited=true;
          initPeerScan();
        }
        peerScan();
      }
 catch (      CloudRuntimeException e) {
        s_logger.error("String_Node_Str",e.getCause());
        if (e.getCause() instanceof ClusterInvalidSessionException) {
          s_logger.error("String_Node_Str");
          queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeIsolated));
        }
        if (isRootCauseConnectionRelated(e.getCause())) {
          s_logger.error("String_Node_Str");
          queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeIsolated));
        }
        invalidHeartbeatConnection();
      }
catch (      Throwable e) {
        if (isRootCauseConnectionRelated(e.getCause())) {
          s_logger.error("String_Node_Str");
          queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeIsolated));
        }
        s_logger.error("String_Node_Str",e);
      }
 finally {
        txn.close("String_Node_Str");
      }
    }
  }
;
}
Program: 106867
Project: 106867
Buggy source:
void invalidateRunSession(Connection conn,long id,long runid);

Fixed version (ground truth):
void invalidateRunSession(long id,long runid);
Program: 106868
Project: 106868
Buggy source:
void update(Connection conn,long id,long runId,State state,Date lastUpdate);

Fixed version (ground truth):
void update(long id,long runId,State state,Date lastUpdate);
Program: 106869
Project: 106869
Buggy source:
List<ManagementServerHostVO> getActiveList(Connection conn,Date cutTime);

Fixed version (ground truth):
List<ManagementServerHostVO> getActiveList(Date cutTime);
Program: 106870
Project: 106870
Buggy source:
List<ManagementServerHostVO> getInactiveList(Connection conn,Date cutTime);

Fixed version (ground truth):
List<ManagementServerHostVO> getInactiveList(Date cutTime);
Program: 106871
Project: 106871
Buggy source:
@Override public void invalidateRunSession(Connection conn,long id,long runid){
  PreparedStatement pstmt=null;
  try {
    pstmt=conn.prepareStatement("String_Node_Str");
    pstmt.setLong(1,id);
    pstmt.setLong(2,runid);
    pstmt.executeUpdate();
    conn.commit();
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + pstmt.toString(),e);
  }
 finally {
    if (pstmt != null) {
      try {
        pstmt.close();
      }
 catch (      Exception e) {
        s_logger.warn("String_Node_Str",e);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void invalidateRunSession(long id,long runid){
  Transaction txn=Transaction.currentTxn();
  PreparedStatement pstmt=null;
  try {
    pstmt=txn.prepareAutoCloseStatement("String_Node_Str");
    pstmt.setLong(1,id);
    pstmt.setLong(2,runid);
    pstmt.executeUpdate();
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + pstmt.toString(),e);
  }
}
Program: 106872
Project: 106872
Buggy source:
@Override public void update(Connection conn,long id,long runId,State state,Date lastUpdate){
  PreparedStatement pstmt=null;
  try {
    pstmt=conn.prepareStatement("String_Node_Str");
    pstmt.setString(1,state.toString());
    pstmt.setString(2,DateUtil.getDateDisplayString(TimeZone.getTimeZone("String_Node_Str"),lastUpdate));
    pstmt.setLong(3,id);
    pstmt.setLong(4,runId);
    int count=pstmt.executeUpdate();
    conn.commit();
    if (count < 1) {
      throw new CloudRuntimeException("String_Node_Str",new ClusterInvalidSessionException("String_Node_Str" + runId + "String_Node_Str"));
    }
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + pstmt.toString(),e);
  }
 finally {
    if (pstmt != null) {
      try {
        pstmt.close();
      }
 catch (      Exception e) {
        s_logger.warn("String_Node_Str",e);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void update(long id,long runId,State state,Date lastUpdate){
  Transaction txn=Transaction.currentTxn();
  PreparedStatement pstmt=null;
  try {
    pstmt=txn.prepareAutoCloseStatement("String_Node_Str");
    pstmt.setString(1,state.toString());
    pstmt.setString(2,DateUtil.getDateDisplayString(TimeZone.getTimeZone("String_Node_Str"),lastUpdate));
    pstmt.setLong(3,id);
    pstmt.setLong(4,runId);
    int count=pstmt.executeUpdate();
    if (count < 1) {
      throw new CloudRuntimeException("String_Node_Str",new ClusterInvalidSessionException("String_Node_Str" + runId + "String_Node_Str"));
    }
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + pstmt.toString(),e);
  }
}
Program: 106873
Project: 106873
Buggy source:
@Override @DB public boolean remove(Long id){
  Transaction txn=Transaction.currentTxn();
  try {
    txn.start();
    ManagementServerHostVO msHost=findById(id);
    msHost.setState(ManagementServerHost.State.Down);
    super.remove(id);
    txn.commit();
    return true;
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str",e);
    txn.rollback();
  }
  return false;
}

Fixed version (ground truth):
@Override @DB public boolean remove(Long id){
  Transaction txn=Transaction.currentTxn();
  try {
    txn.start();
    ManagementServerHostVO msHost=findById(id);
    msHost.setState(ManagementServerHost.State.Down);
    super.remove(id);
    txn.commit();
    return true;
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str",e);
  }
  return false;
}
Program: 106875
Project: 106875
Buggy source:
@Override public <K>K getNextInSequence(final Class<K> clazz,final String name){
}

Fixed version (ground truth):
@Override @DB(txn=false) public <K>K getNextInSequence(final Class<K> clazz,final String name){
}
Program: 106876
Project: 106876
Buggy source:
public static Transaction open(final String name,final short databaseId,final boolean forceDbChange){
  Transaction txn=tls.get();
  boolean isNew=false;
  if (txn == null) {
    if (s_logger.isTraceEnabled()) {
      s_logger.trace("String_Node_Str" + name);
    }
    txn=new Transaction(name,false,databaseId);
    tls.set(txn);
    isNew=true;
  }
 else   if (forceDbChange) {
    final short currentDbId=txn.getDatabaseId();
    if (currentDbId != databaseId) {
      txn.close(txn.getName());
      txn=new Transaction(name,false,databaseId);
      tls.set(txn);
      isNew=true;
    }
  }
  txn.takeOver(name,false);
  if (isNew) {
    s_logger.debug("String_Node_Str" + txn.getId());
    s_mbean.addTransaction(txn);
  }
  return txn;
}

Fixed version (ground truth):
public static Transaction open(final String name,final short databaseId,final boolean forceDbChange){
  Transaction txn=tls.get();
  boolean isNew=false;
  if (txn == null) {
    if (s_logger.isTraceEnabled()) {
      s_logger.trace("String_Node_Str" + name);
    }
    txn=new Transaction(name,false,databaseId);
    tls.set(txn);
    isNew=true;
  }
 else   if (forceDbChange) {
    final short currentDbId=txn.getDatabaseId();
    if (currentDbId != databaseId) {
      txn.close(txn.getName());
      txn=new Transaction(name,false,databaseId);
      tls.set(txn);
      isNew=true;
    }
  }
  txn.takeOver(name,false);
  if (isNew) {
    s_mbean.addTransaction(txn);
  }
  return txn;
}
Program: 106877
Project: 106877
Buggy source:
ListResponse<TemplateResponse> createIsoResponses(VirtualMachineTemplate template,Long zoneId);

Fixed version (ground truth):
List<TemplateResponse> createIsoResponses(long isoId,long zoneId,boolean readyOnly);
Program: 106878
Project: 106878
Buggy source:
@Override public void execute() throws ResourceAllocationException {
  try {
    VirtualMachineTemplate template=_templateService.copyTemplate(this);
    TemplateResponse templateResponse=_responseGenerator.createTemplateResponse(template,destZoneId);
    templateResponse.setResponseName(getCommandName());
    this.setResponseObject(templateResponse);
  }
 catch (  StorageUnavailableException ex) {
    s_logger.warn("String_Node_Str",ex);
    throw new ServerApiException(BaseCmd.RESOURCE_UNAVAILABLE_ERROR,ex.getMessage());
  }
}

Fixed version (ground truth):
@Override public void execute() throws ResourceAllocationException {
  try {
    VirtualMachineTemplate template=_templateService.copyTemplate(this);
    if (template != null) {
      ListResponse<TemplateResponse> response=new ListResponse<TemplateResponse>();
      List<TemplateResponse> templateResponses=_responseGenerator.createTemplateResponses(template.getId(),getDestinationZoneId(),false);
      response.setResponses(templateResponses);
      response.setResponseName(getCommandName());
      this.setResponseObject(response);
    }
 else {
      throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
    }
  }
 catch (  StorageUnavailableException ex) {
    s_logger.warn("String_Node_Str",ex);
    throw new ServerApiException(BaseCmd.RESOURCE_UNAVAILABLE_ERROR,ex.getMessage());
  }
}
Program: 106879
Project: 106879
Buggy source:
@Override public void execute(){
  VirtualMachineTemplate template=_userVmService.createPrivateTemplate(this);
  if (template != null) {
    TemplateResponse response=_responseGenerator.createTemplateResponse(template,snapshotId,volumeId);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
  }
 else {
    throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void execute(){
  VirtualMachineTemplate template=_userVmService.createPrivateTemplate(this);
  if (template != null) {
    ListResponse<TemplateResponse> response=new ListResponse<TemplateResponse>();
    List<TemplateResponse> templateResponses=_responseGenerator.createTemplateResponses(template.getId(),snapshotId,volumeId,false);
    response.setResponses(templateResponses);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
  }
 else {
    throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
  }
}
Program: 106880
Project: 106880
Buggy source:
@Override public void execute(){
  Set<Pair<Long,Long>> isoZonePairSet=_mgr.listIsos(this);
  TemplateFilter isoFilterObj=null;
  try {
    if (isoFilter == null) {
      isoFilterObj=TemplateFilter.selfexecutable;
    }
 else {
      isoFilterObj=TemplateFilter.valueOf(isoFilter);
    }
  }
 catch (  IllegalArgumentException e) {
    isoFilterObj=TemplateFilter.selfexecutable;
  }
  boolean isAdmin=false;
  Account account=UserContext.current().getCaller();
  if ((account == null) || BaseCmd.isAdmin(account.getType())) {
    isAdmin=true;
  }
  ListResponse<TemplateResponse> response=_responseGenerator.createIsoResponse(isoZonePairSet,isAdmin,account,bootable,listInReadyState());
  response.setResponseName(getCommandName());
  this.setResponseObject(response);
}

Fixed version (ground truth):
@Override public void execute(){
  Set<Pair<Long,Long>> isoZonePairSet=_mgr.listIsos(this);
  ListResponse<TemplateResponse> response=new ListResponse<TemplateResponse>();
  List<TemplateResponse> templateResponses=new ArrayList<TemplateResponse>();
  for (  Pair<Long,Long> iso : isoZonePairSet) {
    List<TemplateResponse> responses=new ArrayList<TemplateResponse>();
    responses=_responseGenerator.createIsoResponses(iso.first(),iso.second(),listInReadyState());
    templateResponses.addAll(responses);
  }
  response.setResponses(templateResponses);
  response.setResponseName(getCommandName());
}
Program: 106881
Project: 106881
Buggy source:
public boolean listInReadyState(){
  return true;
}

Fixed version (ground truth):
public boolean listInReadyState(){
  Account account=UserContext.current().getCaller();
  boolean isAccountSpecific=(account == null || isAdmin(account.getType())) && (getAccountName() != null) && (getDomainId() != null);
  TemplateFilter templateFilter=TemplateFilter.valueOf(getIsoFilter());
  boolean onlyReady=(templateFilter == TemplateFilter.featured) || (templateFilter == TemplateFilter.selfexecutable) || (templateFilter == TemplateFilter.sharedexecutable)|| (templateFilter == TemplateFilter.executable && isAccountSpecific)|| (templateFilter == TemplateFilter.community);
  return onlyReady;
}
Program: 106882
Project: 106882
Buggy source:
@Override public void execute(){
  Set<Pair<Long,Long>> templateZonePairSet=_mgr.listTemplates(this);
  boolean isAdmin=false;
  Account account=UserContext.current().getCaller();
  if ((account == null) || BaseCmd.isAdmin(account.getType())) {
    isAdmin=true;
  }
  ListResponse<TemplateResponse> response=new ListResponse<TemplateResponse>();
  List<TemplateResponse> templateResponses=new ArrayList<TemplateResponse>();
  for (  Pair<Long,Long> template : templateZonePairSet) {
    _responseGenerator.createTemplateResponse(templateResponses,template,isAdmin,account,listInReadyState());
  }
  response.setResponses(templateResponses);
  response.setResponseName(getCommandName());
  this.setResponseObject(response);
}

Fixed version (ground truth):
@Override public void execute(){
  Set<Pair<Long,Long>> templateZonePairSet=_mgr.listTemplates(this);
  ListResponse<TemplateResponse> response=new ListResponse<TemplateResponse>();
  List<TemplateResponse> templateResponses=new ArrayList<TemplateResponse>();
  for (  Pair<Long,Long> template : templateZonePairSet) {
    List<TemplateResponse> responses=new ArrayList<TemplateResponse>();
    responses=_responseGenerator.createTemplateResponses(template.first(),template.second(),listInReadyState());
    templateResponses.addAll(responses);
  }
  response.setResponses(templateResponses);
  response.setResponseName(getCommandName());
  this.setResponseObject(response);
}
Program: 106883
Project: 106883
Buggy source:
public boolean listInReadyState(){
  return true;
}

Fixed version (ground truth):
public boolean listInReadyState(){
  Account account=UserContext.current().getCaller();
  boolean isAccountSpecific=(account == null || isAdmin(account.getType())) && (getAccountName() != null) && (getDomainId() != null);
  TemplateFilter templateFilter=TemplateFilter.valueOf(getTemplateFilter());
  boolean onlyReady=(templateFilter == TemplateFilter.featured) || (templateFilter == TemplateFilter.selfexecutable) || (templateFilter == TemplateFilter.sharedexecutable)|| (templateFilter == TemplateFilter.executable && isAccountSpecific)|| (templateFilter == TemplateFilter.community);
  return onlyReady;
}
Program: 106884
Project: 106884
Buggy source:
@Override public void execute() throws ResourceAllocationException {
  VirtualMachineTemplate template=_templateService.registerIso(this);
  if (template != null) {
    ListResponse<TemplateResponse> response=_responseGenerator.createIsoResponses(template,zoneId);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
  }
 else {
    throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void execute() throws ResourceAllocationException {
  VirtualMachineTemplate template=_templateService.registerIso(this);
  if (template != null) {
    ListResponse<TemplateResponse> response=new ListResponse<TemplateResponse>();
    List<TemplateResponse> templateResponses=_responseGenerator.createIsoResponses(template.getId(),zoneId,false);
    response.setResponses(templateResponses);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
  }
 else {
    throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
  }
}
Program: 106885
Project: 106885
Buggy source:
@Override public void execute() throws ResourceAllocationException {
  try {
    VirtualMachineTemplate template=_templateService.registerTemplate(this);
    if (template != null) {
      ListResponse<TemplateResponse> response=_responseGenerator.createTemplateResponse2(template,zoneId);
      response.setResponseName(getCommandName());
      this.setResponseObject(response);
    }
 else {
      throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
    }
  }
 catch (  URISyntaxException ex1) {
    s_logger.info(ex1);
    throw new ServerApiException(BaseCmd.PARAM_ERROR,ex1.getMessage());
  }
}

Fixed version (ground truth):
@Override public void execute() throws ResourceAllocationException {
  try {
    VirtualMachineTemplate template=_templateService.registerTemplate(this);
    if (template != null) {
      ListResponse<TemplateResponse> response=new ListResponse<TemplateResponse>();
      List<TemplateResponse> templateResponses=_responseGenerator.createTemplateResponses(template.getId(),zoneId,false);
      response.setResponses(templateResponses);
      response.setResponseName(getCommandName());
      this.setResponseObject(response);
    }
 else {
      throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
    }
  }
 catch (  URISyntaxException ex1) {
    s_logger.info(ex1);
    throw new ServerApiException(BaseCmd.PARAM_ERROR,ex1.getMessage());
  }
}
Program: 106886
Project: 106886
Buggy source:
public static VMTemplateHostVO findTemplateHostRef(long templateId,long zoneId){
  VMTemplateVO vmTemplate=findTemplateById(templateId);
  if (vmTemplate.getHypervisorType() == HypervisorType.BareMetal) {
    return _templateHostDao.listByTemplateId(templateId).get(0);
  }
 else {
    return _storageMgr.getTemplateHostRef(zoneId,templateId);
  }
}

Fixed version (ground truth):
public static VMTemplateHostVO findTemplateHostRef(long templateId,long zoneId,boolean readyOnly){
  VMTemplateVO vmTemplate=findTemplateById(templateId);
  if (vmTemplate.getHypervisorType() == HypervisorType.BareMetal) {
    return _templateHostDao.listByTemplateId(templateId).get(0);
  }
 else {
    return _storageMgr.getTemplateHostRef(zoneId,templateId,readyOnly);
  }
}
Program: 106887
Project: 106887
Buggy source:
ListResponse<TemplateResponse> createIsoResponses(VirtualMachineTemplate template,Long zoneId);

Fixed version (ground truth):
List<TemplateResponse> createIsoResponses(long isoId,long zoneId,boolean readyOnly);
Program: 106888
Project: 106888
Buggy source:
@Override public void execute() throws ResourceAllocationException {
  try {
    VirtualMachineTemplate template=_templateService.copyTemplate(this);
    TemplateResponse templateResponse=_responseGenerator.createTemplateResponse(template,destZoneId);
    templateResponse.setResponseName(getCommandName());
    this.setResponseObject(templateResponse);
  }
 catch (  StorageUnavailableException ex) {
    s_logger.warn("String_Node_Str",ex);
    throw new ServerApiException(BaseCmd.RESOURCE_UNAVAILABLE_ERROR,ex.getMessage());
  }
}

Fixed version (ground truth):
@Override public void execute() throws ResourceAllocationException {
  try {
    VirtualMachineTemplate template=_templateService.copyTemplate(this);
    if (template != null) {
      ListResponse<TemplateResponse> response=new ListResponse<TemplateResponse>();
      List<TemplateResponse> templateResponses=_responseGenerator.createTemplateResponses(template.getId(),getDestinationZoneId(),false);
      response.setResponses(templateResponses);
      response.setResponseName(getCommandName());
      this.setResponseObject(response);
    }
 else {
      throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
    }
  }
 catch (  StorageUnavailableException ex) {
    s_logger.warn("String_Node_Str",ex);
    throw new ServerApiException(BaseCmd.RESOURCE_UNAVAILABLE_ERROR,ex.getMessage());
  }
}
Program: 106889
Project: 106889
Buggy source:
@Override public void execute(){
  VirtualMachineTemplate template=_userVmService.createPrivateTemplate(this);
  if (template != null) {
    TemplateResponse response=_responseGenerator.createTemplateResponse(template,snapshotId,volumeId);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
  }
 else {
    throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void execute(){
  VirtualMachineTemplate template=_userVmService.createPrivateTemplate(this);
  if (template != null) {
    ListResponse<TemplateResponse> response=new ListResponse<TemplateResponse>();
    List<TemplateResponse> templateResponses=_responseGenerator.createTemplateResponses(template.getId(),snapshotId,volumeId,false);
    response.setResponses(templateResponses);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
  }
 else {
    throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
  }
}
Program: 106890
Project: 106890
Buggy source:
@Override public void execute(){
  Set<Pair<Long,Long>> isoZonePairSet=_mgr.listIsos(this);
  TemplateFilter isoFilterObj=null;
  try {
    if (isoFilter == null) {
      isoFilterObj=TemplateFilter.selfexecutable;
    }
 else {
      isoFilterObj=TemplateFilter.valueOf(isoFilter);
    }
  }
 catch (  IllegalArgumentException e) {
    isoFilterObj=TemplateFilter.selfexecutable;
  }
  boolean isAdmin=false;
  Account account=UserContext.current().getCaller();
  if ((account == null) || BaseCmd.isAdmin(account.getType())) {
    isAdmin=true;
  }
  ListResponse<TemplateResponse> response=_responseGenerator.createIsoResponse(isoZonePairSet,isAdmin,account,bootable,listInReadyState());
  response.setResponseName(getCommandName());
  this.setResponseObject(response);
}

Fixed version (ground truth):
@Override public void execute(){
  Set<Pair<Long,Long>> isoZonePairSet=_mgr.listIsos(this);
  ListResponse<TemplateResponse> response=new ListResponse<TemplateResponse>();
  List<TemplateResponse> templateResponses=new ArrayList<TemplateResponse>();
  for (  Pair<Long,Long> iso : isoZonePairSet) {
    List<TemplateResponse> responses=new ArrayList<TemplateResponse>();
    responses=_responseGenerator.createIsoResponses(iso.first(),iso.second(),listInReadyState());
    templateResponses.addAll(responses);
  }
  response.setResponses(templateResponses);
  response.setResponseName(getCommandName());
}
Program: 106891
Project: 106891
Buggy source:
public boolean listInReadyState(){
  return true;
}

Fixed version (ground truth):
public boolean listInReadyState(){
  Account account=UserContext.current().getCaller();
  boolean isAccountSpecific=(account == null || isAdmin(account.getType())) && (getAccountName() != null) && (getDomainId() != null);
  TemplateFilter templateFilter=TemplateFilter.valueOf(getIsoFilter());
  boolean onlyReady=(templateFilter == TemplateFilter.featured) || (templateFilter == TemplateFilter.selfexecutable) || (templateFilter == TemplateFilter.sharedexecutable)|| (templateFilter == TemplateFilter.executable && isAccountSpecific)|| (templateFilter == TemplateFilter.community);
  return onlyReady;
}
Program: 106892
Project: 106892
Buggy source:
@Override public void execute(){
  Set<Pair<Long,Long>> templateZonePairSet=_mgr.listTemplates(this);
  boolean isAdmin=false;
  Account account=UserContext.current().getCaller();
  if ((account == null) || BaseCmd.isAdmin(account.getType())) {
    isAdmin=true;
  }
  ListResponse<TemplateResponse> response=new ListResponse<TemplateResponse>();
  List<TemplateResponse> templateResponses=new ArrayList<TemplateResponse>();
  for (  Pair<Long,Long> template : templateZonePairSet) {
    _responseGenerator.createTemplateResponse(templateResponses,template,isAdmin,account,listInReadyState());
  }
  response.setResponses(templateResponses);
  response.setResponseName(getCommandName());
  this.setResponseObject(response);
}

Fixed version (ground truth):
@Override public void execute(){
  Set<Pair<Long,Long>> templateZonePairSet=_mgr.listTemplates(this);
  ListResponse<TemplateResponse> response=new ListResponse<TemplateResponse>();
  List<TemplateResponse> templateResponses=new ArrayList<TemplateResponse>();
  for (  Pair<Long,Long> template : templateZonePairSet) {
    List<TemplateResponse> responses=new ArrayList<TemplateResponse>();
    responses=_responseGenerator.createTemplateResponses(template.first(),template.second(),listInReadyState());
    templateResponses.addAll(responses);
  }
  response.setResponses(templateResponses);
  response.setResponseName(getCommandName());
  this.setResponseObject(response);
}
Program: 106893
Project: 106893
Buggy source:
public boolean listInReadyState(){
  return true;
}

Fixed version (ground truth):
public boolean listInReadyState(){
  Account account=UserContext.current().getCaller();
  boolean isAccountSpecific=(account == null || isAdmin(account.getType())) && (getAccountName() != null) && (getDomainId() != null);
  TemplateFilter templateFilter=TemplateFilter.valueOf(getTemplateFilter());
  boolean onlyReady=(templateFilter == TemplateFilter.featured) || (templateFilter == TemplateFilter.selfexecutable) || (templateFilter == TemplateFilter.sharedexecutable)|| (templateFilter == TemplateFilter.executable && isAccountSpecific)|| (templateFilter == TemplateFilter.community);
  return onlyReady;
}
Program: 106894
Project: 106894
Buggy source:
@Override public void execute() throws ResourceAllocationException {
  VirtualMachineTemplate template=_templateService.registerIso(this);
  if (template != null) {
    ListResponse<TemplateResponse> response=_responseGenerator.createIsoResponses(template,zoneId);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
  }
 else {
    throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void execute() throws ResourceAllocationException {
  VirtualMachineTemplate template=_templateService.registerIso(this);
  if (template != null) {
    ListResponse<TemplateResponse> response=new ListResponse<TemplateResponse>();
    List<TemplateResponse> templateResponses=_responseGenerator.createIsoResponses(template.getId(),zoneId,false);
    response.setResponses(templateResponses);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
  }
 else {
    throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
  }
}
Program: 106895
Project: 106895
Buggy source:
@Override public void execute() throws ResourceAllocationException {
  try {
    VirtualMachineTemplate template=_templateService.registerTemplate(this);
    if (template != null) {
      ListResponse<TemplateResponse> response=_responseGenerator.createTemplateResponse2(template,zoneId);
      response.setResponseName(getCommandName());
      this.setResponseObject(response);
    }
 else {
      throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
    }
  }
 catch (  URISyntaxException ex1) {
    s_logger.info(ex1);
    throw new ServerApiException(BaseCmd.PARAM_ERROR,ex1.getMessage());
  }
}

Fixed version (ground truth):
@Override public void execute() throws ResourceAllocationException {
  try {
    VirtualMachineTemplate template=_templateService.registerTemplate(this);
    if (template != null) {
      ListResponse<TemplateResponse> response=new ListResponse<TemplateResponse>();
      List<TemplateResponse> templateResponses=_responseGenerator.createTemplateResponses(template.getId(),zoneId,false);
      response.setResponses(templateResponses);
      response.setResponseName(getCommandName());
      this.setResponseObject(response);
    }
 else {
      throw new ServerApiException(BaseCmd.INTERNAL_ERROR,"String_Node_Str");
    }
  }
 catch (  URISyntaxException ex1) {
    s_logger.info(ex1);
    throw new ServerApiException(BaseCmd.PARAM_ERROR,ex1.getMessage());
  }
}
Program: 106896
Project: 106896
Buggy source:
public static VMTemplateHostVO findTemplateHostRef(long templateId,long zoneId){
  VMTemplateVO vmTemplate=findTemplateById(templateId);
  if (vmTemplate.getHypervisorType() == HypervisorType.BareMetal) {
    return _templateHostDao.listByTemplateId(templateId).get(0);
  }
 else {
    return _storageMgr.getTemplateHostRef(zoneId,templateId);
  }
}

Fixed version (ground truth):
public static VMTemplateHostVO findTemplateHostRef(long templateId,long zoneId,boolean readyOnly){
  VMTemplateVO vmTemplate=findTemplateById(templateId);
  if (vmTemplate.getHypervisorType() == HypervisorType.BareMetal) {
    return _templateHostDao.listByTemplateId(templateId).get(0);
  }
 else {
    return _storageMgr.getTemplateHostRef(zoneId,templateId,readyOnly);
  }
}
Program: 106899
Project: 106899
Buggy source:
@Override public String[] getUpgradableVersionRange(){
  return new String[]{"String_Node_Str"};
}

Fixed version (ground truth):
@Override public String[] getUpgradableVersionRange(){
  return new String[]{"String_Node_Str","String_Node_Str"};
}
Program: 106901
Project: 106901
Buggy source:
@Override public List<HostVO> findDirectAgentToLoad(long lastPingSecondsAfter,Long limit){
  SearchCriteria<HostVO> sc=UnmanagedDirectConnectSearch.create();
  sc.setParameters("String_Node_Str",lastPingSecondsAfter);
  return search(sc,new Filter(HostVO.class,"String_Node_Str",true,0L,limit));
}

Fixed version (ground truth):
@Override public List<HostVO> findDirectAgentToLoad(long lastPingSecondsAfter,Long limit){
  SearchCriteria<HostVO> sc=UnmanagedDirectConnectSearch.create();
  sc.setParameters("String_Node_Str",lastPingSecondsAfter);
  sc.setParameters("String_Node_Str",Status.ErrorInMaintenance,Status.Maintenance,Status.PrepareForMaintenance);
  return search(sc,new Filter(HostVO.class,"String_Node_Str",true,0L,limit));
}
Program: 106902
Project: 106902
Buggy source:
@Override public void markHostsAsDisconnected(long msId){
  SearchCriteria<HostVO> sc=MsStatusSearch.create();
  sc.setParameters("String_Node_Str",msId);
  HostVO host=createForUpdate();
  host.setManagementServerId(null);
  host.setLastPinged((System.currentTimeMillis() >> 10) - (10 * 60));
  host.setDisconnectedOn(new Date());
  UpdateBuilder ub=getUpdateBuilder(host);
  ub.set(host,"String_Node_Str",Status.Disconnected);
  update(ub,sc,null);
}

Fixed version (ground truth):
@Override public void markHostsAsDisconnected(long msId){
  SearchCriteria<HostVO> sc=MsStatusSearch.create();
  sc.setParameters("String_Node_Str",msId);
  sc.setParameters("String_Node_Str",Status.ErrorInMaintenance,Status.Maintenance,Status.PrepareForMaintenance);
  HostVO host=createForUpdate();
  host.setLastPinged((System.currentTimeMillis() >> 10) - (10 * 60));
  host.setDisconnectedOn(new Date());
  UpdateBuilder ub=getUpdateBuilder(host);
  ub.set(host,"String_Node_Str",Status.Disconnected);
  update(ub,sc,null);
  sc=MsStatusSearch.create();
  sc.setParameters("String_Node_Str",msId);
  host=createForUpdate();
  host.setManagementServerId(null);
  host.setLastPinged((System.currentTimeMillis() >> 10) - (10 * 60));
  host.setDisconnectedOn(new Date());
  ub=getUpdateBuilder(host);
  update(ub,sc,null);
}
Program: 106903
Project: 106903
Buggy source:
@Override public String[] getUpgradableVersionRange(){
  return new String[]{"String_Node_Str"};
}

Fixed version (ground truth):
@Override public String[] getUpgradableVersionRange(){
  return new String[]{"String_Node_Str","String_Node_Str"};
}
Program: 106905
Project: 106905
Buggy source:
@Override public List<HostVO> findDirectAgentToLoad(long lastPingSecondsAfter,Long limit){
  SearchCriteria<HostVO> sc=UnmanagedDirectConnectSearch.create();
  sc.setParameters("String_Node_Str",lastPingSecondsAfter);
  return search(sc,new Filter(HostVO.class,"String_Node_Str",true,0L,limit));
}

Fixed version (ground truth):
@Override public List<HostVO> findDirectAgentToLoad(long lastPingSecondsAfter,Long limit){
  SearchCriteria<HostVO> sc=UnmanagedDirectConnectSearch.create();
  sc.setParameters("String_Node_Str",lastPingSecondsAfter);
  sc.setParameters("String_Node_Str",Status.ErrorInMaintenance,Status.Maintenance,Status.PrepareForMaintenance);
  return search(sc,new Filter(HostVO.class,"String_Node_Str",true,0L,limit));
}
Program: 106906
Project: 106906
Buggy source:
@Override public void markHostsAsDisconnected(long msId){
  SearchCriteria<HostVO> sc=MsStatusSearch.create();
  sc.setParameters("String_Node_Str",msId);
  HostVO host=createForUpdate();
  host.setManagementServerId(null);
  host.setLastPinged((System.currentTimeMillis() >> 10) - (10 * 60));
  host.setDisconnectedOn(new Date());
  UpdateBuilder ub=getUpdateBuilder(host);
  ub.set(host,"String_Node_Str",Status.Disconnected);
  update(ub,sc,null);
}

Fixed version (ground truth):
@Override public void markHostsAsDisconnected(long msId){
  SearchCriteria<HostVO> sc=MsStatusSearch.create();
  sc.setParameters("String_Node_Str",msId);
  sc.setParameters("String_Node_Str",Status.ErrorInMaintenance,Status.Maintenance,Status.PrepareForMaintenance);
  HostVO host=createForUpdate();
  host.setLastPinged((System.currentTimeMillis() >> 10) - (10 * 60));
  host.setDisconnectedOn(new Date());
  UpdateBuilder ub=getUpdateBuilder(host);
  ub.set(host,"String_Node_Str",Status.Disconnected);
  update(ub,sc,null);
  sc=MsStatusSearch.create();
  sc.setParameters("String_Node_Str",msId);
  host=createForUpdate();
  host.setManagementServerId(null);
  host.setLastPinged((System.currentTimeMillis() >> 10) - (10 * 60));
  host.setDisconnectedOn(new Date());
  ub=getUpdateBuilder(host);
  update(ub,sc,null);
}
Program: 106910
Project: 106910
Buggy source:
protected static String buildName(){
  if (s_logger.isDebugEnabled()) {
    final StackTraceElement[] stacks=Thread.currentThread().getStackTrace();
    final StringBuilder str=new StringBuilder();
    int i=3, j=3;
    while (j < 7 && j < stacks.length) {
      StackTraceElement element=stacks[i];
      String filename=element.getFileName();
      String method=element.getMethodName();
      if ((filename != null && filename.equals("String_Node_Str")) || (method != null && method.equals("String_Node_Str"))) {
        i++;
        continue;
      }
      str.append("String_Node_Str").append(stacks[i].getClassName().substring(stacks[i].getClassName().lastIndexOf("String_Node_Str") + 1)).append("String_Node_Str").append(stacks[i].getMethodName()).append("String_Node_Str").append(stacks[i].getLineNumber());
      j++;
      i++;
    }
    return str.toString();
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
protected static String buildName(){
  if (s_logger.isDebugEnabled()) {
    final StackTraceElement[] stacks=Thread.currentThread().getStackTrace();
    final StringBuilder str=new StringBuilder();
    int i=3, j=3;
    while (j < 7 && i < stacks.length) {
      StackTraceElement element=stacks[i];
      String filename=element.getFileName();
      String method=element.getMethodName();
      if ((filename != null && filename.equals("String_Node_Str")) || (method != null && method.equals("String_Node_Str"))) {
        i++;
        continue;
      }
      str.append("String_Node_Str").append(stacks[i].getClassName().substring(stacks[i].getClassName().lastIndexOf("String_Node_Str") + 1)).append("String_Node_Str").append(stacks[i].getMethodName()).append("String_Node_Str").append(stacks[i].getLineNumber());
      j++;
      i++;
    }
    return str.toString();
  }
  return "String_Node_Str";
}