Skip to content

Find references on annotation attributes should not take annotated type into account #3808

Open

Description

I have a class starting like this:

@Controller
@RequestMapping("/owners/{ownerId}")
@Profile("cloud")
class PetController {

It looks like executing Go To References while clicking on the annotation attributes uses the annotated type as the element to find references for - which should not be the case in my opinion.

Example:

  • clicking on @Controller and executing Go To References shows all references to the Controller type. 👍
  • same for @Profile etc. 👍
  • clicking on PetController and executing Go To References shows all the references to the PetController type. 👍

But:

  • clicking on the "cloud" annotation attribute and executing Go To References shows all the references to the PetController type as well. 😱 This should return no references, I think.

Background:
We have functionality in place in the Spring Tools that finds references to that specific "cloud" attribute in your code, but the results gets merged with references to the PetController type, which is not a great result (at least from what we are trying to achieve) 😀

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions