Skip to content

Create replacement API for handling merged annotations [SPR-17161] #21697

Closed
@spring-projects-issues

Description

@spring-projects-issues

Phil Webb opened SPR-17161 and commented

The existing AnnotationUtils and AnnotatedElementUtils have grown quite a bit over the years and could do with being revisited now that we have pretty comprehensive support for merged annotations throughout the framework.

Some common issues with the current utils classes include:

  • Quite a broad API (~58 public methods between them) that can make it hard for users to find the right method.
  • Some performance concerns. The classes often appear near the top when profiling applications and a typical application will synthesize quite a few annotations.
  • Difficult to evolve. We have some ideas around using annotation processing at compile time to pre-compute some information. It's quite hard to currently plug this in to the existing code.
  • Complicated meta-data relationships. There's quite a complicated relationship between AnnotatedTypeMetadata and the utils and the meta-data API is different.

A new API could help us to determine which methods are really needed and provide the potential for more intelligent caching or pre-computed data.


Affects: 5.1 RC1

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions