Checkstyle import package introduced a new check UnnecessaryFullyQualifiedTypeCheck currently in review checkstyle/checkstyle#21004, while running this check on spring-integration repo it flagged 150 violations in spring-integration
Diff report:https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4bb42ce_2026073849/reports/diff/spring-integration/index.html
how the check work:
The check flags a fully qualified type reference like java.util.Map as unnecessary whenever it is the only type using that simple name in the file meaning it could safely be imported and written as just Map. It stays quiet whenever a second, different type with the same simple name also shows up via import, declaration, another qualified reference, or an on-demand import, since qualification is genuinely needed there to tell the two apart.
Since the check isn't merged yet, I'm not asking for any code changes just wondering if there's a specific reason behind using fully-qualified names here instead of importing?.any feedback on the approach how the check itself could be improved, would be great too.
check doc link:https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4147d0d_20260808220533/checks/imports/unnecessaryfullyqualifiedtype.html#
Checkstyle
importpackage introduced a new checkUnnecessaryFullyQualifiedTypeCheckcurrently in review checkstyle/checkstyle#21004, while running this check onspring-integrationrepo it flagged 150 violations inspring-integrationDiff report:https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4bb42ce_2026073849/reports/diff/spring-integration/index.html
how the check work:
The check flags a fully qualified type reference like
java.util.Mapas unnecessary whenever it is the only type using that simple name in the file meaning it could safely be imported and written as just Map. It stays quiet whenever a second, different type with the same simple name also shows upvia import, declaration, another qualified reference, or an on-demand import, since qualification is genuinely needed there to tell the two apart.Since the check isn't merged yet, I'm not asking for any code changes just wondering if there's a specific reason behind using fully-qualified names here instead of importing?.any feedback on the approach how the check itself could be improved, would be great too.
check doc link:https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/4147d0d_20260808220533/checks/imports/unnecessaryfullyqualifiedtype.html#