public RegexQualifiedTypeFactory(QualifierContext<Regex> checker) {
    super(checker);

    patternCompile =
        TreeUtils.getMethod(
            "java.util.regex.Pattern", "compile", 1, getContext().getProcessingEnvironment());
    patternMatcher =
        TreeUtils.getMethod(
            "java.util.regex.Pattern", "matcher", 1, getContext().getProcessingEnvironment());
  }
Exemplo n.º 2
0
  public NullnessVisitor(BaseTypeChecker checker, boolean useFbc) {
    super(checker);

    NONNULL = atypeFactory.NONNULL;
    NULLABLE = atypeFactory.NULLABLE;
    MONOTONIC_NONNULL = atypeFactory.MONOTONIC_NONNULL;
    stringType = elements.getTypeElement("java.lang.String").asType();

    ProcessingEnvironment env = checker.getProcessingEnvironment();
    this.collectionSize = TreeUtils.getMethod(java.util.Collection.class.getName(), "size", 0, env);
    this.collectionToArray =
        TreeUtils.getMethod(java.util.Collection.class.getName(), "toArray", 1, env);

    checkForAnnotatedJdk();
  }
  public SystemGetPropertyHandler(ProcessingEnvironment env, NullnessAnnotatedTypeFactory factory) {
    this.env = env;
    this.factory = factory;

    systemGetProperty = TreeUtils.getMethod("java.lang.System", "getProperty", 1, env);
  }