Skip to main content

Exemptions without explanation

DiagnosticEXEMPTION_WITHOUT_EXPLANATION
Default severityError (not configurable)
Gradle propertynone
Exemptionnone

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.

@IntentionallyOpen
public 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​

@IntentionallyOpen
public open class Widget

Do​

@IntentionallyOpen(reason = ExemptionReason.API_DESIGN)
public open class Widget

Notes​

  • The check inspects declaration and type-usage exemptions, including both expect and actual usages.
  • @IntentionallyWrongDslMarkerTargetsForBackwardsCompatibility and @IntentionallyExposedInternalApiForBackwardsCompatibility don't have a reason parameter and don't need a description.

See also​