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
Check that annotation attribute values are concise when referencing something defined by an inner-type of the annotation #452
When the value of an annotation's attribute references something defined by an inner type of the annotation, the inner type should be imported and referenced directly rather than through the containing type.
The repetition of SpringBootTest in both the annotation itself and the value of one of its attributes is overly verbose. Instead, we prefer to import WebEnvironment and refer to it directly:
This needs some refinement. Switching from @Annotation.InnerType to InnerType results in an import of com.example.Annotation. If it's deprecated, this will cause a compiler warning as illustrated in Spring Boot 4.0.x (428963e02d171711e0ce25c01d2b3cc0da366ce9):
> Compilation failed; see the compiler output below.
…/module/spring-boot-jackson2/src/test/java/org/springframework/boot/jackson2/NameAndAgeJsonKeyComponent.java:27: warning: [removal] JsonComponent in org.springframework.boot.jackson2 has been deprecated and marked for removal
import org.springframework.boot.jackson2.JsonComponent.Scope;
Activity
Check that annotation attribute values are concise
wilkinsona commentedon Jun 28, 2026
This needs some refinement. Switching from
@Annotation.InnerTypetoInnerTyperesults in an import ofcom.example.Annotation. If it's deprecated, this will cause a compiler warning as illustrated in Spring Boot 4.0.x (428963e02d171711e0ce25c01d2b3cc0da366ce9):Permit fully-qualified refs in concise annotation attribute check