Skip to content

quick fix to remove unnecessary @Autowired appears twice #1106

Closed

Description

@martinlippert

I have a simple Rest Service guide project created and added an @Autowired constructor to the GreetingController. It is flagged with a warning, but invoking the quick fix popup, the remove unnecessary @Autowired appears twice.

Activity

  1. added this to the 4.20.0.RELEASE milestone on Sep 5, 2023
  2. martinlippert commented on Sep 5, 2023

    @martinlippert
    MemberAuthor

    This has a timing component to it. If you invoke the quick fixes quickly after the warning appears, there is only one quick fix showing up. But invoking the quick fix popup again, you will see the second quick fix appearing.

  3. martinlippert commented on Sep 5, 2023

    @martinlippert
    MemberAuthor

    The same happens for the validation / quick fix that flags unnecessary public modifiers for @Bean methods, where all three quick fixes (remove, remove in file, remove in project) appear twice as well in the quick fix popup.

  4. BoykoAlex commented on Sep 5, 2023

    @BoykoAlex
    Contributor

    @martinlippert can you paste the screenshot of the popup? It's not the hover and not the dialog you get when invoken quick fix from the problems view... It is the shell that pops up when you click on an icon in the gutter, correct?

  5. martinlippert commented on Sep 5, 2023

    @martinlippert
    MemberAuthor

    I hit Cmd-1 from within the editor with the cursor placed at the first character of the annotation

  6. BoykoAlex commented on Sep 5, 2023

    @BoykoAlex
    Contributor

    Fixed with e79da39, unit tested with 2a397ae

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions