Exemptions without explanation
| Diagnostic | EXEMPTION_WITHOUT_EXPLANATION |
| Default severity | Error (not configurable) |
| Gradle property | none |
| Exemption | none |
What it reports
An @Intentionally* exemption with a reason parameter and a blank description, unless
the reason is FOR_BACKWARDS_COMPATIBILITY, API_DESIGN, or FOR_DEPRECATION.
OTHER is the default reason. A whitespace-only description counts as blank.
@IntentionallyOpenpublic open class Component
Rationale
A reason such as INTEROP doesn't identify the language, platform, or framework that needs the
exemption. Name that requirement in description.
Don't
@IntentionallyOpenpublic open class Widget
Do
@IntentionallyOpen(reason = ExemptionReason.API_DESIGN)public open class Widget
Notes
- The check inspects declaration and type-usage exemptions, including both
expectandactualusages. @IntentionallyWrongDslMarkerTargetsForBackwardsCompatibilityand@IntentionallyExposedInternalApiForBackwardsCompatibilitydon't have areasonparameter and don't need adescription.
See also
- Exemptions and internal API
- Data class exemption for an example check that defines an exemption annotation