Program: 48826
Project: 48826
Buggy source:
public static VmSchema getVmSchema(ClusterCreate spec,String nodeGroup,List<DiskSpec> diskSet,String templateVmId,String templateVmSnapId){
  NodeGroupCreate groupSpec=spec.getNodeGroup(nodeGroup);
  VmSchema schema=new VmSchema();
  ResourceSchema resourceSchema=new ResourceSchema();
  resourceSchema.name="String_Node_Str";
  resourceSchema.cpuReservationMHz=0;
  resourceSchema.memReservationSize=0;
  resourceSchema.numCPUs=groupSpec.getCpuNum();
  resourceSchema.memSize=groupSpec.getMemCapacityMB();
  resourceSchema.priority=com.vmware.aurora.interfaces.model.IDatabaseConfig.Priority.Normal;
  schema.resourceSchema=resourceSchema;
  DiskSchema diskSchema=new DiskSchema();
  ArrayList<Disk> disks=new ArrayList<Disk>(diskSet.size());
  for (  DiskSpec disk : diskSet) {
    Disk tmDisk=new Disk();
    tmDisk.name=disk.getName();
    tmDisk.type=disk.getDiskType().getType();
    tmDisk.initialSizeMB=disk.getSize() * 1024;
    if (disk.getAllocType() != null && !disk.getAllocType().isEmpty())     tmDisk.allocationType=AllocationType.valueOf(disk.getAllocType().toUpperCase());
 else     tmDisk.allocationType=null;
    tmDisk.datastore=disk.getTargetDs();
    tmDisk.externalAddress=disk.getExternalAddress();
    tmDisk.vmdkPath=disk.getVmdkPath();
    tmDisk.mode=DiskMode.valueOf(disk.getDiskMode());
    disks.add(tmDisk);
  }
  diskSchema.setParent(templateVmId);
  diskSchema.setParentSnap(templateVmSnapId);
  diskSchema.setDisks(disks);
  schema.diskSchema=diskSchema;
  ArrayList<Network> networks=new ArrayList<Network>();
  List<NetworkAdd> networkAdds=spec.getNetworkings();
  int labelIndex=1;
  for (  NetworkAdd networkAdd : networkAdds) {
    Network network=new Network();
    network.vcNetwork=networkAdd.getPortGroup();
    network.nicLabel=NIC_LABEL_PREFIX + labelIndex;
    labelIndex++;
    networks.add(network);
  }
  NetworkSchema networkSchema=new NetworkSchema();
  networkSchema.name="String_Node_Str";
  networkSchema.networks=networks;
  schema.networkSchema=networkSchema;
  return schema;
}

Fixed version (ground truth):
public static VmSchema getVmSchema(ClusterCreate spec,String nodeGroup,List<DiskSpec> diskSet,String templateVmId,String templateVmSnapId){
  NodeGroupCreate groupSpec=spec.getNodeGroup(nodeGroup);
  VmSchema schema=new VmSchema();
  ResourceSchema resourceSchema=new ResourceSchema();
  resourceSchema.name="String_Node_Str";
  resourceSchema.cpuReservationMHz=0;
  resourceSchema.memReservationSize=0;
  resourceSchema.numCPUs=(groupSpec.getCpuNum() == null) ? 0 : groupSpec.getCpuNum();
  resourceSchema.memSize=(groupSpec.getMemCapacityMB() == null) ? 0 : groupSpec.getMemCapacityMB();
  resourceSchema.priority=com.vmware.aurora.interfaces.model.IDatabaseConfig.Priority.Normal;
  schema.resourceSchema=resourceSchema;
  DiskSchema diskSchema=new DiskSchema();
  ArrayList<Disk> disks=new ArrayList<Disk>(diskSet.size());
  for (  DiskSpec disk : diskSet) {
    Disk tmDisk=new Disk();
    tmDisk.name=disk.getName();
    tmDisk.type=disk.getDiskType().getType();
    tmDisk.initialSizeMB=disk.getSize() * 1024;
    if (disk.getAllocType() != null && !disk.getAllocType().isEmpty())     tmDisk.allocationType=AllocationType.valueOf(disk.getAllocType().toUpperCase());
 else     tmDisk.allocationType=null;
    tmDisk.datastore=disk.getTargetDs();
    tmDisk.externalAddress=disk.getExternalAddress();
    tmDisk.vmdkPath=disk.getVmdkPath();
    tmDisk.mode=DiskMode.valueOf(disk.getDiskMode());
    disks.add(tmDisk);
  }
  diskSchema.setParent(templateVmId);
  diskSchema.setParentSnap(templateVmSnapId);
  diskSchema.setDisks(disks);
  schema.diskSchema=diskSchema;
  ArrayList<Network> networks=new ArrayList<Network>();
  List<NetworkAdd> networkAdds=spec.getNetworkings();
  int labelIndex=1;
  for (  NetworkAdd networkAdd : networkAdds) {
    Network network=new Network();
    network.vcNetwork=networkAdd.getPortGroup();
    network.nicLabel=NIC_LABEL_PREFIX + labelIndex;
    labelIndex++;
    networks.add(network);
  }
  NetworkSchema networkSchema=new NetworkSchema();
  networkSchema.name="String_Node_Str";
  networkSchema.networks=networks;
  schema.networkSchema=networkSchema;
  return schema;
}