Annotation Type ExcludeFromCodeCoverageGeneratedReport


@Retention(CLASS) @Target({METHOD,TYPE,CONSTRUCTOR}) public @interface ExcludeFromCodeCoverageGeneratedReport
Marks a type or method that should be excluded from code-coverage calculations. Implementation note: Jacoco recognizes all annotations that contain the string "Generated", therefore this class should not be renamed.
Author:
Christian Kohlschütter
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    A human-readable explanation why it was excluded.
  • Element Details

    • reason

      String reason
      A human-readable explanation why it was excluded. As a convention use the following values for certain scenarios:
      • unreachable for clearly unreachable code (e.g., a private constructor in a static helper class) and methods that are assumed but not guaranteed to never be called (e.g., implementations of an abstract/interface method that are expected to never be called due to implementation specifics)
      • exception unreachable for methods that catch an exception that is never thrown (e.g., CloneNotSupportedException)
      • jacoco bug for scenarios where JaCoCo is clearly wrong
      Returns:
      The reason.
      Default:
      ""