Program: 29895
Project: 29895
Buggy source:
@Override public PhasedFuture<AllocationPhase,VirtualMachine> allocate(final TemplateInstance template,final VirtualCluster cluster,final EventSource<AllocationPhase> source) throws VirtException {
  int park=size();
  if (park == 0) {
    throw new VirtException("String_Node_Str");
  }
  Iterator<? extends Machine> machines=machines().iterator();
  Machine machine;
  int machineTried=0;
  do {
    if (!machines.hasNext()) {
      machines=machines().iterator();
    }
    machine=machines.next();
    machineTried++;
    if (!machine.isUp()) {
      RuntimeContext.logger.info("String_Node_Str" + machine.getName());
      try {
        Habitat habitat=Dom.unwrap(config).getHabitat();
        habitat.getComponent(OsInterface.class).resume(machine);
      }
 catch (      IOException e) {
        RuntimeContext.logger.log(Level.SEVERE,"String_Node_Str" + machine.getName(),e);
      }
      int tries=0;
      do {
        try {
          Thread.sleep(1000);
        }
 catch (        InterruptedException e) {
        }
        tries++;
      }
 while (!machine.isUp() && tries < 5);
      if (!machine.isUp()) {
        RuntimeContext.logger.log(Level.SEVERE,"String_Node_Str" + machine.getConfig().getDisksLocation());
      }
    }
  }
 while (!machine.isUp() || machineTried > park);
  if (!machine.isUp()) {
    RuntimeContext.logger.log(Level.SEVERE,"String_Node_Str");
    throw new VirtException("String_Node_Str");
  }
  final Machine targetMachine=machine;
  allocationCount.incrementAndGet();
  final String suffix=allocationCount.toString();
  PhasedFuture<AllocationPhase,VirtualMachine> vm=null;
  try {
    vm=targetMachine.create(template,cluster,source);
  }
 catch (  IOException e) {
    throw new VirtException(e);
  }
  RuntimeContext.logger.info("String_Node_Str" + getName() + "String_Node_Str"+ cluster.getConfig().getName());
  return vm;
}

Fixed version (ground truth):
@Override public PhasedFuture<AllocationPhase,VirtualMachine> allocate(final TemplateInstance template,final VirtualCluster cluster,final EventSource<AllocationPhase> source) throws VirtException {
  int park=size();
  if (park == 0) {
    throw new VirtException("String_Node_Str");
  }
  Iterator<? extends Machine> machines=machines().iterator();
  Machine machine;
  int machineTried=0;
  do {
    if (!machines.hasNext()) {
      machines=machines().iterator();
    }
    machine=machines.next();
    machineTried++;
    if (!machine.isUp()) {
      RuntimeContext.logger.info("String_Node_Str" + machine.getName());
      try {
        Habitat habitat=Dom.unwrap(config).getHabitat();
        habitat.getComponent(OsInterface.class).resume(machine);
      }
 catch (      IOException e) {
        RuntimeContext.logger.log(Level.SEVERE,"String_Node_Str" + machine.getName(),e);
      }
      int tries=0;
      do {
        try {
          Thread.sleep(1000);
        }
 catch (        InterruptedException e) {
        }
        tries++;
      }
 while (!machine.isUp() && tries < 5);
      if (!machine.isUp()) {
        RuntimeContext.logger.log(Level.SEVERE,"String_Node_Str" + machine.getConfig().getDisksLocation());
      }
    }
  }
 while (!machine.isUp() || machineTried > park);
  if (!machine.isUp()) {
    RuntimeContext.logger.log(Level.SEVERE,"String_Node_Str");
    throw new VirtException("String_Node_Str");
  }
  final Machine targetMachine=machine;
  allocationCount.incrementAndGet();
  PhasedFuture<AllocationPhase,VirtualMachine> vm=null;
  try {
    vm=targetMachine.create(template,cluster,source);
  }
 catch (  IOException e) {
    throw new VirtException(e);
  }
  RuntimeContext.logger.info("String_Node_Str" + getName() + "String_Node_Str"+ cluster.getConfig().getName());
  return vm;
}