-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid cloning empty Annotation
array in TypeDescriptor
#32405
Closed
kilink
wants to merge
1
commit into
spring-projects:main
from
kilink:type-descriptor-empty-annotations
Closed
Avoid cloning empty Annotation
array in TypeDescriptor
#32405
kilink
wants to merge
1
commit into
spring-projects:main
from
kilink:type-descriptor-empty-annotations
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rework AnnotatedElementAdapter to avoid cloning the underlying Annotation array if it is empty when getAnnotations is called. Additionally, make the class static and add a factory method that returns a singleton instance for null or empty Annotation arrays.
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged or decided on
label
Mar 10, 2024
sbrannen
added
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
and removed
status: waiting-for-triage
An issue we've not yet triaged or decided on
labels
Mar 10, 2024
sbrannen
added a commit
that referenced
this pull request
Mar 10, 2024
sbrannen
changed the title
Avoid cloning empty Annotation array in TypeDescriptor
Avoid cloning empty Mar 10, 2024
Annotation
array in TypeDescriptor
jhoeller
added
for: backport-to-6.0.x
status: backported
An issue that has been backported to maintenance branches
and removed
for: backport-to-6.0.x
labels
Mar 16, 2024
jhoeller
added a commit
that referenced
this pull request
Mar 16, 2024
jhoeller
added a commit
that referenced
this pull request
Mar 16, 2024
jhoeller
added a commit
that referenced
this pull request
Mar 16, 2024
Yangushan
pushed a commit
to Yangushan/spring-framework
that referenced
this pull request
Mar 17, 2024
Backported to 6.1.6, 6.0.19, 5.3.34 as well now since it is a straightforward internal optimization in a hot code path. |
jhoeller
added a commit
that referenced
this pull request
Mar 17, 2024
jhoeller
added a commit
that referenced
this pull request
Mar 17, 2024
jhoeller
added a commit
that referenced
this pull request
Mar 17, 2024
jhoeller
added a commit
that referenced
this pull request
Mar 17, 2024
Yangushan
pushed a commit
to Yangushan/spring-framework
that referenced
this pull request
Mar 18, 2024
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: enhancement
A general enhancement
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rework
AnnotatedElementAdapter
to avoid cloning the underlyingAnnotation
array if it is empty whengetAnnotations()
is called.Additionally, make the class static and add a factory method that returns a singleton instance for
null
or an emptyAnnotation
arrays.