CHECKSTYLE:OFF:RedundantThrows
775083
public static Locale parseArg(@NotNull final String name, @NotNull final String value) throws ConstraintViolationException {
        // CHECKSTYLE:ON

        try {
            final Locale locale = LocaleConverter.asLocale(value);
            if (!LocaleConverter.validLocale(locale)) {
                throw new ConstraintViolationException("The argument '" + name + "' is not valid: '" + value + "'");
            }
            return locale;
        } catch (final RuntimeException ex) {
            throw new ConstraintViolationException("The argument '" + name + "' is not valid: '" + value + "'");
        }

    }
972138
void rhs( RuleDescrBuilder rule ) {
        defaultConsequence(rule);
        while (input.LA(1) != DRL6Lexer.EOF && helper.validateIdentifierKey(DroolsSoftKeywords.THEN)) {
            namedConsequence(rule);
        }
    }
640221
private void checkInheritedRelativePaths( ClassDeclaration jclass )
            throws FatalCompileTimeException
    {
        for ( ClassType type = jclass.getSuperclass();
              type != null && CompilerUtils.isAssignableFrom( FLOWCONTROLLER_BASE_CLASS, type, getEnv() );
              type = type.getSuperclass() )
        {
            TypeDeclaration decl = CompilerUtils.getDeclaration( type );
            
            //
            // Check simple actions in the Controller annotation.
            //
            List simpleActions =
                    CompilerUtils.getAnnotationArrayValue( decl, CONTROLLER_TAG_NAME, SIMPLE_ACTIONS_ATTR, true );
            
            if ( simpleActions != null )
            {
                for ( Iterator j = simpleActions.iterator(); j.hasNext(); )  
                {
                    AnnotationInstance i = ( AnnotationInstance ) j.next();
                    checkRelativePath( i, PATH_ATTR, jclass, decl, false );
                    List conditionalForwards = CompilerUtils.getAnnotationArray( i, CONDITIONAL_FORWARDS_ATTR, true );
                    
                    if ( conditionalForwards != null )
                    {
                        for ( Iterator k = conditionalForwards.iterator(); k.hasNext(); )  
                        {
                            AnnotationInstance ann = ( AnnotationInstance ) k.next();
                            checkRelativePath( ann, PATH_ATTR, jclass, decl, false );
                        }
                    }
                }
            }
            
            //
            // Check Forwards in the Controller annotation.
            //
            List forwards = CompilerUtils.getAnnotationArrayValue( decl, CONTROLLER_TAG_NAME, FORWARDS_ATTR, true );
            
            if ( forwards != null )
            {
                for ( Iterator ii = forwards.iterator(); ii.hasNext(); )  
                {
                    AnnotationInstance i = ( AnnotationInstance ) ii.next();
                    checkRelativePath( i, PATH_ATTR, jclass, decl, false );
                }
            }
            
            //
            // Check Catches in the Controller annotation.
            //
            List catches = CompilerUtils.getAnnotationArrayValue( decl, CONTROLLER_TAG_NAME, CATCHES_ATTR, true );
            
            if ( catches != null )
            {
                for ( Iterator j = catches.iterator(); j.hasNext(); )  
                {
                    AnnotationInstance i = ( AnnotationInstance ) j.next();
                    checkRelativePath( i, PATH_ATTR, jclass, decl, false );
                }
            }

            //
            // Check strutsMerge and validatorMerge in the Controller annotation.
            //
            AnnotationInstance controllerAnnotation = CompilerUtils.getAnnotation( decl, CONTROLLER_TAG_NAME );

            if ( controllerAnnotation != null )
            {
                checkRelativePath( controllerAnnotation, VALIDATOR_MERGE_ATTR, jclass, decl, true );
                checkRelativePath( controllerAnnotation, STRUTSMERGE_ATTR, jclass, decl, true );
            }
            
            //
            // Check Forwards and Catches on action methods and exception-handler methods.
            //
            MethodDeclaration[] methods = decl.getMethods();
            for ( int i = 0; i < methods.length; i++ )
            {
                MethodDeclaration method = methods[i];
                AnnotationInstance ann = CompilerUtils.getAnnotation( method, ACTION_TAG_NAME);
                if ( ann == null ) ann = CompilerUtils.getAnnotation( method, EXCEPTION_HANDLER_TAG_NAME );
                
                if ( ann != null )
                {
                    List methodForwards = CompilerUtils.getAnnotationArray( ann, FORWARDS_ATTR, true );
                    String methodName = method.getSimpleName();
                    
                    if ( methodForwards != null )
                    {
                        for ( Iterator j = methodForwards.iterator(); j.hasNext(); )
                        {
                            AnnotationInstance methodForward = ( AnnotationInstance ) j.next();
                            checkRelativePath( methodName, methodForward, PATH_ATTR, jclass, decl, false );
                        }
                    }
                    
                    List methodCatches = CompilerUtils.getAnnotationArray( ann, CATCHES_ATTR, true );
                    
                    if ( methodCatches != null )
                    {
                        for ( Iterator j = methodCatches.iterator(); j.hasNext(); )
                        {
                            AnnotationInstance methodCatch = ( AnnotationInstance ) j.next();
                            checkRelativePath( methodName, methodCatch, PATH_ATTR, jclass, decl, false );
                        }
                    }
                }
            }
        }
    }
352993
public static <T> Comparator<T> comparator(CheckedComparator<T> comparator) {
        return Unchecked.comparator(comparator, Unchecked.RETHROW_ALL);
    }
5392
public static void requireArgMax(@NotNull final String name, @NotNull final long value, final long max)
            throws ConstraintViolationException {
        // CHECKSTYLE:ON
        if (value > max) {
            throw new ConstraintViolationException("Max value of argument '" + name + "' is " + max + ", but was: " + value);
        }
    }
1109207
function checkHacks(declarations, rule, name, value) {
      var needsHack = name === 'content' && value.indexOf('viewport-units-buggyfill') > -1;
      if (!needsHack) {
        return;
      }

      var fakeRules = value.replace(quoteExpression, '');
      fakeRules.split(';').forEach(function(fakeRuleElement) {
        var fakeRule = fakeRuleElement.split(':');
        if (fakeRule.length !== 2) {
          return;
        }

        var name = fakeRule[0].trim();
        if (name === 'viewport-units-buggyfill') {
          return;
        }

        var value = fakeRule[1].trim();
        declarations.push([rule, name, value]);
        if (calcExpression.test(value)) {
          var webkitValue = value.replace(calcExpression, '-webkit-calc(');
          declarations.push([rule, name, webkitValue]);
        }
      });
    }
855331
@SuppressWarnings("unchecked")
  public final void integrityCheck(AbstractRStarTree<N, E, ?> tree) {
    // leaf node
    if(isLeaf()) {
      for(int i = 0; i < getCapacity(); i++) {
        E e = getEntry(i);
        if(i < getNumEntries() && e == null) {
          throw new RuntimeException("i < numEntries && entry == null");
        }
        if(i >= getNumEntries() && e != null) {
          throw new RuntimeException("i >= numEntries && entry != null");
        }
      }
    }

    // dir node
    else {
      N tmp = tree.getNode(getEntry(0));
      boolean childIsLeaf = tmp.isLeaf();

      for(int i = 0; i < getCapacity(); i++) {
        E e = getEntry(i);

        if(i < getNumEntries() && e == null) {
          throw new RuntimeException("i < numEntries && entry == null");
        }

        if(i >= getNumEntries() && e != null) {
          throw new RuntimeException("i >= numEntries && entry != null");
        }

        if(e != null) {
          N node = tree.getNode(e);

          if(childIsLeaf && !node.isLeaf()) {
            for(int k = 0; k < getNumEntries(); k++) {
              tree.getNode(getEntry(k));
            }

            throw new RuntimeException("Wrong Child in " + this + " at " + i);
          }

          if(!childIsLeaf && node.isLeaf()) {
            throw new RuntimeException("Wrong Child: child id no leaf, but node is leaf!");
          }

          node.integrityCheckParameters((N) this, i);
          node.integrityCheck(tree);
        }
      }

      if(LoggingConfiguration.DEBUG) {
        Logger.getLogger(this.getClass().getName()).fine("DirNode " + getPageID() + " ok!");
      }
    }
  }
417569
public static void requireArgValid(@NotNull final String name, @NotNull final String value) throws ConstraintViolationException {
        // CHECKSTYLE:ON

        final String trimmedLowerCaseValue = value.trim().toLowerCase();
        if (!isValid(trimmedLowerCaseValue)) {
            throw new ConstraintViolationException("The argument '" + name + "' is not valid: '" + trimmedLowerCaseValue + "'");
        }

    }
897084
static void validateValueUniquenessInScope(String qualifiedName,
      List<TypeElement> nestedElements) {
    Set<String> names = new LinkedHashSet<>();
    for (TypeElement nestedElement : nestedElements) {
      if (nestedElement instanceof EnumElement) {
        EnumElement enumElement = (EnumElement) nestedElement;
        for (EnumConstantElement constant : enumElement.constants()) {
          String name = constant.name();
          if (!names.add(name)) {
            throw new IllegalStateException(
                "Duplicate enum constant " + name + " in scope " + qualifiedName);
          }
        }
      }
    }
  }
765788
@GuardedBy("evictionLock")
  void drainValueReferences() {
    if (!collectValues()) {
      return;
    }
    Reference<? extends V> valueRef;
    while ((valueRef = valueReferenceQueue().poll()) != null) {
      @SuppressWarnings("unchecked")
      InternalReference<V> ref = (InternalReference<V>) valueRef;
      Node<K, V> node = data.get(ref.getKeyReference());
      if ((node != null) && (valueRef == node.getValueReference())) {
        evictEntry(node, RemovalCause.COLLECTED, 0L);
      }
    }
  }
673634
def _isValidTrigger(block, ch):
        
        if ch == "" or ch == "\n":
            return True # Explicit align or new line

        match = rxUnindent.match(block.text())
        return match is not None and \
               match.group(3) == ""
926103
public static void requireArgValid(@NotNull final String name, @NotNull final File value) throws ConstraintViolationException {
        // CHECKSTYLE:ON
        if (!value.exists()) {
            throw new ConstraintViolationException("The argument '" + name + "' is not an existing file: '" + value + "'");
        }
    }
690079
private static void check(Set<ConstraintViolation<Object>> constraintViolations) {
        Iterator<ConstraintViolation<Object>> iterator = constraintViolations.iterator();
        if (iterator.hasNext()) {
            throw new ValidationException(iterator.next().getMessage());
        }
    }
1081391
public void throwValue(Local<? extends Throwable> toThrow) {
        addInstruction(new ThrowingInsn(Rops.THROW, sourcePosition,
                RegisterSpecList.make(toThrow.spec()), catches));
    }
81919
public static void requireArgNotEmpty(@NotNull final String name, final String value) throws ConstraintViolationException {
        // CHECKSTYLE:ON
        requireArgNotNull(name, value);
        if (value.length() < 1) {
            throw new ConstraintViolationException("The argument '" + name + "' cannot be empty");
        }
    }
663011
public void check() throws FHIRException {
        rule(componentDelimiter != fieldDelimiter, "Delimiter Error: \""+componentDelimiter+"\" is used for both CPComponent and CPField");
        rule(subComponentDelimiter != fieldDelimiter, "Delimiter Error: \""+subComponentDelimiter+"\" is used for both CPSubComponent and CPField");
        rule(subComponentDelimiter != componentDelimiter, "Delimiter Error: \""+subComponentDelimiter+"\" is used for both CPSubComponent and CPComponent");
        rule(repetitionDelimiter != fieldDelimiter, "Delimiter Error: \""+repetitionDelimiter+"\" is used for both Repetition and CPField");
        rule(repetitionDelimiter != componentDelimiter, "Delimiter Error: \""+repetitionDelimiter+"\" is used for both Repetition and CPComponent");
        rule(repetitionDelimiter != subComponentDelimiter, "Delimiter Error: \""+repetitionDelimiter+"\" is used for both Repetition and CPSubComponent");
        rule(escapeCharacter != fieldDelimiter, "Delimiter Error: \""+escapeCharacter+"\" is used for both Escape and CPField");
        rule(escapeCharacter != componentDelimiter, "Delimiter Error: \""+escapeCharacter+"\" is used for both Escape and CPComponent");
        rule(escapeCharacter != subComponentDelimiter, "Delimiter Error: \""+escapeCharacter+"\" is used for both Escape and CPSubComponent");
        rule(escapeCharacter != repetitionDelimiter, "Delimiter Error: \""+escapeCharacter+"\" is used for both Escape and Repetition");
    }
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();
			}
		}
	}