Certain checks need to run in a particular order. For example, the PolymerPass
will not work correctly unless it runs after the goog.provide() processing.
This enforces those constraints.
@param checks The list of check passes
505124
private void assertValidOrderForChecks(List<PassFactory> checks) {
    assertPassOrder(
        checks,
        chromePass,
        checkJsDocAndEs6Modules,
        "The ChromePass must run before after JsDoc and Es6 module checking.");
    assertPassOrder(
        checks,
        closureRewriteModule,
        processDefines,
        "Must rewrite goog.module before processing @define's, so that @defines in modules work.");
    assertPassOrder(
        checks,
        closurePrimitives,
        polymerPass,
        "The Polymer pass must run after goog.provide processing.");
    assertPassOrder(
        checks,
        chromePass,
        polymerPass,
        "The Polymer pass must run after ChromePass processing.");
    assertPassOrder(
        checks,
        polymerPass,
        suspiciousCode,
        "The Polymer pass must run before suspiciousCode processing.");
    assertPassOrder(
        checks,
        dartSuperAccessorsPass,
        TranspilationPasses.es6ConvertSuper,
        "The Dart super accessors pass must run before ES6->ES3 super lowering.");

    if (checks.contains(closureGoogScopeAliases)) {
      checkState(
          checks.contains(checkVariableReferences),
          "goog.scope processing requires variable checking");
    }
    assertPassOrder(
        checks,
        checkVariableReferences,
        closureGoogScopeAliases,
        "Variable checking must happen before goog.scope processing.");

    assertPassOrder(
        checks,
        gatherModuleMetadataPass,
        closureCheckModule,
        "Need to gather module metadata before checking closure modules.");

    assertPassOrder(
        checks,
        gatherModuleMetadataPass,
        createModuleMapPass,
        "Need to gather module metadata before scanning modules.");

    assertPassOrder(
        checks,
        createModuleMapPass,
        rewriteCommonJsModules,
        "Need to gather module information before rewriting CommonJS modules.");

    assertPassOrder(
        checks,
        rewriteScriptsToEs6Modules,
        gatherModuleMetadataPass,
        "Need to gather module information after rewriting scripts to modules.");

    assertPassOrder(
        checks,
        checkClosureImports,
        rewriteClosureImports,
        "Closure imports must be checked before they are rewritten.");

    assertPassOrder(
        checks,
        j2clPass,
        TranspilationPasses.rewriteGenerators,
        "J2CL normalization should be done before generator re-writing.");
  }
386766
@Transactional(propagation = Propagation.REQUIRES_NEW)
    public void check() {
        LOGGER.debug("Auto assigned check call");

        final PageRequest pageRequest = PageRequest.of(0, PAGE_SIZE);

        final Page<TargetFilterQuery> filterQueries = targetFilterQueryManagement.findWithAutoAssignDS(pageRequest);

        for (final TargetFilterQuery filterQuery : filterQueries) {
            checkByTargetFilterQueryAndAssignDS(filterQuery);
        }

    }
658215
public final void ensureOrder(TotalOrderRemoteTransactionState state, Collection<?> keysModified) throws InterruptedException {
      //the retries due to state transfer re-uses the same state. we need that the keys previous locked to be release
      //in order to insert it again in the keys locked.
      //NOTE: this method does not need to be synchronized because it is invoked by a one thread at the time, namely
      //the thread that is delivering the messages in total order.
      state.awaitUntilReset();
      TotalOrderLatch transactionSynchronizedBlock = new TotalOrderLatchImpl(state.getGlobalTransaction().globalId());
      state.setTransactionSynchronizedBlock(transactionSynchronizedBlock);
         //this will collect all the count down latch corresponding to the previous transactions in the queue
         for (Object key : keysModified) {
            TotalOrderLatch prevTx = keysLocked.put(key, transactionSynchronizedBlock);
            if (prevTx != null) {
               state.addSynchronizedBlock(prevTx);
            }
            state.addLockedKey(key);

      }

      TotalOrderLatch stateTransfer = stateTransferInProgress.get();
      if (stateTransfer != null) {
         state.addSynchronizedBlock(stateTransfer);
      }

      if (trace) {
         log.tracef("Transaction [%s] will wait for %s and locked %s", state.getGlobalTransaction().globalId(),
                    state.getConflictingTransactionBlocks(), state.getLockedKeys() == null ? "[ClearCommand]" :
               state.getLockedKeys());
      }
   }
1284617
def set_checks(self, checks, position=None):
        """"""
        if position is None:
            position = self.position
        self.checkdefs[position][0] = checks
482322
@Override
    public void checkin(K key, V resource) {
        super.checkin(key, resource);
        // NB: Blocking checkout calls for synchronous requests get the resource
        // checked in above before processQueueLoop() attempts checkout below.
        // There is therefore a risk that asynchronous requests will be starved.
        processQueueLoop(key);
    }
1307269
public void check(ReferenceDescriptorDef refDef, String checkLevel) throws ConstraintException
    {
        ensureClassRef(refDef, checkLevel);
        checkProxyPrefetchingLimit(refDef, checkLevel);
    }
905748
private void checkTransactions(final int height, final EnumSet<VerifyFlag> flags)
            throws VerificationException {
        // The first transaction in a block must always be a coinbase transaction.
        if (!transactions.get(0).isCoinBase())
            throw new VerificationException("First tx is not coinbase");
        if (flags.contains(Block.VerifyFlag.HEIGHT_IN_COINBASE) && height >= BLOCK_HEIGHT_GENESIS) {
            transactions.get(0).checkCoinBaseHeight(height);
        }
        // The rest must not be.
        for (int i = 1; i < transactions.size(); i++) {
            if (transactions.get(i).isCoinBase())
                throw new VerificationException("TX " + i + " is coinbase when it should not be.");
        }
    }
785290
@Override
    public void commitChanges(SynchronizationBarrier barrier) throws JMSException
    {
    	checkNotClosed();
    	checkTransactionLock();
    	
    	if (!committables.isEmpty())
        {
    		long start = System.currentTimeMillis();
    		
    		Iterator<Committable> allCommitables = committables.iterator();
        	while (allCommitables.hasNext())
        	{
        		Committable committable = allCommitables.next();
        		committable.commitChanges(barrier);
        	}
        	
        	long end = System.currentTimeMillis();
        	notifyCommitTime(end-start);
        	
        	pendingChanges = false;
        }
    }
1230827
public void setChecked(boolean checked) {
        setChecked(checked ? CheckableDrawable.CheckedState.CHECKED : CheckableDrawable.CheckedState.UNCHECKED);
    }
404233
public void processPlainSelect(PlainSelect plainSelect) {
        if (!orderByHashParameters(plainSelect.getOrderByElements())) {
            plainSelect.setOrderByElements(null);
        }
        if (plainSelect.getFromItem() != null) {
            processFromItem(plainSelect.getFromItem());
        }
        if (plainSelect.getJoins() != null && plainSelect.getJoins().size() > 0) {
            List<Join> joins = plainSelect.getJoins();
            for (Join join : joins) {
                if (join.getRightItem() != null) {
                    processFromItem(join.getRightItem());
                }
            }
        }
    }
1175440
public NewServiceEntry checks(List<NewCheck> checks) {
        if (checks != null) {
            this.checks.addAll(checks);
        }
        return this;
    }
975153
private void checkExactlyTheWeeksCheckBoxes(Collection<WeekOfMonth> weeksToCheck) {

        for (CmsCheckBox cb : m_checkboxes) {
            cb.setChecked(weeksToCheck.contains(WeekOfMonth.valueOf(cb.getInternalValue())));
        }
    }
1236258
private void performChecks(Contextual<?> contextual) {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "performChecks", this);

        if (!isActive()) {
            throw new ContextNotActiveException();
        }

        if (contextual == null) {
            throw new IllegalArgumentException("Contextual parameter should not be null");
        }

        if (tc.isEntryEnabled())
            Tr.exit(tc, "performChecks");
    }
1320066
public void check(FieldDescriptorDef fieldDef, String checkLevel) throws ConstraintException
    {
        ensureColumn(fieldDef, checkLevel);
        ensureJdbcType(fieldDef, checkLevel);
        ensureConversion(fieldDef, checkLevel);
        ensureLength(fieldDef, checkLevel);
        ensurePrecisionAndScale(fieldDef, checkLevel);
        checkLocking(fieldDef, checkLevel);
        checkSequenceName(fieldDef, checkLevel);
        checkId(fieldDef, checkLevel);
        if (fieldDef.isAnonymous())
        {
            checkAnonymous(fieldDef, checkLevel);
        }
        else
        {
            checkReadonlyAccessForNativePKs(fieldDef, checkLevel);
        }
    }
155434
public static boolean sanityCheck(int flags) {
		doCheck(flags, ConformanceFlags.CHECKED | ConformanceFlags.UNCHECKED);
		if ((flags & ConformanceFlags.UNCHECKED) == 0) {
			doCheck(flags, ConformanceFlags.CHECK_RESULTS);
		} else if ((flags & (ConformanceFlags.SEALED | ConformanceFlags.CHECK_RESULTS)) != 0) {
			throw new IllegalArgumentException("Invalid flags: " + toString(flags));
		}
		return true;
	}
897341
public void checkSubTree(TreePath tp, boolean check) {
        CheckedNode cn = nodesCheckingState.get(tp);
        cn.isSelected = check;
        DefaultMutableTreeNode node = (DefaultMutableTreeNode) tp.getLastPathComponent();
        for (int i = 0 ; i < node.getChildCount() ; i++) {              
            checkSubTree(tp.pathByAddingChild(node.getChildAt(i)), check);
        }
        cn.allChildrenSelected = check;
        if (check) {
            checkedPaths.add(tp);
        } else {
            checkedPaths.remove(tp);
        }
        updatePredecessorsAllChildrenSelectedState(tp);
    }
817212
public void check(ClassDescriptorDef classDef, String checkLevel) throws ConstraintException
    {
        ensureNoTableInfoIfNoRepositoryInfo(classDef, checkLevel);
        checkModifications(classDef, checkLevel);
        checkExtents(classDef, checkLevel);
        ensureTableIfNecessary(classDef, checkLevel);
        checkFactoryClassAndMethod(classDef, checkLevel);
        checkInitializationMethod(classDef, checkLevel);
        checkPrimaryKey(classDef, checkLevel);
        checkProxyPrefetchingLimit(classDef, checkLevel);
        checkRowReader(classDef, checkLevel);
        checkObjectCache(classDef, checkLevel);
        checkProcedures(classDef, checkLevel);
    }