Skip to content
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

Allow declaration-stable lookup of declared methods via ASM [SPR-16100] #20648

Closed
spring-projects-issues opened this issue Oct 23, 2017 · 2 comments
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

Oliver Drotbohm opened SPR-16100 and commented

ClassMetadata currently exposes ASM based metadata about the type hierarchy. Also, it's subtype AnnotationMetadata exposes information about type annotations and annotated methods.

It would be very helpful to also be able to obtain the MethodMetadata for all declared methods in a type.


Affects: 4.3.12, 5.0 GA

Issue Links:

  • DATAJPA-1209 Compatibility with Hibernate < 5.2.11 broken for projections on native queries
  • DATACMNS-1206 Introduce abstraction to detect declared methods in declaration order
@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

This turns out to be somewhat involved since our ASM visitors currently only store annotated methods. With the ASM visitor model, you have to know upfront what you intend to retrieve, so we might be better off providing a dedicated lookup method here - outside of MetadataReader. I'll revisit this for 5.0.2 / 4.3.13.

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Folding this into the MetadataReader model is indeed not an option since it conflicts with other purposes, in particular classpath scanning, and I don't want to make compromises there - neither at the API level nor in terms of runtime metadata storage.

We could offer a separate utility with custom use of ASM along the lines of LocalVariableTableParameterNameDiscoverer. Since this requires some internal caching for an efficient solution and since we don't have a use case for it in the core framework, I'd rather put a tailored utility for your purposes into Spring Data Commons instead. We may revisit this once further use cases appear.

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@jhoeller jhoeller added the status: declined A suggestion or change that we don't feel we should currently apply label Jul 13, 2023
@jhoeller jhoeller removed this from the General Backlog milestone Jul 13, 2023
@bclozel bclozel closed this as not planned Won't fix, can't repro, duplicate, stale Jul 14, 2023
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: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants