Redundant qualifier removable via context-sensitive resolution
Reports explicit qualifiers that can be removed in favor of context-sensitive resolution (CSR).
When context-sensitive resolution is enabled, an enum entry or a sealed subclass can be referenced by its short name in a position with a matching expected type, so the leading qualifier becomes unnecessary. This inspection informs on such qualifiers and the associated 'Remove redundant qualifier name' quick-fix removes them.
Unlike the 'Redundant qualifier name' inspection, this inspection reports only qualifiers that are removable thanks to context-sensitive resolution. It is disabled by default: enable it if you want to review and remove all such qualifiers, for example across the whole project.
Example:
Locating this inspection
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
RedundantContextSensitiveResolutionQualifier- Via Settings dialog
Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.
Inspection ID: RedundantContextSensitiveResolutionQualifier
Suppressing Inspection
You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:
More detailed instructions as well as other ways and options that you have can be found in the product documentation:
Inspection Details | |
|---|---|
By default bundled with: |