Method implementation incomplete and unused
@param spendings
@return
@throws Exception
351620
public Response spend(List<SpendDescriptor> spendings) throws Exception {
        final boolean checkPin = Boolean.parseBoolean(pinEnabled);
        final UserPin pin = pinRegistry.get(this.descriptor.owner);
        final V2WalletSetting seed = this.descriptor.getSetting(V2WalletSetting.PASSPHRASE);
        final V2WalletSetting compressed = this.descriptor.getSetting(V2WalletSetting.COMPRESSED_KEYS);
        final Response response = new Response();
        final Map<String, TransactionOutputList> unspents = getUnspent();
        final Balance balance = new Balance(unspents.get(TransactionStatus.CONFIRMED).total, unspents.get(TransactionStatus.PENDING).total);
        long fee = STANDARD_FEE;
        final long toSpend = balance.confirmed + balance.unconfirmed - fee;
        if (balance.confirmed + balance.unconfirmed > 0) {
            //Receive change on 0 account
            final V2Key key = createKey(0);
            response.setPayload(new TransactionBuilder(unspents, balance, spendings, key, V2WalletCrypto.decrypt((String) seed.value, checkPin, pin.pin, pinSalt), (Boolean) compressed.value, fee).build());
        } else {
            response.addError(new Error(15));
        }
        return response;
    }
1287072
private void rejectPendingSlotRequest(PendingSlotRequest pendingSlotRequest, Exception cause) {
		CompletableFuture<Acknowledge> request = pendingSlotRequest.getRequestFuture();

		if (null != request) {
			request.completeExceptionally(new SlotAllocationException(cause));
		} else {
			LOG.debug("Cannot reject pending slot request {}, since no request has been sent.", pendingSlotRequest.getAllocationId());
		}
	}
119009
public void setPendingAggregationRequests(java.util.Collection<PendingAggregationRequest> pendingAggregationRequests) {
        if (pendingAggregationRequests == null) {
            this.pendingAggregationRequests = null;
            return;
        }

        this.pendingAggregationRequests = new com.amazonaws.internal.SdkInternalList<PendingAggregationRequest>(pendingAggregationRequests);
    }
1243798
private boolean initialiseTransactionSet() throws SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "initialiseTransactionSet");

        boolean suspend = false;

        // Always start with an empty set.
        transactionSet = new HashSet();

        try {

            if (itemStream != null)
                itemStream.getActiveTransactions(transactionSet);

        } catch (MessageStoreException e) {
            // FFDC

            FFDCFilter.processException(
                                        e,
                                        "com.ibm.ws.sib.processor.impl.ConsumerDispatcher.initialiseTransactionSet",
                                        "1:1957:1.280.5.25",
                                        this);

            SIResourceException e2 = new SIResourceException(
                            nls.getFormattedMessage(
                                                    "INTERNAL_MESSAGING_ERROR_CWSIP0002",
                                                    new Object[] {
                                                                  "com.ibm.ws.sib.processor.impl.ConsumerDispatcher",
                                                                  "1:1965:1.280.5.25",
                                                                  e }, null), e);

            SibTr.exception(tc, e2);
            SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
                        new Object[] {
                                      "com.ibm.ws.sib.processor.impl.ConsumerDispatcher",
                                      "1:1972:1.280.5.25",
                                      e2 });

            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(tc, "initialiseTransactionSet", e2);

            throw e2;
        }

        if (transactionSet.size() > 0)
            suspend = true;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "initialiseTransactionSet", new Object[] { transactionSet, Boolean.valueOf(suspend) });

        return suspend;
    }
1366388
public void setUnprocessedAccounts(java.util.Collection<UnprocessedAccount> unprocessedAccounts) {
        if (unprocessedAccounts == null) {
            this.unprocessedAccounts = null;
            return;
        }

        this.unprocessedAccounts = new java.util.ArrayList<UnprocessedAccount>(unprocessedAccounts);
    }
606389
public static void runExample(
      AdWordsServicesInterface adWordsServices, AdWordsSession session) throws RemoteException {
    // Get the BudgetService.
    BudgetServiceInterface budgetService =
        adWordsServices.get(session, BudgetServiceInterface.class);

    // Create a budget, which can be shared by multiple campaigns.
    Budget sharedBudget = new Budget();
    sharedBudget.setName("Interplanetary Cruise #" + System.currentTimeMillis());
    Money budgetAmount = new Money();
    budgetAmount.setMicroAmount(50_000_000L);
    sharedBudget.setAmount(budgetAmount);
    sharedBudget.setDeliveryMethod(BudgetBudgetDeliveryMethod.STANDARD);

    BudgetOperation budgetOperation = new BudgetOperation();
    budgetOperation.setOperand(sharedBudget);
    budgetOperation.setOperator(Operator.ADD);

    // Add the budget
    Long budgetId =
        budgetService.mutate(new BudgetOperation[] {budgetOperation}).getValue(0).getBudgetId();

    // Get the CampaignService.
    CampaignServiceInterface campaignService =
        adWordsServices.get(session, CampaignServiceInterface.class);

    // Create campaign.
    Campaign campaign = new Campaign();
    campaign.setName("Interplanetary Cruise #" + System.currentTimeMillis());

    // Recommendation: Set the campaign to PAUSED when creating it to prevent
    // the ads from immediately serving. Set to ENABLED once you've added
    // targeting and the ads are ready to serve.
    campaign.setStatus(CampaignStatus.PAUSED);

    BiddingStrategyConfiguration biddingStrategyConfiguration = new BiddingStrategyConfiguration();
    biddingStrategyConfiguration.setBiddingStrategyType(BiddingStrategyType.MANUAL_CPC);

    // You can optionally provide a bidding scheme in place of the type.
    ManualCpcBiddingScheme cpcBiddingScheme = new ManualCpcBiddingScheme();
    biddingStrategyConfiguration.setBiddingScheme(cpcBiddingScheme);

    campaign.setBiddingStrategyConfiguration(biddingStrategyConfiguration);

    // You can optionally provide these field(s).
    campaign.setStartDate(new DateTime().plusDays(1).toString("yyyyMMdd"));
    campaign.setEndDate(new DateTime().plusDays(30).toString("yyyyMMdd"));
    campaign.setFrequencyCap(new FrequencyCap(5L, TimeUnit.DAY, Level.ADGROUP));

    // Only the budgetId should be sent, all other fields will be ignored by CampaignService.
    Budget budget = new Budget();
    budget.setBudgetId(budgetId);
    campaign.setBudget(budget);

    campaign.setAdvertisingChannelType(AdvertisingChannelType.SEARCH);

    // Set the campaign network options to Search and Search Network.
    NetworkSetting networkSetting = new NetworkSetting();
    networkSetting.setTargetGoogleSearch(true);
    networkSetting.setTargetSearchNetwork(true);
    networkSetting.setTargetContentNetwork(false);
    networkSetting.setTargetPartnerSearchNetwork(false);
    campaign.setNetworkSetting(networkSetting);

    // Set options that are not required.
    GeoTargetTypeSetting geoTarget = new GeoTargetTypeSetting();
    geoTarget.setPositiveGeoTargetType(GeoTargetTypeSettingPositiveGeoTargetType.DONT_CARE);
    campaign.setSettings(new Setting[] {geoTarget});

    // You can create multiple campaigns in a single request.
    Campaign campaign2 = new Campaign();
    campaign2.setName("Interplanetary Cruise banner #" + System.currentTimeMillis());
    campaign2.setStatus(CampaignStatus.PAUSED);
    BiddingStrategyConfiguration biddingStrategyConfiguration2 = new BiddingStrategyConfiguration();
    biddingStrategyConfiguration2.setBiddingStrategyType(BiddingStrategyType.MANUAL_CPC);
    campaign2.setBiddingStrategyConfiguration(biddingStrategyConfiguration2);

    Budget budget2 = new Budget();
    budget2.setBudgetId(budgetId);
    campaign2.setBudget(budget2);

    campaign2.setAdvertisingChannelType(AdvertisingChannelType.DISPLAY);

    // Create operations.
    CampaignOperation operation = new CampaignOperation();
    operation.setOperand(campaign);
    operation.setOperator(Operator.ADD);
    CampaignOperation operation2 = new CampaignOperation();
    operation2.setOperand(campaign2);
    operation2.setOperator(Operator.ADD);

    CampaignOperation[] operations = new CampaignOperation[] {operation, operation2};

    // Add campaigns.
    CampaignReturnValue result = campaignService.mutate(operations);

    // Display campaigns.
    for (Campaign campaignResult : result.getValue()) {
      System.out.printf("Campaign with name '%s' and ID %d was added.%n", campaignResult.getName(),
          campaignResult.getId());
    }
  }
3605
@Override
  public final void addCheckIsReadyToAccount(
    final Map<String, Object> pReqVars,
      final PurchaseInvoice pEntity,
        final IRequestData pRequestData) throws Exception {
    // nothing
  }
698887
@Execute
    public void process() throws Exception {
        if (!concatOr(outFlow == null, doReset)) {
            return;
        }
        checkNull(inFlow, inPit);

        RegionMap regionMap = CoverageUtilities.getRegionParamsFromGridCoverage(inPit);
        cols = regionMap.getCols();
        rows = regionMap.getRows();
        xRes = regionMap.getXres();
        yRes = regionMap.getYres();
        dxySqrt = Math.sqrt(xRes * xRes + yRes * yRes);

        RenderedImage pitfillerRI = inPit.getRenderedImage();
        WritableRaster pitfillerWR = CoverageUtilities.renderedImage2DoubleWritableRaster(pitfillerRI, true);
        RenderedImage flowRI = inFlow.getRenderedImage();
        WritableRaster flowWR = CoverageUtilities.renderedImage2ShortWritableRaster(flowRI, true);

        RandomIter pitRandomIter = RandomIterFactory.create(pitfillerWR, null);

        // create new matrix
        double[] orderedelev = new double[cols * rows];
        int[] indexes = new int[cols * rows];

        int nelev = 0;
        for( int r = 0; r < rows; r++ ) {
            if (pm.isCanceled()) {
                return;
            }
            for( int c = 0; c < cols; c++ ) {
                double pitValue = pitRandomIter.getSampleDouble(c, r, 0);
                int pos = (r * cols) + c;
                orderedelev[pos] = pitValue;
                indexes[pos] = pos + 1;
                if (!isNovalue(pitValue)) {
                    nelev = nelev + 1;
                }
            }
        }

        QuickSortAlgorithm t = new QuickSortAlgorithm(pm);
        t.sort(orderedelev, indexes);

        pm.message(msg.message("draindir.initializematrix"));

        // Initialize new RasterData and set value
        WritableRaster tcaWR = CoverageUtilities.createWritableRaster(cols, rows, Integer.class, null, HMConstants.intNovalue);
        WritableRaster dirWR = CoverageUtilities.createWritableRaster(cols, rows, Short.class, null, HMConstants.shortNovalue);

        // it contains the analyzed cells
        WritableRaster deviationsWR = CoverageUtilities.createWritableRaster(cols, rows, Double.class, null, null);
        BitMatrix analizedMatrix = new BitMatrix(cols, rows);

        if (doLad) {
            orlandiniD8LAD(indexes, deviationsWR, analizedMatrix, pitfillerWR, flowWR, tcaWR, dirWR, nelev);
        } else {
            orlandiniD8LTD(indexes, deviationsWR, analizedMatrix, pitfillerWR, flowWR, tcaWR, dirWR, nelev);
            if (pm.isCanceled()) {
                return;
            }
            // only if required executes this method
            if (inFlownet != null) {
                newDirections(pitfillerWR, dirWR);
            }
        }
        if (pm.isCanceled()) {
            return;
        }
        outFlow = CoverageUtilities.buildCoverage("draindir", dirWR, regionMap, inPit.getCoordinateReferenceSystem());
        outTca = CoverageUtilities.buildCoverage("tca", tcaWR, regionMap, inPit.getCoordinateReferenceSystem());
    }
150869
public void setUsageRecords(java.util.Collection<UsageRecord> usageRecords) {
        if (usageRecords == null) {
            this.usageRecords = null;
            return;
        }

        this.usageRecords = new java.util.ArrayList<UsageRecord>(usageRecords);
    }
790474
@Override
  public final void process(final Map<String, Object> pRqVs,
    final IRequestData pRqDt) throws Exception {
    Cart cart = this.srvCart.getShoppingCart(pRqVs, pRqDt, false,
      false);
    if (cart != null) {
      String dlvStr = pRqDt.getParameter("deliv");
      String payMethStr = pRqDt.getParameter("payMeth");
      EDelivering dlv = EDelivering.class.
        getEnumConstants()[Integer.parseInt(dlvStr)];
      EPaymentMethod payMeth = EPaymentMethod.class.
        getEnumConstants()[Integer.parseInt(payMethStr)];
      if (dlv != cart.getDeliv() || payMeth != cart.getPayMeth()) {
        EDelivering dlvOld = cart.getDeliv();
        cart.setDeliv(dlv);
        cart.setPayMeth(payMeth);
        this.srvOrm.updateEntity(pRqVs, cart);
        if (dlv != dlvOld) {
          AccSettings as = (AccSettings) pRqVs.get("accSet");
          TaxDestination txRules = this.srvCart.revealTaxRules(pRqVs,
            cart, as);
          if (txRules != null) {
            pRqDt.setAttribute("txRules", txRules);
          }
          this.srvCart.hndCartChan(pRqVs, cart, txRules);
        }
      }
    } //else spam
    //TODO change to servlet redirect???
    String processorName = pRqDt.getParameter("nmPrcRed");
    IProcessor proc = this.processorsFactory.lazyGet(pRqVs, processorName);
    proc.process(pRqVs, pRqDt);
  }
1151028
@Override
  public final FctBnEntitiesProcessors<RS>
    lazyGetFctBnEntitiesProcessors() throws Exception {
    String beanName = getFctBnEntitiesProcessorsName();
    @SuppressWarnings("unchecked")
    FctBnEntitiesProcessors<RS> fctBnEntitiesProcessors =
      (FctBnEntitiesProcessors<RS>)
        this.factoryAppBeans.getBeansMap().get(beanName);
    if (fctBnEntitiesProcessors == null) {
      fctBnEntitiesProcessors = new FctBnEntitiesProcessors<RS>();
      fctBnEntitiesProcessors.setSrvOrm(this.factoryAppBeans.lazyGetSrvOrm());
      fctBnEntitiesProcessors
        .setMngUvdSettings(this.factoryAppBeans.lazyGetMngUvdSettings());
      fctBnEntitiesProcessors
        .setEntitiesFactoriesFatory(lazyGetFctBcFctSimpleEntities());
      fctBnEntitiesProcessors.setFillersFieldsFactory(
        this.factoryAppBeans.lazyGetFctFillersObjectFields());
      fctBnEntitiesProcessors.setUtlProperties(
        this.factoryAppBeans.lazyGetUtlProperties());
      fctBnEntitiesProcessors.setSrvDate(this.factoryAppBeans.lazyGetSrvDate());
      fctBnEntitiesProcessors.setFieldConverterNamesHolder(
        this.factoryAppBeans.lazyGetHldFieldsCnvTfsNames());
      fctBnEntitiesProcessors.setConvertersFieldsFatory(
        this.factoryAppBeans.lazyGetFctConvertersToFromString());
      fctBnEntitiesProcessors.setGettersRapiHolder(
        this.factoryAppBeans.lazyGetHolderRapiGetters());
      fctBnEntitiesProcessors.setSettersRapiHolder(
        this.factoryAppBeans.lazyGetHolderRapiSetters());
      fctBnEntitiesProcessors
        .setUploadDirectory(this.factoryAppBeans.getUploadDirectory());
      fctBnEntitiesProcessors
        .setWebAppPath(this.factoryAppBeans.getWebAppPath());
      fctBnEntitiesProcessors
        .setEmailSender(this.factoryAppBeans.lazyGetMailSender());
      this.factoryAppBeans.getBeansMap().put(beanName, fctBnEntitiesProcessors);
    }
    return fctBnEntitiesProcessors;
  }
1312689
@Override
    public void run() throws Exception {
        QueueContainer queueContainer = getContainer();
        if (queueContainer.hasEnoughCapacity(txSize + 1)) {
            response = queueContainer.txnOfferReserve(transactionId);
        }
    }
228809
CompletableFuture<Collection<Xid>> fetchPreparedTransactions() {
      try {
         TransactionOperationFactory factory = assertStartedAndReturnFactory();
         return factory.newRecoveryOperation().execute();
      } catch (Exception e) {
         if (isTraceLogEnabled()) {
            getLog().trace("Exception while fetching prepared transactions", e);
         }
         return CompletableFuture.completedFuture(Collections.emptyList());
      }
   }
1321833
public void close() throws Exception {
        for (Entry<TransactionType, ShardingTransactionManager> entry : transactionManagerMap.entrySet()) {
            entry.getValue().close();
        }
    }
17154
@Override
  public final void makeFirstPrepareForSave(final Map<String, Object> pReqVars,
    final PurchaseInvoice pEntity,
      final IRequestData pRequestData) throws Exception {
    if (pEntity.getPrepaymentTo() != null) {
      pEntity.setPrepaymentTo(getSrvOrm()
        .retrieveEntity(pReqVars, pEntity.getPrepaymentTo()));
      if (pEntity.getReversedId() == null && pEntity.getPrepaymentTo()
        .getPurchaseInvoiceId() != null && !pEntity.getHasMadeAccEntries()) {
        throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
          "prepayment_already_in_use");
      }
      if (pEntity.getReversedId() == null && !pEntity.getPrepaymentTo()
        .getVendor().getItsId().equals(pEntity.getVendor().getItsId())) {
        throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
          "prepayment_for_different_vendor");
      }
    }
    if (pEntity.getReversedId() != null && pEntity.getPrepaymentTo() != null
      && pEntity.getPaymentTotal().compareTo(pEntity.getPrepaymentTo()
        .getItsTotal()) != 0) {
      throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
        "reverse_payments_first");
    }
    if (pEntity.getReversedId() != null && pEntity.getPrepaymentTo() == null
      && pEntity.getPaymentTotal().compareTo(BigDecimal.ZERO) != 0) {
      throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
        "reverse_payments_first");
    }
    if (pEntity.getReversedId() == null) {
      calculateTotalPayment(pReqVars, pEntity);
    }
    if (!pEntity.getIsNew()) {
      pReqVars.put("DebtorCreditortaxDestinationdeepLevel", 2);
      Set<String> ndFlDc = new HashSet<String>();
      ndFlDc.add("itsId");
      ndFlDc.add("isForeigner");
      ndFlDc.add("taxDestination");
      pReqVars.put("DebtorCreditorneededFields", ndFlDc);
    }
  }
1126764
@Override
	protected void run() throws Exception {

		final String iterationId = getConfiguration().getIterationId();
		if (iterationId == null || iterationId.length() == 0) {
			throw new Exception("Missing iteration ID in the task configuration");
		}

		final String brokerID = createBrokerIdString(getEnvironment().getJobID(), iterationId ,
				getEnvironment().getTaskInfo().getIndexOfThisSubtask());

		final long iterationWaitTime = getConfiguration().getIterationWaitTime();
		final boolean shouldWait = iterationWaitTime > 0;

		final BlockingQueue<StreamRecord<OUT>> dataChannel = new ArrayBlockingQueue<StreamRecord<OUT>>(1);

		// offer the queue for the tail
		BlockingQueueBroker.INSTANCE.handIn(brokerID, dataChannel);
		LOG.info("Iteration head {} added feedback queue under {}", getName(), brokerID);

		// do the work
		try {
			@SuppressWarnings("unchecked")
			RecordWriterOutput<OUT>[] outputs = (RecordWriterOutput<OUT>[]) getStreamOutputs();

			// If timestamps are enabled we make sure to remove cyclic watermark dependencies
			if (isSerializingTimestamps()) {
				synchronized (getCheckpointLock()) {
					for (RecordWriterOutput<OUT> output : outputs) {
						output.emitWatermark(new Watermark(Long.MAX_VALUE));
					}
				}
			}

			while (running) {
				StreamRecord<OUT> nextRecord = shouldWait ?
					dataChannel.poll(iterationWaitTime, TimeUnit.MILLISECONDS) :
					dataChannel.take();

				if (nextRecord != null) {
					synchronized (getCheckpointLock()) {
						for (RecordWriterOutput<OUT> output : outputs) {
							output.collect(nextRecord);
						}
					}
				}
				else {
					// done
					break;
				}
			}
		}
		finally {
			// make sure that we remove the queue from the broker, to prevent a resource leak
			BlockingQueueBroker.INSTANCE.remove(brokerID);
			LOG.info("Iteration head {} removed feedback queue under {}", getName(), brokerID);
		}
	}
147929
public void process(InstanceSet instSet) throws Exception {
		for(int i=0; i < instSet.size(); i++){
			Instance inst = instSet.getInstance(i);
			addThruPipe(inst);
		}
	}