Program: 14690
Project: 14690
Buggy source:
public AttachVolumeResponseType AttachVolume(AttachVolumeType request) throws EucalyptusCloudException {
  AttachVolumeResponseType reply=(AttachVolumeResponseType)request.getReply();
  Context ctx=Contexts.lookup();
  if (request.getDevice() == null || request.getDevice().endsWith("String_Node_Str") || request.getDevice().endsWith("String_Node_Str")) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getDevice());
  }
  VmInstance vm=null;
  try {
    vm=RestrictedTypes.doPrivileged(request.getInstanceId(),VmInstance.class);
  }
 catch (  NoSuchElementException ex) {
    LOG.debug(ex,ex);
    throw new EucalyptusCloudException("String_Node_Str" + request.getInstanceId(),ex);
  }
catch (  Exception ex) {
    LOG.debug(ex,ex);
    throw new EucalyptusCloudException(ex.getMessage(),ex);
  }
  Cluster cluster=null;
  try {
    cluster=Clusters.lookup(vm.lookupPartition());
  }
 catch (  NoSuchElementException e) {
    LOG.debug(e,e);
    throw new EucalyptusCloudException("String_Node_Str" + Topology.lookup(ClusterController.class,vm.lookupPartition()));
  }
  final String deviceName=request.getDevice();
  final String volumeId=request.getVolumeId();
  try {
    vm.lookupVolumeAttachmentByDevice(deviceName);
    throw new EucalyptusCloudException("String_Node_Str" + request.getDevice());
  }
 catch (  NoSuchElementException ex1) {
  }
  for (  VmInstance iter : VmInstances.list(Predicates.not(VmState.TERMINATED))) {
    try {
      iter.lookupVolumeAttachment(volumeId);
      throw new EucalyptusCloudException("String_Node_Str" + request.getVolumeId());
    }
 catch (    NoSuchElementException ex) {
    }
  }
  EntityWrapper<Volume> db=EntityWrapper.get(Volume.class);
  Volume volume=null;
  try {
    volume=db.getUnique(Volume.named(ctx.getUserFullName(),request.getVolumeId()));
    if (volume.getRemoteDevice() == null) {
      StorageUtil.getVolumeReply(new HashMap<String,AttachedVolume>(),Lists.newArrayList(volume));
    }
    db.commit();
  }
 catch (  EucalyptusCloudException e) {
    LOG.debug(e,e);
    db.rollback();
    throw new EucalyptusCloudException("String_Node_Str" + request.getVolumeId());
  }
  if (!RestrictedTypes.filterPrivileged().apply(volume)) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getVolumeId() + "String_Node_Str"+ ctx.getUser().getName());
  }
  ServiceConfiguration sc=Partitions.lookupService(Storage.class,volume.getPartition());
  ServiceConfiguration scVm=Partitions.lookupService(Storage.class,cluster.getConfiguration().getPartition());
  if (!sc.equals(scVm)) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getVolumeId());
  }
 else   if ("String_Node_Str".equals(volume.getRemoteDevice())) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getVolumeId());
  }
  AttachStorageVolumeResponseType scAttachResponse;
  try {
    scAttachResponse=ServiceDispatcher.lookup(sc).send(new AttachStorageVolumeType(cluster.getNode(vm.getServiceTag()).getIqn(),volume.getDisplayName()));
  }
 catch (  Exception e) {
    LOG.debug(e,e);
    throw new EucalyptusCloudException(e.getMessage());
  }
  request.setRemoteDevice(scAttachResponse.getRemoteDeviceString());
  AttachedVolume attachVol=new AttachedVolume(volume.getDisplayName(),vm.getInstanceId(),request.getDevice(),request.getRemoteDevice());
  volume.setState(State.BUSY);
  attachVol.setStatus("String_Node_Str");
  vm.addVolumeAttachment(attachVol);
  AsyncRequests.newRequest(new VolumeAttachCallback(request,attachVol)).dispatch(cluster.getConfiguration());
  EventRecord.here(VolumeManager.class,EventClass.VOLUME,EventType.VOLUME_ATTACH).withDetails(volume.getOwner().toString(),volume.getDisplayName(),"String_Node_Str",vm.getInstanceId()).withDetails("String_Node_Str",vm.lookupPartition().toString()).info();
  reply.setAttachedVolume(attachVol);
  return reply;
}

Fixed version (ground truth):
public AttachVolumeResponseType AttachVolume(AttachVolumeType request) throws EucalyptusCloudException {
  AttachVolumeResponseType reply=(AttachVolumeResponseType)request.getReply();
  Context ctx=Contexts.lookup();
  if (request.getDevice() == null || request.getDevice().endsWith("String_Node_Str") || request.getDevice().endsWith("String_Node_Str")) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getDevice());
  }
  VmInstance vm=null;
  try {
    vm=RestrictedTypes.doPrivileged(request.getInstanceId(),VmInstance.class);
  }
 catch (  NoSuchElementException ex) {
    LOG.debug(ex,ex);
    throw new EucalyptusCloudException("String_Node_Str" + request.getInstanceId(),ex);
  }
catch (  Exception ex) {
    LOG.debug(ex,ex);
    throw new EucalyptusCloudException(ex.getMessage(),ex);
  }
  Cluster cluster=null;
  try {
    ServiceConfiguration ccConfig=Topology.lookup(ClusterController.class,vm.lookupPartition());
    cluster=Clusters.lookup(ccConfig);
  }
 catch (  NoSuchElementException e) {
    LOG.debug(e,e);
    throw new EucalyptusCloudException("String_Node_Str" + vm.getPartition());
  }
  final String deviceName=request.getDevice();
  final String volumeId=request.getVolumeId();
  try {
    vm.lookupVolumeAttachmentByDevice(deviceName);
    throw new EucalyptusCloudException("String_Node_Str" + request.getDevice());
  }
 catch (  NoSuchElementException ex1) {
  }
  for (  VmInstance iter : VmInstances.list(Predicates.not(VmState.TERMINATED))) {
    try {
      iter.lookupVolumeAttachment(volumeId);
      throw new EucalyptusCloudException("String_Node_Str" + request.getVolumeId());
    }
 catch (    NoSuchElementException ex) {
    }
  }
  EntityWrapper<Volume> db=EntityWrapper.get(Volume.class);
  Volume volume=null;
  try {
    volume=db.getUnique(Volume.named(ctx.getUserFullName(),request.getVolumeId()));
    if (volume.getRemoteDevice() == null) {
      StorageUtil.getVolumeReply(new HashMap<String,AttachedVolume>(),Lists.newArrayList(volume));
    }
    db.commit();
  }
 catch (  EucalyptusCloudException e) {
    LOG.debug(e,e);
    db.rollback();
    throw new EucalyptusCloudException("String_Node_Str" + request.getVolumeId());
  }
  if (!RestrictedTypes.filterPrivileged().apply(volume)) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getVolumeId() + "String_Node_Str"+ ctx.getUser().getName());
  }
  Partition volPartition=Partitions.lookupByName(volume.getPartition());
  ServiceConfiguration sc=Topology.lookup(Storage.class,volPartition);
  ServiceConfiguration scVm=Topology.lookup(Storage.class,cluster.getConfiguration().lookupPartition());
  if (!sc.equals(scVm)) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getVolumeId());
  }
 else   if ("String_Node_Str".equals(volume.getRemoteDevice())) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getVolumeId());
  }
  AttachStorageVolumeResponseType scAttachResponse;
  try {
    scAttachResponse=ServiceDispatcher.lookup(sc).send(new AttachStorageVolumeType(cluster.getNode(vm.getServiceTag()).getIqn(),volume.getDisplayName()));
  }
 catch (  Exception e) {
    LOG.debug(e,e);
    throw new EucalyptusCloudException(e.getMessage());
  }
  request.setRemoteDevice(scAttachResponse.getRemoteDeviceString());
  AttachedVolume attachVol=new AttachedVolume(volume.getDisplayName(),vm.getInstanceId(),request.getDevice(),request.getRemoteDevice());
  volume.setState(State.BUSY);
  attachVol.setStatus("String_Node_Str");
  vm.addVolumeAttachment(attachVol);
  AsyncRequests.newRequest(new VolumeAttachCallback(request,attachVol)).dispatch(cluster.getConfiguration());
  EventRecord.here(VolumeManager.class,EventClass.VOLUME,EventType.VOLUME_ATTACH).withDetails(volume.getOwner().toString(),volume.getDisplayName(),"String_Node_Str",vm.getInstanceId()).withDetails("String_Node_Str",vm.getPartition().toString()).info();
  reply.setAttachedVolume(attachVol);
  return reply;
}