IDEA提示注入的屬性 is never assigned

With your cursor on the field name (i.e. bootstrapDataEvent), type Alt + Enter (Windows) or  ⌥⏎ (Mac)  . From the popup, select the "Suppress for fields annotated by 'package.name.Inject'".

If that option does not show, arrow down to the "Create Setter" option and hit the right arrow. On the side menu select "Edit inspection profile setting". That will open the Inspections Configuration dialog, with the "Unused  symbol" inspection selected. Click the "Configure annotations..." button and add your annotation.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章