Sets the replace var map to single target from map.

@param replacementVarMapNodeSpecific
the replacement var map node specific
@param uniformTargetHost
the uniform target host
@return the parallel task builder
359332
public ParallelTaskBuilder setReplaceVarMapToSingleTargetFromMap(
            Map<String, StrStrMap> replacementVarMapNodeSpecific,
            String uniformTargetHost) {
        setReplacementVarMapNodeSpecific(replacementVarMapNodeSpecific);

        if (Strings.isNullOrEmpty(uniformTargetHost)) {
            logger.error("uniform target host is empty or null. skip setting.");
            return this;
        }
        for (Entry<String, StrStrMap> entry : replacementVarMapNodeSpecific
                .entrySet()) {

            if (entry.getValue() != null) {
                entry.getValue().addPair(PcConstants.UNIFORM_TARGET_HOST_VAR,
                        uniformTargetHost);
            }
        }
        return this;
    }
63684
public static String replacePlaceHoldersInTemplate(final String template, final Map<String, String> replacementMap) {

		List<String> toReplace = new ArrayList<>();
		List<String> replaceBy = new ArrayList<>();

		for (Entry<String, String> property : replacementMap.entrySet()) {

			toReplace.add(property.getKey());
			replaceBy.add(property.getValue());

		}

		return StringUtils.replaceEachRepeatedly(template, toReplace.toArray(new String[toReplace.size()]), replaceBy.toArray(new String[replaceBy.size()]));

	}
746355
private Optional<InjectiveVar2VarSubstitution> computeRenamingSubstitution(
            DistinctVariableOnlyDataAtom sourceProjectionAtom,
            DistinctVariableOnlyDataAtom targetProjectionAtom) {

        int arity = sourceProjectionAtom.getEffectiveArity();

        if (!sourceProjectionAtom.getPredicate().equals(targetProjectionAtom.getPredicate())
                || (arity != targetProjectionAtom.getEffectiveArity())) {
            return Optional.empty();
        }
        else {
            ImmutableMap<Variable, Variable> newMap = FunctionalTools.zip(
                    sourceProjectionAtom.getArguments(),
                    targetProjectionAtom.getArguments()).stream()
                    .distinct()
                    .filter(e -> !e.getKey().equals(e.getValue()))
                    .collect(ImmutableCollectors.toMap());

            return Optional.of(substitutionFactory.getInjectiveVar2VarSubstitution(newMap));
        }
    }
1035249
private String buildClientVariantUrl(String context, CmsClientVariantInfo info) {

        String currentUrl = Window.Location.getHref();
        // remove fragment
        currentUrl = currentUrl.replaceFirst("#.*$", "");
        String connector = "?";
        if (currentUrl.indexOf('?') >= 0) {
            connector = "&";
        }
        String targetUrl = currentUrl + connector + CmsGwtConstants.PARAM_TEMPLATE_CONTEXT + "=" + context;
        return targetUrl;
    }
50714
public static boolean isVariableReplacementPattern(final String value) {
    final Matcher matcher = VARIABLE_REPLACEMENT_PATTERN.matcher(value);
    return matcher.matches();
  }
494913
public Task revertToCurrentSnapshot_Task(HostSystem host, Boolean suppressPowerOn) throws VmConfigFault, SnapshotFault, TaskInProgress, InvalidState, InsufficientResourcesFault, NotFound, RuntimeFault, RemoteException {
        ManagedObjectReference mor = getVimService().revertToCurrentSnapshot_Task(getMOR(), host == null ? null : host.getMOR(), suppressPowerOn);
        return new Task(getServerConnection(), mor);
    }
731995
public static SuggestedFix renameVariable(
      VariableTree tree, final String replacement, VisitorState state) {
    String name = tree.getName().toString();
    int typeEndPos = state.getEndPosition(tree.getType());
    // handle implicit lambda parameter types
    int searchOffset = typeEndPos == -1 ? 0 : (typeEndPos - ((JCTree) tree).getStartPosition());
    int pos =
        ((JCTree) tree).getStartPosition()
            + state.getSourceForNode(tree).indexOf(name, searchOffset);
    final SuggestedFix.Builder fix =
        SuggestedFix.builder().replace(pos, pos + name.length(), replacement);
    final Symbol.VarSymbol sym = getSymbol(tree);
    ((JCTree) state.getPath().getCompilationUnit())
        .accept(
            new TreeScanner() {
              @Override
              public void visitIdent(JCTree.JCIdent tree) {
                if (sym.equals(getSymbol(tree))) {
                  fix.replace(tree, replacement);
                }
              }

              @Override
              public void visitSelect(JCTree.JCFieldAccess tree) {
                if (sym.equals(getSymbol(tree))) {
                  fix.replace(
                      state.getEndPosition(tree.getExpression()),
                      state.getEndPosition(tree),
                      "." + replacement);
                }
                super.visitSelect(tree);
              }
            });
    return fix.build();
  }
436845
public void replace(SimpleTest test, Object target) {
    for (int i = 0; i < size; i++)
      if (ranges[i].correspondsTo(test)) {
        ranges[i].target = target;
        return;
      }
    throw new IllegalStateException();
  }
326803
@Override
    public List<String> setTargetHostsFromCmsQueryUrl(String cmsQueryUrl,
            String projection, String token) {

        List<String> targetHosts = new ArrayList<String>();

        try {

            if (projection == null || projection.isEmpty()) {
                logger.info("will use default project label");
                projection = "label";
            }
            TargetHostsBuilderHelperCms helper = new TargetHostsBuilderHelperCms();
            targetHosts = helper.getNodeListCompleteURLForCMS(cmsQueryUrl,
                    projection, token);

        } catch (Exception e) {
            throw new TargetHostsLoadException("error when reading  "
                    + cmsQueryUrl, e);
        }

        return targetHosts;

    }
1353789
static Function<String, String> createAnnotationReplacer(final Map<String, Object> map) {
    return from -> {
      final Object object = map.get(from);
      return object == null ? null : object.toString();
    };
  }
1141990
public void setTargetPlatform(com.google.api.ads.admanager.axis.v201811.TargetPlatform targetPlatform) {
        this.targetPlatform = targetPlatform;
    }
512075
protected void updateDeploymentRepository(DeploymentRepository value, String xmlTag, Counter counter,
            Element element)
   {
      boolean shouldExist = value != null;
      Element root = updateElement(counter, element, xmlTag, shouldExist);
      if (shouldExist)
      {
         Counter innerCount = new Counter(counter.getDepth() + 1);
         findAndReplaceSimpleElement(innerCount, root, "uniqueVersion",
                  (value.isUniqueVersion() == true) ? null : String.valueOf(value.isUniqueVersion()), "true");
         findAndReplaceSimpleElement(innerCount, root, "id", value.getId(), null);
         findAndReplaceSimpleElement(innerCount, root, "name", value.getName(), null);
         findAndReplaceSimpleElement(innerCount, root, "url", value.getUrl(), null);
         findAndReplaceSimpleElement(innerCount, root, "layout", value.getLayout(), "default");
      }
   }
638931
public static Map<IntVar, VM> makePlacementMap(ReconfigurationProblem rp) {
        Map<IntVar, VM> m = new HashMap<>(rp.getFutureRunningVMs().size());
        for (VM vm : rp.getFutureRunningVMs()) {
            IntVar v = rp.getVMAction(vm).getDSlice().getHoster();
            m.put(v, vm);
        }
        return m;
    }
529863
static ImmutableList<DestructuredTarget> createAllNonEmptyTargetsInPattern(
      JSTypeRegistry registry, Supplier<JSType> patternType, Node pattern) {
    checkArgument(pattern.isDestructuringPattern(), pattern);
    ImmutableList.Builder<DestructuredTarget> builder = ImmutableList.builder();
    for (Node child : pattern.children()) {
      if (child.isEmpty()) {
        continue;
      }

      builder.add(createTarget(registry, patternType, child));
    }
    return builder.build();
  }
202250
public Task reconnectHost_Task(HostConnectSpec cnxSpec, HostSystemReconnectSpec reconnectSpec) throws InvalidName, InvalidLogin, InvalidState, HostConnectFault, RuntimeFault, RemoteException {
        ManagedObjectReference mor = getVimService().reconnectHost_Task(getMOR(), cnxSpec, reconnectSpec);
        return new Task(getServerConnection(), mor);
    }
424417
public ParallelTaskBuilder setTargetHostsFromJsonPath(String jsonPath,
            String sourcePath, HostsSourceType sourceType)
            throws TargetHostsLoadException {

        this.targetHosts = targetHostBuilder.setTargetHostsFromJsonPath(jsonPath, sourcePath,
                sourceType);
        return this;

    }
1200592
private void replaceArrayPattern(
      NodeTraversal t, Node arrayPattern, Node rhs, Node parent, Node nodeToDetach) {

    if (rewriteMode == ObjectDestructuringRewriteMode.REWRITE_OBJECT_REST) {
      if (patternNestingStack.isEmpty() || !patternNestingStack.peekLast().hasNestedObjectRest) {
        return;
      }
    }

    String tempVarName = getTempVariableName();
    Node makeIteratorCall = astFactory.createJSCompMakeIteratorCall(rhs.detach(), t.getScope());
    Node tempVarModel = astFactory.createName(tempVarName, makeIteratorCall.getJSType());
    Node tempDecl = IR.var(tempVarModel.cloneNode(), makeIteratorCall);
    tempDecl.useSourceInfoIfMissingFromForTree(arrayPattern);
    nodeToDetach.getParent().addChildBefore(tempDecl, nodeToDetach);

    for (Node child = arrayPattern.getFirstChild(), next; child != null; child = next) {
      next = child.getNext();
      if (child.isEmpty()) {
        // Just call the next() method to advance the iterator, but throw away the value.
        Node nextCall =
            IR.exprResult(
                astFactory.createCall(astFactory.createGetProp(tempVarModel.cloneNode(), "next")));
        nextCall.useSourceInfoIfMissingFromForTree(child);
        nodeToDetach.getParent().addChildBefore(nextCall, nodeToDetach);
        continue;
      }

      Node newLHS;
      Node newRHS;
      if (child.isDefaultValue()) {
        //   [x = defaultValue] = rhs;
        // becomes
        //   var temp0 = $jscomp.makeIterator(rhs);
        //   var temp1 = temp.next().value
        //   x = (temp1 === undefined) ? defaultValue : temp1;
        String nextVarName = getTempVariableName();
        // `temp.next().value`
        Node nextCallDotValue =
            astFactory.createGetProp(
                astFactory.createCall(astFactory.createGetProp(tempVarModel.cloneNode(), "next")),
                "value");
        JSType nextVarType = nextCallDotValue.getJSType();
        // `var temp1 = temp.next().value`
        Node var = IR.var(astFactory.createName(nextVarName, nextVarType), nextCallDotValue);
        var.useSourceInfoIfMissingFromForTree(child);
        nodeToDetach.getParent().addChildBefore(var, nodeToDetach);

        // `x`
        newLHS = child.getFirstChild().detach();
        // `(temp1 === undefined) ? defaultValue : temp1;
        newRHS =
            defaultValueHook(
                astFactory.createName(nextVarName, nextVarType), child.getLastChild().detach());
      } else if (child.isRest()) {
        //   [...x] = rhs;
        // becomes
        //   var temp = $jscomp.makeIterator(rhs);
        //   x = $jscomp.arrayFromIterator(temp);
        newLHS = child.getFirstChild().detach();
        newRHS =
            astFactory.createJscompArrayFromIteratorCall(tempVarModel.cloneNode(), t.getScope());
      } else {
        // LHS is just a name (or a nested pattern).
        //   var [x] = rhs;
        // becomes
        //   var temp = $jscomp.makeIterator(rhs);
        //   var x = temp.next().value;
        newLHS = child.detach();
        newRHS =
            astFactory.createGetProp(
                astFactory.createCall(astFactory.createGetProp(tempVarModel.cloneNode(), "next")),
                "value");
      }
      Node newNode;
      if (parent.isAssign()) {
        Node assignment = astFactory.createAssign(newLHS, newRHS);
        newNode = IR.exprResult(assignment);
      } else {
        newNode = IR.declaration(newLHS, newRHS, parent.getToken());
      }
      newNode.useSourceInfoIfMissingFromForTree(arrayPattern);

      nodeToDetach.getParent().addChildBefore(newNode, nodeToDetach);
      // Explicitly visit the LHS of the new node since it may be a nested
      // destructuring pattern.
      visit(t, newLHS, newLHS.getParent());
    }

    nodeToDetach.detach();
    t.reportCodeChange();
  }