Program: 105235
Project: 105235
Buggy source:
@DB protected void checkIfZoneIsDeletable(final long zoneId){
  final List<List<String>> tablesToCheck=new ArrayList<List<String>>();
  final List<String> host=new ArrayList<String>();
  host.add(0,"String_Node_Str");
  host.add(1,"String_Node_Str");
  host.add(2,"String_Node_Str");
  tablesToCheck.add(host);
  final List<String> hostPodRef=new ArrayList<String>();
  hostPodRef.add(0,"String_Node_Str");
  hostPodRef.add(1,"String_Node_Str");
  hostPodRef.add(2,"String_Node_Str");
  tablesToCheck.add(hostPodRef);
  final List<String> privateIP=new ArrayList<String>();
  privateIP.add(0,"String_Node_Str");
  privateIP.add(1,"String_Node_Str");
  privateIP.add(2,"String_Node_Str");
  tablesToCheck.add(privateIP);
  final List<String> publicIP=new ArrayList<String>();
  publicIP.add(0,"String_Node_Str");
  publicIP.add(1,"String_Node_Str");
  publicIP.add(2,"String_Node_Str");
  tablesToCheck.add(publicIP);
  final List<String> vmInstance=new ArrayList<String>();
  vmInstance.add(0,"String_Node_Str");
  vmInstance.add(1,"String_Node_Str");
  vmInstance.add(2,"String_Node_Str");
  tablesToCheck.add(vmInstance);
  final List<String> volumes=new ArrayList<String>();
  volumes.add(0,"String_Node_Str");
  volumes.add(1,"String_Node_Str");
  volumes.add(2,"String_Node_Str");
  tablesToCheck.add(volumes);
  final List<String> physicalNetworks=new ArrayList<String>();
  physicalNetworks.add(0,"String_Node_Str");
  physicalNetworks.add(1,"String_Node_Str");
  physicalNetworks.add(2,"String_Node_Str");
  tablesToCheck.add(physicalNetworks);
  final List<String> vmwareDcs=new ArrayList<String>();
  vmwareDcs.add(0,"String_Node_Str");
  vmwareDcs.add(1,"String_Node_Str");
  vmwareDcs.add(2,"String_Node_Str");
  tablesToCheck.add(vmwareDcs);
  for (  final List<String> table : tablesToCheck) {
    final String tableName=table.get(0);
    final String column=table.get(1);
    final String errorMsg=table.get(2);
    final String dbName="String_Node_Str";
    String selectSql="String_Node_Str" + dbName + "String_Node_Str"+ tableName+ "String_Node_Str"+ column+ "String_Node_Str";
    if (tableName.equals("String_Node_Str")) {
      selectSql+="String_Node_Str";
    }
    if (tableName.equals("String_Node_Str")) {
      selectSql+="String_Node_Str";
    }
    if (tableName.equals("String_Node_Str")) {
      selectSql+="String_Node_Str";
    }
    if (tableName.equals("String_Node_Str") || tableName.equals("String_Node_Str") || tableName.equals("String_Node_Str")|| tableName.equals("String_Node_Str")) {
      selectSql+="String_Node_Str";
    }
    if (tableName.equals("String_Node_Str")) {
      selectSql+="String_Node_Str" + VirtualMachine.State.Expunging.toString() + "String_Node_Str";
    }
    final TransactionLegacy txn=TransactionLegacy.currentTxn();
    try {
      final PreparedStatement stmt=txn.prepareAutoCloseStatement(selectSql);
      stmt.setLong(1,zoneId);
      final ResultSet rs=stmt.executeQuery();
      if (rs != null && rs.next()) {
        throw new CloudRuntimeException("String_Node_Str" + errorMsg);
      }
    }
 catch (    final SQLException ex) {
      throw new CloudRuntimeException("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@DB protected void checkIfZoneIsDeletable(final long zoneId){
  final List<List<String>> tablesToCheck=new ArrayList<List<String>>();
  final List<String> host=new ArrayList<String>();
  host.add(0,"String_Node_Str");
  host.add(1,"String_Node_Str");
  host.add(2,"String_Node_Str");
  tablesToCheck.add(host);
  final List<String> hostPodRef=new ArrayList<String>();
  hostPodRef.add(0,"String_Node_Str");
  hostPodRef.add(1,"String_Node_Str");
  hostPodRef.add(2,"String_Node_Str");
  tablesToCheck.add(hostPodRef);
  final List<String> privateIP=new ArrayList<String>();
  privateIP.add(0,"String_Node_Str");
  privateIP.add(1,"String_Node_Str");
  privateIP.add(2,"String_Node_Str");
  tablesToCheck.add(privateIP);
  final List<String> publicIP=new ArrayList<String>();
  publicIP.add(0,"String_Node_Str");
  publicIP.add(1,"String_Node_Str");
  publicIP.add(2,"String_Node_Str");
  tablesToCheck.add(publicIP);
  final List<String> vmInstance=new ArrayList<String>();
  vmInstance.add(0,"String_Node_Str");
  vmInstance.add(1,"String_Node_Str");
  vmInstance.add(2,"String_Node_Str");
  tablesToCheck.add(vmInstance);
  final List<String> volumes=new ArrayList<String>();
  volumes.add(0,"String_Node_Str");
  volumes.add(1,"String_Node_Str");
  volumes.add(2,"String_Node_Str");
  tablesToCheck.add(volumes);
  final List<String> physicalNetworks=new ArrayList<String>();
  physicalNetworks.add(0,"String_Node_Str");
  physicalNetworks.add(1,"String_Node_Str");
  physicalNetworks.add(2,"String_Node_Str");
  tablesToCheck.add(physicalNetworks);
  final List<String> vmwareDcs=new ArrayList<String>();
  vmwareDcs.add(0,"String_Node_Str");
  vmwareDcs.add(1,"String_Node_Str");
  vmwareDcs.add(2,"String_Node_Str");
  tablesToCheck.add(vmwareDcs);
  for (  final List<String> table : tablesToCheck) {
    final String tableName=table.get(0);
    final String column=table.get(1);
    final String errorMsg=table.get(2);
    final String dbName="String_Node_Str";
    String selectSql="String_Node_Str";
    if (tableName.equals("String_Node_Str")) {
      selectSql+="String_Node_Str";
    }
    if (tableName.equals("String_Node_Str")) {
      selectSql+="String_Node_Str";
    }
    if (tableName.equals("String_Node_Str")) {
      selectSql+="String_Node_Str";
    }
    if (tableName.equals("String_Node_Str") || tableName.equals("String_Node_Str") || tableName.equals("String_Node_Str")|| tableName.equals("String_Node_Str")) {
      selectSql+="String_Node_Str";
    }
    if (tableName.equals("String_Node_Str")) {
      selectSql+="String_Node_Str" + VirtualMachine.State.Expunging.toString() + "String_Node_Str";
    }
    final TransactionLegacy txn=TransactionLegacy.currentTxn();
    try {
      final PreparedStatement stmt=txn.prepareAutoCloseStatement(selectSql);
      stmt.setString(1,dbName);
      stmt.setString(2,tableName);
      stmt.setString(3,column);
      stmt.setLong(4,zoneId);
      final ResultSet rs=stmt.executeQuery();
      if (rs != null && rs.next()) {
        throw new CloudRuntimeException("String_Node_Str" + errorMsg);
      }
    }
 catch (    final SQLException ex) {
      throw new CloudRuntimeException("String_Node_Str");
    }
  }
}