Program: 14275
Project: 14275
Buggy source:
/** 
 * <ol> <li> Mark this cluster as gated. <li> Update node and resource information; describe resources. <li> Find the VM and its volume attachments and authorize every node's IQN. <li> Send the MigrateInstances operation. <li> Update node and resource information; describe resources. <li> Unmark this cluster as gated. </ol>
 * @param sourceHost
 * @param destHostsWhiteList -- the destination host list is a white list when true and a black list when false
 * @param destHosts -- list of hosts which are either a white list or black list based on {@code destHostsWhiteList}
 * @throws EucalyptusCloudException 
 * @throws Exception
 */
public void migrateInstance(final String instanceId,final Boolean destHostsWhiteList,final List<String> destHosts) throws Exception {
  if (this.gateLock.tryLock(30,TimeUnit.SECONDS)) {
    try {
      List<VmInstance> currentMigrations=this.lookupCurrentMigrations();
      if (!currentMigrations.isEmpty()) {
        throw Exceptions.toUndeclared("String_Node_Str" + Joiner.on("String_Node_Str").join(Iterables.transform(currentMigrations,CloudMetadatas.toDisplayName())));
      }
      this.retryCheck();
      this.prepareInstanceMigrations(instanceId);
      try {
        AsyncRequests.sendSync(this.getConfiguration(),new MigrateInstancesType(){
{
            this.setCorrelationId(Contexts.lookup().getCorrelationId());
            this.setInstanceId(instanceId);
            this.setAllowHosts(destHostsWhiteList);
            this.getDestinationHosts().addAll(destHosts);
          }
        }
);
      }
 catch (      Exception ex) {
        this.rollbackInstanceMigrations(instanceId);
        throw ex;
      }
      this.retryCheck();
    }
 catch (    Exception ex) {
      LOG.error(ex);
      throw ex;
    }
 finally {
      this.gateLock.unlock();
    }
  }
 else {
    throw new ServiceStateException("String_Node_Str" + this.getPartition() + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * <ol> <li> Mark this cluster as gated. <li> Update node and resource information; describe resources. <li> Find the VM and its volume attachments and authorize every node's IQN. <li> Send the MigrateInstances operation. <li> Update node and resource information; describe resources. <li> Unmark this cluster as gated. </ol>
 * @param sourceHost
 * @param destHostsWhiteList -- the destination host list is a white list when true and a black list when false
 * @param destHosts -- list of hosts which are either a white list or black list based on {@code destHostsWhiteList}
 * @throws EucalyptusCloudException 
 * @throws Exception
 */
public void migrateInstance(final String instanceId,final Boolean destHostsWhiteList,final List<String> destHosts) throws Exception {
  if (this.gateLock.writeLock().tryLock(60,TimeUnit.SECONDS)) {
    try {
      List<VmInstance> currentMigrations=this.lookupCurrentMigrations();
      if (!currentMigrations.isEmpty()) {
        throw Exceptions.toUndeclared("String_Node_Str" + Joiner.on("String_Node_Str").join(Iterables.transform(currentMigrations,CloudMetadatas.toDisplayName())));
      }
      this.retryCheck();
      this.prepareInstanceMigrations(instanceId);
      try {
        AsyncRequests.sendSync(this.getConfiguration(),new MigrateInstancesType(){
{
            this.setCorrelationId(Contexts.lookup().getCorrelationId());
            this.setInstanceId(instanceId);
            this.setAllowHosts(destHostsWhiteList);
            this.getDestinationHosts().addAll(destHosts);
          }
        }
);
      }
 catch (      Exception ex) {
        this.rollbackInstanceMigrations(instanceId);
        throw ex;
      }
      this.retryCheck();
    }
 catch (    Exception ex) {
      LOG.error(ex);
      throw ex;
    }
 finally {
      this.gateLock.writeLock().unlock();
    }
  }
 else {
    throw new ServiceStateException("String_Node_Str" + this.getPartition() + "String_Node_Str");
  }
}