Program: 14485
Project: 14485
Buggy source:
@SuppressWarnings("String_Node_Str") public AssociateAddressResponseType associate(final AssociateAddressType request) throws Exception {
  AssociateAddressResponseType reply=(AssociateAddressResponseType)request.getReply();
  reply.set_return(false);
  final Address address=RestrictedTypes.doPrivileged(request.getPublicIp(),Address.class);
  if (!address.isAllocated()) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getPublicIp());
  }
 else   if (!Contexts.lookup().hasAdministrativePrivileges() && !Contexts.lookup().getUserFullName().asAccountFullName().equals(address.getOwner())) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getPublicIp());
  }
  final VmInstance vm=RestrictedTypes.doPrivileged(request.getInstanceId(),VmInstance.class);
  final VmInstance oldVm=findCurrentAssignedVm(address);
  final Address oldAddr=findVmExistingAddress(vm);
  final boolean oldAddrSystem=oldAddr != null ? oldAddr.isSystemOwned() : false;
  reply.set_return(true);
  final UnconditionalCallback assignTarget=new UnconditionalCallback(){
    public void fire(){
      AsyncRequests.newRequest(address.assign(vm).getCallback()).then(new Callback.Success<BaseMessage>(){
        public void fire(        BaseMessage response){
          vm.updatePublicAddress(address.getName());
        }
      }
).dispatch(vm.getPartition());
      if (oldVm != null) {
        Addresses.system(oldVm);
      }
    }
  }
;
  final UnconditionalCallback unassignBystander=new UnconditionalCallback(){
    public void fire(){
      if (oldAddr != null) {
        AsyncRequests.newRequest(oldAddr.unassign().getCallback()).then(assignTarget).dispatch(vm.getPartition());
      }
 else {
        assignTarget.fire();
      }
    }
  }
;
  if (address.isAssigned()) {
    AsyncRequests.newRequest(address.unassign().getCallback()).then(unassignBystander).dispatch(oldVm.getPartition());
  }
 else {
    unassignBystander.fire();
  }
  return reply;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public AssociateAddressResponseType associate(final AssociateAddressType request) throws Exception {
  AssociateAddressResponseType reply=(AssociateAddressResponseType)request.getReply();
  reply.set_return(false);
  final Address address=RestrictedTypes.doPrivileged(request.getPublicIp(),Address.class);
  if (!address.isAllocated()) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getPublicIp());
  }
 else   if (!Contexts.lookup().hasAdministrativePrivileges() && !Contexts.lookup().getUserFullName().asAccountFullName().getAccountNumber().equals(address.getOwner().getAccountNumber())) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getPublicIp());
  }
  final VmInstance vm=RestrictedTypes.doPrivileged(request.getInstanceId(),VmInstance.class);
  final VmInstance oldVm=findCurrentAssignedVm(address);
  final Address oldAddr=findVmExistingAddress(vm);
  final boolean oldAddrSystem=oldAddr != null ? oldAddr.isSystemOwned() : false;
  reply.set_return(true);
  final UnconditionalCallback assignTarget=new UnconditionalCallback(){
    public void fire(){
      AsyncRequests.newRequest(address.assign(vm).getCallback()).then(new Callback.Success<BaseMessage>(){
        public void fire(        BaseMessage response){
          vm.updatePublicAddress(address.getName());
        }
      }
).dispatch(vm.getPartition());
      if (oldVm != null) {
        Addresses.system(oldVm);
      }
    }
  }
;
  final UnconditionalCallback unassignBystander=new UnconditionalCallback(){
    public void fire(){
      if (oldAddr != null) {
        AsyncRequests.newRequest(oldAddr.unassign().getCallback()).then(assignTarget).dispatch(vm.getPartition());
      }
 else {
        assignTarget.fire();
      }
    }
  }
;
  if (address.isAssigned()) {
    AsyncRequests.newRequest(address.unassign().getCallback()).then(unassignBystander).dispatch(oldVm.getPartition());
  }
 else {
    unassignBystander.fire();
  }
  return reply;
}