Program: 15433
Project: 15433
Buggy source:
private Request makeRunRequest(RunInstancesType request,final ResourceToken childToken,UserFullName userFullName,String rsvId,VmKeyInfo keyInfo,VmTypeInfo vmInfo,String platform,Integer vlan,List<String> networkNames,String userData){
  List<String> macs=Lists.transform(childToken.getInstanceIds(),new Function<String,String>(){
    @Override public String apply(    String instanceId){
      return VmInstances.getAsMAC(instanceId);
    }
  }
);
  List<String> networkIndexes=(childToken.getPrimaryNetwork() == null) ? new ArrayList<String>() : Lists.newArrayList(Iterables.transform(childToken.getPrimaryNetwork().getIndexes(),Functions.toStringFunction()));
  VmRunType run=new VmRunType(rsvId,userData,childToken.getAmount(),vmInfo,keyInfo,platform != null ? platform : "String_Node_Str",childToken.getInstanceIds(),macs,vlan,networkNames,networkIndexes,Lists.newArrayList(UUID.randomUUID().toString())).regarding(request);
  run.setUserId(userFullName.getUserId());
  Request<VmRunType,VmRunResponseType> req=AsyncRequests.newRequest(new VmRunCallback(run,childToken));
  if (!childToken.getAddresses().isEmpty()) {
    req.then(new Callback.Success<VmRunResponseType>(){
      @Override public void fire(      VmRunResponseType response){
        Iterator<String> addrs=childToken.getAddresses().iterator();
        for (        VmInfo vmInfo : response.getVms()) {
          final Address addr=Addresses.getInstance().lookup(addrs.next());
          final VmInstance vm=VmInstances.getInstance().lookup(vmInfo.getInstanceId());
          AsyncRequests.newRequest(addr.assign(vm).getCallback()).then(new Callback.Success<BaseMessage>(){
            public void fire(            BaseMessage response){
              vm.updatePublicAddress(addr.getName());
            }
          }
).dispatch(addr.getCluster());
        }
      }
    }
);
  }
  return req;
}

Fixed version (ground truth):
private Request makeRunRequest(RunInstancesType request,final ResourceToken childToken,UserFullName userFullName,String rsvId,VmKeyInfo keyInfo,VmTypeInfo vmInfo,String platform,Integer vlan,List<String> networkNames,String userData){
  List<String> macs=Lists.transform(childToken.getInstanceIds(),new Function<String,String>(){
    @Override public String apply(    String instanceId){
      return VmInstances.getAsMAC(instanceId);
    }
  }
);
  List<String> networkIndexes=(childToken.getPrimaryNetwork() == null) ? new ArrayList<String>() : Lists.newArrayList(Iterables.transform(childToken.getPrimaryNetwork().getIndexes(),Functions.toStringFunction()));
  VmRunType run=new VmRunType(rsvId,userData,childToken.getAmount(),vmInfo,keyInfo,platform != null ? platform : "String_Node_Str",childToken.getInstanceIds(),macs,vlan,networkNames,networkIndexes,childToken.getInstanceUuids()).regarding(request);
  run.setUserId(userFullName.getUserId());
  Request<VmRunType,VmRunResponseType> req=AsyncRequests.newRequest(new VmRunCallback(run,childToken));
  if (!childToken.getAddresses().isEmpty()) {
    req.then(new Callback.Success<VmRunResponseType>(){
      @Override public void fire(      VmRunResponseType response){
        Iterator<String> addrs=childToken.getAddresses().iterator();
        for (        VmInfo vmInfo : response.getVms()) {
          final Address addr=Addresses.getInstance().lookup(addrs.next());
          final VmInstance vm=VmInstances.getInstance().lookup(vmInfo.getInstanceId());
          AsyncRequests.newRequest(addr.assign(vm).getCallback()).then(new Callback.Success<BaseMessage>(){
            public void fire(            BaseMessage response){
              vm.updatePublicAddress(addr.getName());
            }
          }
).dispatch(addr.getCluster());
        }
      }
    }
);
  }
  return req;
}