Skip to main content

Redundant exemptions

DiagnosticREDUNDANT_EXEMPTION
Default severityWarning (not configurable)
Gradle propertynone
Exemptionnone

What it reports​

An @Intentionally* exemption that doesn't exempt anything on the element.

@IntentionallyDataClass(reason = ExemptionReason.API_DESIGN)
public class Connection

Notes​

  • The report tags the annotation as Redundant.

  • A check set to NONE doesn't report anything, so its exemptions are redundant. exemptExistingApi removes them. To keep them, turn the check on before you run the task.

  • In a multiplatform project, an exemption on an expect declaration is redundant when neither the expect declaration nor an actual declaration needs it. The compilation that reports it depends on the check:

    The copy of the exemption on an actual declaration isn't reported while the expect declaration has the exemption. After you remove the exemption from the expect declaration, the copy is an exemption of the actual declaration alone and gets its own verdict. exemptExistingApi removes the copies with the exemption on the expect declaration. See Exemptions in a multiplatform project for more details about the copies.

  • An annotation ignore rule doesn't make an exemption redundant.

  • exemptExistingApi removes a redundant exemption, and the import of the annotation when the file doesn't have another use of it.

See also​