Skip to content

Check that annotation attribute values are concise when referencing something defined by an inner-type of the annotation #452

Closed
@wilkinsona

Description

@wilkinsona

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.

Consider the following:

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)

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:

@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions