/*
Check that various invariants are maintained. If they aren't log the error at most once,
and take corrective action to maintain the invariants
338509
private void checkAndLogInvariants() {
        if (m_pendingTxnCount < 0 || m_pendingTxnBytes < 0) {
            boolean badTxnCount = m_pendingTxnCount < 0 ? true : false;
            boolean badPendingBytes = m_pendingTxnBytes < 0 ? true : false;
            if (!m_haveLoggedACGNegativeFailure) {
                m_haveLoggedACGNegativeFailure = true;
                if (badTxnCount) {
                    networkLog.error("Admission control error, negative outstanding transaction count. " +
                            "This is error is not fatal, but it does indicate that admission control " +
                            "is not correctly tracking transaction resource usage. This message will not repeat " +
                            "the next time the condition occurs to avoid log spam");
                }
                if (badPendingBytes) {
                    networkLog.error(
                            "Backpressure reports a negative outstanding transaction byte count (" +
                            m_pendingTxnBytes +
                            "). No action required.", new RuntimeException("for stack trace purposes"));
                }
            }

            /*
             * Repair both. It's possible that repairing it will trigger a repair cascade
             * effectively rendering the ACG always permissive, but it should right itself
             * once all requests associated with the ACG have left the system and the correct values are indeed 0.
             */
            m_pendingTxnCount = 0;
            m_pendingTxnBytes = 0;
        }
    }
492727
protected final void verify() {
        collectInitialisers();
        verifyCandidates();
        verifyInitialisers();
        collectPossibleInitialValues();
        verifyPossibleInitialValues();
        collectEffectiveAssignmentInstructions();
        verifyEffectiveAssignmentInstructions();
        collectAssignmentGuards();
        verifyAssignmentGuards();
        end();
    }
888144
function checkForAssertionErrors(args) {
  const isAssertion =
    args &&
    args.length > 0 &&
    typeof args[0] === 'object' &&
    args[0] !== null &&
    args[0].name === 'AssertionError';

  if (isAssertion) {
    args = Array.prototype.slice.call(args);
    args.unshift(`assert(${args[0].message})`);
  }
  return args;
}
743612
private void checkDependencies() {
    if (basedOnResult != null) {
      if (!input.isComplete() || !algs.isComplete() || basedOnResult.get() != algs.getAlgorithmStep().getResult()) {
        // We've become invalidated, notify.
        basedOnResult = null;
        firePanelUpdated();
      }
    }
  }
220901
function checkRegistry(registry, key, path){
		if (registry[key] == undefined){
			throw new Error('Dependency not found: ' + key + ' in ' + path);
		}
	}
712191
private int healthCheckFailed() {
        int oldState, newState;
        for (;;) {
            oldState = this.state;
            if ((oldState & ERROR) != ERROR) {
                newState = oldState | ERROR;
                UndertowLogger.ROOT_LOGGER.nodeIsInError(jvmRoute);
            } else if ((oldState & ERROR_MASK) == ERROR_MASK) {
                return ERROR_MASK;
            } else {
                newState = oldState +1;
            }
            if (stateUpdater.compareAndSet(this, oldState, newState)) {
                return newState & ERROR_MASK;
            }
        }
    }
605590
private function checkAndRegisterSortingError(): void
    {
        $orgTokens = $this->getTagTokens();
        $sortedTokens = $this->sortTokens($orgTokens);

        if (array_values($orgTokens) !== $sortedTokens) {
            $error = (new CodeWarning(
                static::CODE_WRONG_TAG_SORTING,
                self::MESSAGE_WRONG_TAG_SORTING,
                array_shift($orgTokens)['pointer']
            ))->setToken($this->token);

            $error->isFixable(true);

            throw $error;
        }
    }
501133
private void checkNormalization(Node externs, Node root) {
    // Verify nothing has inappropriately denormalize the AST.
    CodeChangeHandler handler = new ForbiddenChange();
    compiler.addChangeHandler(handler);

    // TODO(johnlenz): Change these normalization checks Preconditions and
    // Exceptions into Errors so that it is easier to find the root cause
    // when there are cascading issues.
    new PrepareAst(compiler, true).process(null, root);
    if (compiler.getLifeCycleStage().isNormalized()) {
      (new Normalize(compiler, true)).process(externs, root);

      if (compiler.getLifeCycleStage().isNormalizedUnobfuscated()) {
        boolean checkUserDeclarations = true;
        CompilerPass pass = new Normalize.VerifyConstants(compiler, checkUserDeclarations);
        pass.process(externs, root);
      }
    }

    compiler.removeChangeHandler(handler);
  }
922460
public void checkExpectedValidationViolations(
			Set<ConstraintViolation<T>> violations,
			List<String> expectedValidationViolations) {

		if (violations != null && expectedValidationViolations != null) {

			List<String> givenViolations = new ArrayList<String>();
			for (ConstraintViolation<T> violation : violations) {
				givenViolations.add(violation.getMessageTemplate());
			}

			checkViolations(givenViolations, expectedValidationViolations);
		}

	}
1167053
public void checkInvariants(CallStack frame, Expr... invariants) {
		for (int i = 0; i != invariants.length; ++i) {
			RValue.Bool b = executeExpression(BOOL_T, invariants[i], frame);
			if (b == RValue.False) {
				// FIXME: need to do more here
				throw new AssertionError();
			}
		}
	}
386398
function verifyOthers() {
      if ( !isTypeString(options.commit) ) {
        errorOption('commit', options.commit);
      }
      if ( !isTypeString(options.tag) ) {
        errorOption('tag', options.tag);
      }
    }
596020
def check_lifecycle(self):
        
        with self._lock:
            # Validation flags
            was_valid = self.state == StoredInstance.VALID
            can_validate = self.state not in (
                StoredInstance.VALIDATING,
                StoredInstance.VALID,
            )

            # Test the validity of all handlers
            handlers_valid = self.__safe_handlers_callback(
                "is_valid", break_on_false=True
            )

            if was_valid and not handlers_valid:
                # A dependency is missing
                self.invalidate(True)
            elif (
                can_validate and handlers_valid and self._ipopo_service.running
            ):
                # We're all good
                self.validate(True)
249723
function shouldBeChecked(actionType: string): bool {
  if(actionType === LIST_ITEM_CHECK)    return true;
  if(actionType === LIST_ITEM_UNCHECK)  return false;

  throw new Error(`Invalid action type ${actionType}`);
}
28700
protected void checkShrink ()
    {
        if ((_buckets.length > DEFAULT_BUCKETS) &&
                (_size < (int) (_buckets.length * _loadFactor * .125))) {
            resizeBuckets(Math.max(DEFAULT_BUCKETS, _buckets.length >> 1));
        }
    }
384518
def CheckRepeatLogic(filename, linenumber, clean_lines, errors):
    
    line = clean_lines.lines[linenumber]
    for cmd in _logic_commands:
        if re.search(r'\b%s\b'%cmd, line.lower()):
            m = _RE_LOGIC_CHECK.search(line)
            if m:
                errors(filename, linenumber, 'readability/logic',
                        'Expression repeated inside %s; '
                        'better to use only %s()'%(cmd, m.group(1)))
            break
1156930
def check_methods(self, resource):
        ''''''
        checker = ResourceMethodChecker()
        errors = []
        for callback in resource.callbacks:
            new_errors = checker(callback)
            if new_errors:
                errors.extend(new_errors)
        return errors
344930
public void check()
    {
        for (AnnotationTypeDeclaration atd : _atds)
        {
            Collection<Declaration> decls = getAnnotationProcessorEnvironment().getDeclarationsAnnotatedWith(atd);
            for (Declaration decl : decls)
            {
                check(decl);
            }
        }
    }