/* (non-Javadoc)
@see Continueable#registerLimit(long)
512436
@Override
    public void registerLimit(final long limit) {

        if (queues.size() > 0) {
            if (unlimited.get(currentQueue())
                         .get())
                limits.get(currentQueue())
                      .set(0);

            limits.get(currentQueue())
                  .addAndGet(limit);
            unlimited.get(currentQueue())
                     .set(false);

            queues.stream()
                  .forEach(this::closeQueueIfFinishedStateless);

        }
    }
1297718
public void setLimit(int limit) {
        FailureInterpreter fi = getFailureInterpreter();
        if (!(fi instanceof DefaultFailureInterpreter)) {
            throw new IllegalStateException("setLimit() not supported: this CircuitBreaker's FailureInterpreter isn't a DefaultFailureInterpreter.");
        }
        ((DefaultFailureInterpreter)fi).setLimit(limit);
    }
872331
void reset(int newOffset, int newLimit) {
        assert newOffset >= 0 && newOffset <= newLimit;
        assert newLimit <= array.length;
        this.offset=newOffset;
        this.limit=newLimit;
    }
356339
public void setLimit(int lim) {
        if(0<=lim && lim<=rep.length()) {
            limit=lim;
        } else {
            limit=rep.length();
        }
        reachedLimit=false;
    }
751747
protected function validateLimit(): void
    {
        $limit = $this->getArrayValue($this->joryArray, ['lmt', 'limit']);

        // No limit set, that's ok. return.
        if ($limit === null) {
            return;
        }

        if (! is_int($limit)) {
            throw new JoryException('The limit parameter should be an integer value. (Location: '.$this->address.'limit)');
        }
    }
1093425
@PublicEvolving
	public void setLong(ConfigOption<Long> key, long value) {
		setValueInternal(key.key(), value);
	}
262869
@Override
  public DurationFormatterFactory setFallbackLimit(long fallbackLimit) {
    if (fallbackLimit < 0) {
      fallbackLimit = 0;
    }
    if (fallbackLimit != this.fallbackLimit) {
      this.fallbackLimit = fallbackLimit;
      reset();
    }
    return this;
  }
870531
protected void fill() throws IOException 
    {
        if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.logp(Level.FINE, CLASS_NAME,"fill", "fill");
        } 
        
        // PK79219 Start
        long longLeft = limit-total;
        int len;
    	if (longLeft>Integer.MAX_VALUE)
    		len = buf.length;
    	else
            len = Math.min(buf.length, (int)longLeft);
    	// PK79219 End	
    	
        if ( len > 0 )
        {
            len = in.read(buf, 0, len);
            if ( len > 0 )
            {
                pos = 0;
                count = len;
            }
        }
    }
177391
@com.fasterxml.jackson.annotation.JsonProperty("limitType")
    public void setLimitType(String limitType) {
        this.limitType = limitType;
    }
600019
@Override
    public void setLimitOfTokenSize(int size) {
        if (0 >= size) {
            throw new IllegalArgumentException("Invalid limit on token size: " + size);
        }
        this.limitTokenSize = size;
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Limit on token size now: " + this.limitTokenSize);
        }
    }
1144227
@Override
    public WsByteBuffer limit(int newLimit) {
        if (isFCEnabled()) {
            String errorMsg = null;
            if (newLimit > fcSize) {
                errorMsg = "Requested value for the WsByteBuffer limit was greater than the capacity";
            } else if (newLimit < 0) {
                errorMsg = "Requested value for the WsByteBuffer limit was less than 0";
            }
            if (errorMsg != null) {
                IllegalArgumentException iae = new IllegalArgumentException(errorMsg);
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, errorMsg);
                }
                FFDCFilter.processException(iae, CLASS_NAME + ".limit(int)", "625", this);
                throw iae;
            }
            // set our FC limit
            this.fcLimit = newLimit;
            return this;
        }
        return super.limit(newLimit);
    }
597527
private long calculateLimit(ScanQuery query, Map<String, Object> responseContext)
  {
    if (query.getOrder().equals(ScanQuery.Order.NONE)) {
      return query.getLimit() - (long) responseContext.get(ScanQueryRunnerFactory.CTX_COUNT);
    }
    return query.getLimit();
  }
739288
private void writeLong(long value)
		throws IOException
	{
		if(value < 0)
		{
			out.write(TAG_NEGATIVE_LONG);
			writeLongNoTag(- value);
		}
		else
		{
			out.write(TAG_POSITIVE_LONG);
			writeLongNoTag(value);
		}
	}
1865
public void setLong(Long value) {
		this.checkNull(value);
		list.add(value);
		type.add(Long.class);
	}
372673
protected void validateLong(int index, long min, long max, String errorKey, String errorMessage) {
		String value = controller.getPara(index);
		if (value != null && (value.startsWith("N") || value.startsWith("n"))) {
			value = "-" + value.substring(1);
		}
		validateLongValue(value, min, max, errorKey, errorMessage);
	}
137719
private void setLimit(int from, int size) {
		request.setFrom(from);

		if (size > -1) {
			request.setSize(size);
		}
	}
295016
public void resetLimits() {
        maxLength = Long.MAX_VALUE;
        timeoutMs = Long.MAX_VALUE;
        maxRateBytesPerMs = Long.MAX_VALUE;
    }