updateNumContainers method
765030
public PackingPlanBuilder addInstance(Integer containerId,
                                        String componentName) throws ConstraintViolationException {
    // create container if not existed
    initContainer(containerId);

    Integer taskId = taskIds.isEmpty() ? 1 : taskIds.last() + 1;
    Integer componentIndex = componentIndexes.containsKey(componentName)
        ? componentIndexes.get(componentName).last() + 1 : 0;
    InstanceId instanceId = new InstanceId(componentName, taskId, componentIndex);

    Resource instanceResource = componentResourceMap.getOrDefault(componentName,
        defaultInstanceResource);

    Container container = containers.get(containerId);
    PackingPlan.InstancePlan instancePlan
        = new PackingPlan.InstancePlan(instanceId, instanceResource);

    // Check constraints
    for (InstanceConstraint constraint : instanceConstraints) {
      constraint.validate(instancePlan);
    }
    for (PackingConstraint constraint : packingConstraints) {
      constraint.validate(container, instancePlan);
    }
    addToContainer(container, instancePlan, this.componentIndexes, this.taskIds);

    LOG.finest(String.format("Added to container %d instance %s", containerId, instanceId));
    return this;
  }
863786
public void update(long v) {
    for (int i = 0; i < Pollers.NUM_POLLERS; ++i) {
      updateMin(i, v);
    }
  }
741385
function updateListToMP (vnodeList = [], val, forInfo, context) {
  let firstItem = vnodeList[0]
  let forKeys
  let list = []
  if (!firstItem) {
    vnodeList.push(new VNode('div'))
    firstItem = vnodeList[0]
  }

  /* istanbul ignore else */
  if (firstItem) {
    // collect v-key
    if (Array.isArray(firstItem)) {
      forKeys = firstItem.map(e => {
        const { attrs = {}} = e.data || /* istanbul ignore next */ {}
        const { k_ = '' } = attrs
        return k_
      })
    } else {
      const { attrs = {}} = firstItem.data || {}
      const { k_ = '' } = attrs
      forKeys = [k_]
    }

    forKeys = forKeys.filter(e => e)

    // generate list array with v-key value
    let valToList = []
    /* istanbul ignore else */
    if (Array.isArray(val) || typeof val === 'string') {
      valToList = new Array(val.length)
      for (let i = 0, l = val.length; i < l; i++) {
        valToList[i] = val[i]
      }
    } else if (typeof val === 'number') {
      valToList = new Array(val)
      for (let i = 0; i < val; i++) {
        valToList[i] = i
      }
    } else if (isObject(val)) {
      valToList = Object.keys(val).map((e, i) => i)
    }

    list = valToList.map((e, i) => {
      if (forKeys.length === 0) {
        return i
      }
      return forKeys.reduce((res, k) => {
        res[k.replace(/\./g, '_')] = getValue(val[i], k)
        return res
      }, {})
    })
  }

  const cloneVnode = {
    context,
    data: {
      attrs: { h_: forInfo[0], f_: forInfo[1] }
    }
  }

  // TODO: try not disable key diff in patching process
  // key will reuse existing vnode which won't update the vnode content
  // see unit test: with key
  // list won't update after this.list.reverse() if it's not disable

  // if is a scoped slot list
  if (firstItem && !firstItem.fn) {
    vnodeList.forEach(vnode => {
      if (Array.isArray(vnode)) {
        vnode.forEach(c => {
          delete c.key
        })
      } else {
        delete vnode.key
      }
    })
  }

  updateVnodeToMP(cloneVnode, HOLDER_TYPE_VARS.for, list)

  const fnStoreNode = Array.isArray(firstItem) ? firstItem[0] : firstItem

  if (fnStoreNode) {
    fnStoreNode.__renderListFn = function (vnode) {
      updateVnodeToMP(vnode || cloneVnode, HOLDER_TYPE_VARS.for, list)
    }

    fnStoreNode.__renderListVnode = cloneVnode
  }
}
1283436
def update_blocknumbers(blk)
      loop do
        if blk.number > 0
          @db.put_temporarily block_by_number_key(blk.number), blk.full_hash
        else
          @db.put block_by_number_key(blk.number), blk.full_hash
        end
        @db.commit_refcount_changes blk.number

        break if blk.number == 0

        blk = blk.get_parent()
        break if has_block_by_number(blk.number) && get_block_by_number(blk.number) == blk.full_hash
      end
    end
1311345
@Override
  protected void updateLocations(final NumberedSplit<InputSplit> numberedSplit) {
    final String location = numberedSplit.getLocation();
    addLocationMapping(locationToSplits, numberedSplit, location);
    final String normalizedLocation = normalize(location);
    addLocationMapping(partialLocationsToSplits, numberedSplit, normalizedLocation);
    normalizedLocations.add(normalizedLocation);
  }
167496
protected void insertNewKeyValueAt(int i, short key, Container value) {
    extendArray(1);
    System.arraycopy(keys, i, keys, i + 1, size - i);
    keys[i] = key;
    System.arraycopy(values, i, values, i + 1, size - i);
    values[i] = value;
    size++;
  }
529164
private void updateErrorContainerSize(double w, double errorContainerHeight) {
        errorContainerClip.setWidth(w);
        errorContainerClip.setHeight(errorContainerHeight);
        resize(w, errorContainerHeight);
    }
957205
public int update(List<ENTITY> entities) {

        if (entities == null || entities.size() == 0) {
            recordLog(" param entity is null!");
            return 0;
        }

        final List<Query> queries = queryGenerator.getUpdateQuery(entities);
        String sql = queries.get(0).getSql();
        jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {

            public void setValues(PreparedStatement stmt, int index) throws SQLException {
                int i = 1;
                List<Object> params = queries.get(index).getParams();
                for (Object o : params) {
                    stmt.setObject(i++, o);
                }
            }

            public int getBatchSize() {
                return queries.size();
            }
        });

        return entities.size();
    }
498525
private void updateRuntimeStatus() {

    final RuntimeStatusEventImpl.Builder builder = RuntimeStatusEventImpl.newBuilder()
        .setName(RUNTIME_NAME)
        .setState(State.RUNNING)
        .setOutstandingContainerRequests(this.containerRequestCounter.get());

    for (final String allocatedContainerId : this.containers.getContainerIds()) {
      builder.addContainerAllocation(allocatedContainerId);
    }

    this.reefEventHandlers.onRuntimeStatus(builder.build());
  }
812136
void updateCount() {
		if (this.hasChanged) {
			this.positionArray = ArrayUtils.toPrimitive(getPositionList()
					.toArray(new Long[0]));
			this.hasChanged = false;
		}
	}
518097
@Override
  public PackingPlan repack(PackingPlan currentPackingPlan, Map<String, Integer> componentChanges) {
    this.numContainers = currentPackingPlan.getContainers().size();
    resetToFirstContainer();

    int additionalContainers = computeNumAdditionalContainers(componentChanges, currentPackingPlan);
    if (additionalContainers > 0) {
      increaseNumContainers(additionalContainers);
      LOG.info(String.format(
          "Allocated %s additional containers for repack bring the number of containers to %s.",
          additionalContainers, this.numContainers));
    }

    while (true) {
      try {
        PackingPlanBuilder planBuilder = newPackingPlanBuilder(currentPackingPlan);
        planBuilder.updateNumContainers(numContainers);
        planBuilder = getResourceCompliantRRAllocation(planBuilder, componentChanges);

        return planBuilder.build();

      } catch (ConstraintViolationException e) {
        //Not enough containers. Adjust the number of containers.
        LOG.info(String.format(
            "%s Increasing the number of containers to %s and attempting to repack again.",
            e.getMessage(), this.numContainers + 1));
        retryWithAdditionalContainer();
      }
    }
  }
733665
protected void updateFileSet(FileSet 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, "directory", value.getDirectory(), null);
         findAndReplaceSimpleLists(innerCount, root, value.getIncludes(), "includes", "include");
         findAndReplaceSimpleLists(innerCount, root, value.getExcludes(), "excludes", "exclude");
      }
   }
705744
function (adContainerSettings, containerElement) {
    this.containerElement = containerElement;
    this._currentIndex = adContainerSettings.startIndex;

    this.childElements = Array.prototype.slice.call(this.containerElement.children);
    var interval = adContainerSettings.interval;
    if (!interval) {
        interval = this._calculateInterval(adContainerSettings.maxNumberOfAds);
    }

    this._startIndex = adContainerSettings.startIndex;
    this._interval = interval;
}
932474
public void update()
  {
    byte []code = new byte[_code.size()];

    System.arraycopy(_code.getBuffer(), 0, code, 0, _code.size());

    _codeAttr.setCode(code);

    if (_changeLength) {
      // XXX: really need more sophisticated solution
      ArrayList<Attribute> attrList = getCodeAttribute().getAttributes();
      for (int i = attrList.size() - 1; i >= 0; i--) {
        Attribute attr = attrList.get(i);

        if (attr.getName().equals("LineNumberTable"))
          attrList.remove(i);
      }
    }
  }
640670
function updateChildBounds() {
         this.childBounds.pos.set(Infinity, Infinity);
         this.childBounds.resize(-Infinity, -Infinity);
         var childBounds;

         for (var i = this.children.length, child; i--, child = this.children[i];) {
           if (child.isRenderable) {
             if (child instanceof me.Container) {
               childBounds = child.childBounds;
             } else {
               childBounds = child.getBounds();
             } // TODO : returns an "empty" rect instead of null (e.g. EntityObject)
             // TODO : getBounds should always return something anyway


             if (childBounds !== null) {
               this.childBounds.union(childBounds);
             }
           }
         }

         return this.childBounds;
       }
1268136
@Override
	public void updateInt(final String columnLabel, final int x) throws SQLException {
		wrapped.updateInt(columnLabel, x);
	}
1132482
public void updateBackupElements(Map<String, CmsContainerElementData> updateElements) {

        ArrayList<CmsContainerPageElementPanel> updatedList = new ArrayList<CmsContainerPageElementPanel>();
        String containerId = m_groupContainer.getContainerId();
        for (CmsContainerPageElementPanel element : m_backUpElements) {
            if (updateElements.containsKey(element.getId())
                && CmsStringUtil.isNotEmptyOrWhitespaceOnly(
                    updateElements.get(element.getId()).getContents().get(containerId))) {
                CmsContainerElementData elementData = updateElements.get(element.getId());
                try {
                    CmsContainerPageElementPanel replacer = m_controller.getContainerpageUtil().createElement(
                        elementData,
                        m_groupContainer,
                        false);
                    if (element.getInheritanceInfo() != null) {
                        // in case of inheritance container editing, keep the inheritance info
                        replacer.setInheritanceInfo(element.getInheritanceInfo());
                    }
                    updatedList.add(replacer);

                } catch (Exception e) {
                    // in this case keep the old version
                    updatedList.add(element);
                }
            } else {
                updatedList.add(element);
            }
        }
        m_backUpElements = updatedList;
    }