Skip to content

Add FullyQualifiedAnnotationBeanNameGenerator.INSTANCE#26025

Merged
jhoeller merged 1 commit intospring-projects:masterfrom
evpaassen:fqabng-static-instance
Nov 4, 2020
Merged

Add FullyQualifiedAnnotationBeanNameGenerator.INSTANCE#26025
jhoeller merged 1 commit intospring-projects:masterfrom
evpaassen:fqabng-static-instance

Conversation

@evpaassen
Copy link
Contributor

Spring 5.2.3 (b4c91e7) introduces the FullyQualifiedAnnotationBeanNameGenerator, but does not override/hide the static INSTANCE field from its parent, which seems confusing to me. Someone might access FullyQualifiedAnnotationBeanNameGenerator.INSTANCE and get a AnnotationBeanNameGenerator instead. Just like I did. 😅

This PR aims to solve that by adding a static INSTANCE field to FullyQualifiedAnnotationBeanNameGenerator, like its parent does too.

Adds a static INSTANCE to FullyQualifiedAnnotationBeanNameGenerator,
just like its parent class, AnnotationBeanNameGenerator, does.

The class doesn't have any state and overriding/hiding the INSTANCE of
the superclass, this prevents unintended use of a regular
AnnotationBeanNameGenerator through
FullyQualifiedAnnotationBeanNameGenerator.INSTANCE.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 3, 2020
@jhoeller jhoeller self-assigned this Nov 3, 2020
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 3, 2020
@jhoeller jhoeller added this to the 5.3.1 milestone Nov 3, 2020
@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.2.x labels Nov 3, 2020
@jhoeller jhoeller merged commit fbf8e37 into spring-projects:master Nov 4, 2020
jhoeller added a commit that referenced this pull request Nov 4, 2020
@evpaassen evpaassen deleted the fqabng-static-instance branch November 4, 2020 16:29
@evpaassen
Copy link
Contributor Author

Thanks for merging! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants