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

Spike - Investigate possible ways to determine what annotations exist on classes which implement interfaces that contain annotations. #1576

Closed
jtduffy opened this issue Nov 6, 2023 · 2 comments · Fixed by #1675
Assignees
Labels
feature request Suggestion for a new product enhancement or change jan-mar qtr Represents proposed work item for the Jan-Mar quarter

Comments

@jtduffy
Copy link
Contributor

jtduffy commented Nov 6, 2023

The problem with annotating interfaces is that those annotations are lost at runtime on the implementing classes. So when you have a controller that implements an interface, and that interface's methods are annotated with a Spring mapping annotation, we can't pick that up, so we have to default to the method name. See the javadoc for Annotation Type Inherited :

Note also that this meta-annotation only causes annotations to be inherited from superclasses; annotations on implemented interfaces have no effect

The goal of the spike is to see if there is any way to determine these annotations at runtime, possible through reflection of the target interface(s) to fetch annotations and map those to classes that implement the interface(s).

@jtduffy jtduffy added the estimate Issue needing estimation label Nov 6, 2023
@workato-integration
Copy link

@jtduffy jtduffy added the feature request Suggestion for a new product enhancement or change label Nov 6, 2023
@kford-newrelic kford-newrelic added the jan-mar qtr Represents proposed work item for the Jan-Mar quarter label Nov 7, 2023
@jtduffy jtduffy moved this from Triage to In progress in Java Engineering Board Nov 14, 2023
@jtduffy
Copy link
Contributor Author

jtduffy commented Nov 29, 2023

@mgr32
Snapshot artifact

We have 3 modules:

  • spring-4.3.0: This is a replacement for the existing 4.3.0 module
  • spring-6.0.0: This is identical to 4.3.0 except for the namespace change of javax --> jakarta
  • instrumentation:spring-webflux-controller-mappings-5.0.0: Same functionality as the previous modules, just for webflux based controllers

The legacy controller pointcut has also been removed.

The README for the 4.3.0 module gives a decent overview of what should be supported.

If you see any issues, have any code comments, etc, let me know. If all goes well, this change will be part of our first release in 2024.

@kford-newrelic kford-newrelic removed estimate Issue needing estimation jan-mar qtr Represents proposed work item for the Jan-Mar quarter labels Dec 12, 2023
@jtduffy jtduffy added the jan-mar qtr Represents proposed work item for the Jan-Mar quarter label Dec 13, 2023
@github-project-automation github-project-automation bot moved this from In progress to Code Complete/Done in Java Engineering Board Jan 19, 2024
@jtduffy jtduffy self-assigned this Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Suggestion for a new product enhancement or change jan-mar qtr Represents proposed work item for the Jan-Mar quarter
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants