You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
shortenFullyQualifiedTypes can change type resolution for inherited nested types #3117
shortenFullyQualifiedTypes can change the meaning of a qualified type when the simple name is also an inherited nested type.
The formatter avoids some collisions with types declared in the same compilation unit, but does not appear to account for member types inherited from a superclass or interface.
Reproducer
Spotless Gradle plugin 8.10.3, with shortenFullyQualifiedTypes() as the only configured Java step:
The unqualified Type resolves to the inherited Base.Type, not external.Type. Compilation then fails:
cannot find symbol
method externalOnly()
location: variable value of type Type
Suggested behavior
Leave a qualified reference alone when its simple name can resolve to an inherited member type. If this cannot be determined without a classpath, the conservative behavior should be to leave the qualification intact.
changed the title [-][shortenFullyQualifiedTypes] inherited nested types can change type resolution[/-][+]shortenFullyQualifiedTypes can change type resolution for inherited nested types[/+]on Sep 28, 2026
Activity
[-][shortenFullyQualifiedTypes] inherited nested types can change type resolution[/-][+]shortenFullyQualifiedTypes can change type resolution for inherited nested types[/+]Don't shorten types when a superclass is outside the file
maxandersen commentedon Oct 7, 2026
I get the reasons for this fix but this removes 22 valid shortens in jbang - sad :/