Program: 14907
Project: 14907
Buggy source:
public BundleInstanceResponseType bundleInstance(final BundleInstanceType request) throws EucalyptusCloudException {
  final BundleInstanceResponseType reply=request.getReply();
  reply.set_return(true);
  Component walrus=Components.lookup(Walrus.class);
  NavigableSet<ServiceConfiguration> configs=walrus.lookupServiceConfigurations();
  if (configs.isEmpty() || !Component.State.ENABLED.equals(configs.first().lookupState())) {
    throw new EucalyptusCloudException("String_Node_Str");
  }
  final String walrusUrl=configs.first().getUri().toASCIIString();
  final String instanceId=request.getInstanceId();
  final Context ctx=Contexts.lookup();
  final User user=ctx.getUser();
  try {
    final VmInstance v=VmInstances.lookup(instanceId);
    if (v.isBundling()) {
      reply.setTask(v.getBundleTask());
      return reply;
    }
 else     if (!"String_Node_Str".equals(v.getPlatform())) {
      throw new EucalyptusCloudException("String_Node_Str" + request.getInstanceId());
    }
 else     if (!VmState.RUNNING.equals(v.getState())) {
      throw new EucalyptusCloudException("String_Node_Str" + request.getInstanceId());
    }
 else     if (RestrictedTypes.filterPrivileged().apply(v)) {
      BundleInstanceChecker.check(request);
      final BundleTask bundleTask=new BundleTask(v.getInstanceId().replaceFirst("String_Node_Str","String_Node_Str"),v.getInstanceId(),request.getBucket(),request.getPrefix());
      if (v.startBundleTask(bundleTask)) {
        reply.setTask(bundleTask);
      }
 else       if (v.getBundleTask() == null) {
        v.resetBundleTask();
        v.startBundleTask(bundleTask);
        reply.setTask(bundleTask);
      }
 else {
        throw new EucalyptusCloudException("String_Node_Str" + v.getBundleTask().getBundleId());
      }
      LOG.info(EventRecord.here(BundleCallback.class,EventType.BUNDLE_PENDING,ctx.getUserFullName().toString(),v.getBundleTask().getBundleId(),v.getInstanceId()));
      final BundleCallback callback=new BundleCallback(request);
      request.setUrl(walrusUrl);
      request.setAwsAccessKeyId(Accounts.getFirstActiveAccessKeyId(user));
      AsyncRequests.newRequest(callback).dispatch(v.lookupClusterConfiguration());
      return reply;
    }
 else {
      throw new EucalyptusCloudException("String_Node_Str" + request.getInstanceId());
    }
  }
 catch (  EucalyptusCloudException e) {
    throw e;
  }
catch (  final Exception e) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getInstanceId());
  }
}

Fixed version (ground truth):
public BundleInstanceResponseType bundleInstance(final BundleInstanceType request) throws EucalyptusCloudException {
  final BundleInstanceResponseType reply=request.getReply();
  reply.set_return(true);
  Component walrus=Components.lookup(Walrus.class);
  NavigableSet<ServiceConfiguration> configs=walrus.lookupServiceConfigurations();
  if (configs.isEmpty() || !Component.State.ENABLED.equals(configs.first().lookupState())) {
    throw new EucalyptusCloudException("String_Node_Str");
  }
  final String walrusUrl=configs.first().getUri().toASCIIString();
  final String instanceId=request.getInstanceId();
  final Context ctx=Contexts.lookup();
  final User user=ctx.getUser();
  EntityTransaction db=Entities.get(VmInstance.class);
  try {
    final VmInstance v=VmInstances.lookup(instanceId);
    if (v.isBundling()) {
      reply.setTask(v.getBundleTask());
    }
 else     if (!"String_Node_Str".equals(v.getPlatform())) {
      throw new EucalyptusCloudException("String_Node_Str" + request.getInstanceId());
    }
 else     if (!VmState.RUNNING.equals(v.getState())) {
      throw new EucalyptusCloudException("String_Node_Str" + request.getInstanceId());
    }
 else     if (RestrictedTypes.filterPrivileged().apply(v)) {
      BundleInstanceChecker.check(request);
      final BundleTask bundleTask=new BundleTask(v.getInstanceId().replaceFirst("String_Node_Str","String_Node_Str"),v.getInstanceId(),request.getBucket(),request.getPrefix());
      if (v.startBundleTask(bundleTask)) {
        reply.setTask(bundleTask);
      }
 else       if (v.getBundleTask() == null) {
        v.resetBundleTask();
        v.startBundleTask(bundleTask);
        reply.setTask(bundleTask);
      }
 else {
        throw new EucalyptusCloudException("String_Node_Str" + v.getBundleTask().getBundleId());
      }
      EventRecord.here(BundleCallback.class,EventType.BUNDLE_PENDING,ctx.getUserFullName().toString(),v.getBundleTask().getBundleId(),v.getInstanceId()).debug();
      final BundleCallback callback=new BundleCallback(request);
      request.setUrl(walrusUrl);
      request.setAwsAccessKeyId(Accounts.getFirstActiveAccessKeyId(user));
      AsyncRequests.newRequest(callback).dispatch(v.lookupClusterConfiguration());
    }
 else {
      throw new EucalyptusCloudException("String_Node_Str" + request.getInstanceId());
    }
  }
 catch (  EucalyptusCloudException ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
    throw ex;
  }
catch (  final Exception ex) {
    Logs.exhaust().error(ex,ex);
    db.rollback();
    throw new EucalyptusCloudException("String_Node_Str" + request.getInstanceId(),ex);
  }
  return reply;
}