public boolean checkMethodIncluded()

in instrumentation/src/com/intellij/rt/coverage/instrumentation/data/FilteredMethodStorage.java [63:87]


  public boolean checkMethodIncluded(InstrumentationData context) {
    if (isNoFilters(context)) return true;
    List<Pattern> includeAnnotations = context.getProjectContext().getOptions().includeAnnotations;
    List<Pattern> excludeAnnotations = context.getProjectContext().getOptions().excludeAnnotations;
    List<String> methodAnnotations = context.get(Key.METHOD_ANNOTATIONS);
    String owner = context.get(Key.CLASS_NAME);
    String filteredSignature = KotlinDefaultArgsBranchFilter.getOriginalNameAndDesc(context);
    boolean includeAnnotationsUsed = !includeAnnotations.isEmpty();

    boolean forceExclude = matchesPatterns(excludeAnnotations, methodAnnotations)
        || isMethodRegistered(owner, filteredSignature, false);

    boolean forceInclude = includeAnnotationsUsed &&
        (matchesPatterns(includeAnnotations, methodAnnotations)
            || isMethodRegistered(owner, filteredSignature, true));

    boolean included = !forceExclude && (!includeAnnotationsUsed || forceInclude);

    if (!included) {
      addMethod(owner, context.getMethodName() + context.getMethodDesc(), false);
    } else if (forceInclude) {
      addMethod(owner, context.getMethodName() + context.getMethodDesc(), true);
    }
    return included;
  }