Diese Methode ist aber nur fuer die 11-stellige Steuer-Identifikationsnummer
(TIN) implementiert. Fuer andere Steuernummer kommt eine
{@link IllegalArgumentException}.

@param wert Fachwert oder gekapselter Wert
@return the boolean
164049
@Override
    public boolean isValid(String wert) {
        int n = anzahlStellen + 1;
        if (wert.length() != n) {
            throw new IllegalArgumentException("Nummer '" + wert + "' ist nicht " + n + " Zeichen lang");
        }
        String pruefziffer = getPruefziffer(wert);
        return pruefziffer.equals(berechnePruefziffer(wert.substring(0, wert.length() - 1)));
    }
1269722
public boolean isIdentity(AbstractPlanNode childNode) throws PlanningErrorException {
        assert(childNode != null);
        // Find the output schema.
        // If the child node has an inline projection node,
        // then the output schema is the inline projection
        // node's output schema.  Otherwise it's the output
        // schema of the childNode itself.
        NodeSchema childSchema = childNode.getTrueOutputSchema(false);
        assert(childSchema != null);
        NodeSchema outputSchema = getOutputSchema();
        if (outputSchema.size() != childSchema.size()) {
            return false;
        }
        for (int idx = 0; idx < outputSchema.size(); idx += 1) {
            SchemaColumn col = outputSchema.getColumn(idx);
            SchemaColumn childCol = childSchema.getColumn(idx);
            if (col.getValueType() != childCol.getValueType()) {
                return false;
            }
            if ( ! (col.getExpression() instanceof TupleValueExpression)) {
                return false;
            }
            if ( ! (childCol.getExpression() instanceof TupleValueExpression)) {
                return false;
            }
            TupleValueExpression tve = (TupleValueExpression)col.getExpression();
            if (tve.getColumnIndex() != idx) {
                return false;
            }
        }
        return true;
    }
260596
private boolean wellKnownTypeArgument(NewClassTree tree, VisitorState state) {
    Type type = getType(tree);
    if (type == null) {
      return false;
    }
    type = state.getTypes().asSuper(type, state.getSymbolFromString("java.lang.ThreadLocal"));
    if (type == null) {
      return false;
    }
    if (type.getTypeArguments().isEmpty()) {
      return false;
    }
    Type argType = getOnlyElement(type.getTypeArguments());
    if (WELL_KNOWN_TYPES.contains(argType.asElement().getQualifiedName().toString())) {
      return true;
    }
    if (isSubtype(argType, state.getTypeFromString("java.text.DateFormat"), state)) {
      return true;
    }
    return false;
  }
888491
public static boolean alg_68(int[] blz, int[] number) {
        // 10-stellige
        if (number[0] != 0) {
            if (number[3] != 9) {
                return false;
            }
            int sum = addProducts(number, 3, 8, new int[]{1, 2, 1, 2, 1, 2}, true);
            int crc = (10 - sum % 10) % 10;
            return number[9] == crc;
        }

        // 9-stellige Ausnahme (Ausnahme nur bei Variante 2??)
        if (number[1] == 4) {
            // nicht pruefbar
            return true;
        }

        // auf 6stelligkeit pruefen
        int sumfirstfive = 0;
        for (int i = 0; i <= 4; i++) {
            sumfirstfive += number[i];
        }
        //mindestens 6-stellig
        if (sumfirstfive == 0) {
            return false;
        }

        //Variante 1
        int sum = addProducts(number, 1, 8, new int[]{1, 2, 1, 2, 1, 2, 1, 2}, true);
        int crc = (10 - sum % 10) % 10;
        if (number[9] == crc) {
            return true;
        }

        //Variante 2
        sum = addProducts(number, 1, 8, new int[]{1, 0, 0, 2, 1, 2, 1, 2}, true);
        crc = (10 - sum % 10) % 10;
        return number[9] == crc;
    }
684206
@Override
  public Long product11(Long arg1, Long arg2) {
    if (arg1 == null || arg2 == null) {
      return null;
    } else {
      return arg1 * arg2;
    }
  }
437106
@Override
    public T validate(T wert) {
        if (!isValid(wert)) {
            throw new InvalidLengthException(Objects.toString(wert), min, max);
        }
        return wert;
    }
208100
protected boolean verifyCondition1(IContextMapping<INode> mapping, IMappingElement<INode> e) {
        return findRelation(IMappingElement.LESS_GENERAL, e.getSource().getAncestors(), e.getTarget(), mapping) ||
                findRelation(IMappingElement.LESS_GENERAL, e.getSource(), e.getTarget().getDescendants(), mapping) ||
                findRelation(IMappingElement.LESS_GENERAL, e.getSource().getAncestors(), e.getTarget().getDescendants(), mapping);
    }
1099857
@Override
    public void initEntryFact(TaintFrame fact) {
        fact.setValid();
        fact.clearStack();
        boolean inMainMethod = isInMainMethod();
        int numSlots = fact.getNumSlots();
        int numLocals = fact.getNumLocals();
        for (int i = 0; i < numSlots; ++i) {
            Taint value = new Taint(Taint.State.UNKNOWN);
            if (i < numLocals) {
                if (i < parameterStackSize) {
                    int stackOffset = parameterStackSize - i - 1;
                    if (isTaintedByAnnotation(i - 1)) {
                        value = new Taint(Taint.State.TAINTED);
                        // this would add line number for the first instruction in the method
                        //value.addLocation(new TaintLocation(methodDescriptor, 0,""), true);
                    } else if (inMainMethod) {
                        if (FindSecBugsGlobalConfig.getInstance().isTaintedMainArgument()) {
                            value = new Taint(Taint.State.TAINTED);
                        } else {
                            value = new Taint(Taint.State.SAFE);
                        }
                    } else {
                        value.addParameter(stackOffset);
                    }
                    value.addSource(new UnknownSource(UnknownSourceType.PARAMETER,value.getState()).setParameterIndex(stackOffset));
                }
                value.setVariableIndex(i);
            }
            fact.setValue(i, value);
        }
    }
640871
public static <T extends Number> boolean isAliquot(final T dividend, final T divisor) {

        return dividend.doubleValue() % divisor.doubleValue() == 0;
    }
975353
public static boolean alg_87(int[] blz, int[] number) {
        // Ausnahme
        int[] temp = number.clone();
        if (number[2] == 9) {
            return alg_51(blz, number);
        }

        // Methode A
        int[] tab1 = new int[]{0, 4, 3, 2, 6};
        int[] tab2 = new int[]{7, 1, 5, 9, 8};

        int i = 3;
        while (number[i] == 0) {
            i++;
        }
        int c2 = (i + 1) % 2;
        int d2 = 0;
        int a5 = 0;
        int p;
        while (i < 9) {
            switch (number[i]) {
                case 0:
                    number[i] = 5;
                    break;
                case 1:
                    number[i] = 6;
                    break;
                case 5:
                    number[i] = 10;
                    break;
                case 6:
                    number[i] = 1;
                    break;
            }
            if (c2 == d2) {
                if (number[i] > 5) {
                    if (c2 == 0 && d2 == 0) {
                        c2 = 1;
                        d2 = 1;
                        a5 = a5 + 6 - (number[i] - 6);
                    } else {
                        c2 = 0;
                        d2 = 0;
                        a5 = a5 + number[i];
                    }
                } else {
                    if (c2 == 0 && d2 == 0) {
                        c2 = 1;
                        a5 = a5 + number[i];
                    } else {
                        c2 = 0;
                        a5 = a5 + number[i];
                    }
                }
            } else {
                if (number[i] > 5) {
                    if (c2 == 0) {
                        c2 = 1;
                        d2 = 0;
                        a5 = a5 - 6 + (number[i] - 6);
                    } else {
                        c2 = 0;
                        d2 = 1;
                        a5 = a5 - number[i];
                    }
                } else {
                    if (c2 == 0) {
                        c2 = 1;
                        a5 = a5 - number[i];
                    } else {
                        c2 = 0;
                        a5 = a5 - number[i];
                    }
                }
            }
            i++;
        }

        while (a5 < 0 || a5 > 4) {
            if (a5 > 4) {
                a5 = a5 - 5;
            } else {
                a5 = a5 + 5;
            }
        }

        if (d2 == 0) {
            p = tab1[a5];
        } else {
            p = tab2[a5];
        }

        if (p == number[9]) {
            return true;
        }

        if (number[3] == 0) {
            if (p > 4) {
                p = p - 5;
            } else {
                p = p + 5;
            }
            if (p == number[9]) {
                return true;
            }
        }
        // Ende Methode A

        number = temp;
        // Methode B
        if (alg_33(blz, number)) {
            return true;
        }

        // Methode C
        int sum = addProducts(number, 4, 8, new int[]{6, 5, 4, 3, 2}, false);
        int crc = (7 - (sum % 7)) % 7;
        return number[9] == crc;
    }
1069269
private Integer toNumber(final Object src) {

		if (src instanceof Number) {

			return ((Number)src).intValue();
		}

		if (src instanceof String) {

			try {

				return Integer.valueOf(src.toString());

			} catch (NumberFormatException nfex) {
				logger.warn("Error in slice(): Cannot parse number {}.", src);
			}
		}

		return null;
	}
330757
@Override
    public boolean isValid(T wert) {
        int length = Objects.toString(wert, "").length();
        return (length >= min) && (length <= max);
    }
242477
@SuppressWarnings("unchecked")
	public static <T> T parseNumber(String value, Class<T> targetClass){
		if(value == null){
			return null;
		}
		try{
			if(Integer.class == targetClass){
				return (T)Integer.valueOf(value);
			}
			else if(Float.class == targetClass){
				return (T)Float.valueOf(value);
			}
			else if(Double.class == targetClass){
				return (T)Double.valueOf(value);
			}
			else if(Byte.class == targetClass){
				return (T)Byte.valueOf(value);
			}
			else if(Short.class == targetClass){
				return (T)Short.valueOf(value);
			}
			else if(Long.class == targetClass){
				return (T)Long.valueOf(value);
			}
			else{
				return null;
			}
		}
		catch(NumberFormatException e){}
		return null;
	}
77130
public static void checkFlagsArgument(final int requestedFlags, final int allowedFlags) {
        if ((requestedFlags & allowedFlags) != requestedFlags) {
            throw new IllegalArgumentException("Requested flags 0x"
                    + Integer.toHexString(requestedFlags) + ", but only 0x"
                    + Integer.toHexString(allowedFlags) + " are allowed");
        }
    }
1223981
public static void checkNumOfArgsEquals(Command cmd, CommandLine cl, int n) throws
      InvalidArgumentException {
    if (cl.getArgs().length != n) {
      throw new InvalidArgumentException(ExceptionMessage.INVALID_ARGS_NUM
          .getMessage(cmd.getCommandName(), n, cl.getArgs().length));
    }
  }
393066
protected void registerFactorComparator(final FactorComparator<T> comparator) {
    if (null == comparator ||
        Integer.MAX_VALUE - this.getTotalWeight() < comparator.getWeight()) {
      throw new IllegalArgumentException("unable to register comparator." +
          " The passed comparator is null or has an invalid weight value.");
    }

    // add or replace the Comparator.
    this.factorComparatorList.put(comparator.getFactorName(), comparator);
    logger.debug(String.format("Factor comparator added for '%s'. Weight = '%s'",
        comparator.getFactorName(), comparator.getWeight()));
  }
510949
public static boolean isNumber(String arg) {
        if (StringUtils.isEmpty(arg)) {
            return false;
        }
        return check(arg, NUMBER_PARTER);
    }