IDEA|IDEA 出现问题(出现private field 'xxx' is never assigned警告解决方案)

Intellij IDEA使用教程相关系列 目录
在IDEA编译器里,spring项目中使用@Autowired注解,出现private field 'xxx' is never assigned警告
IDEA|IDEA 出现问题(出现private field 'xxx' is never assigned警告解决方案)
文章图片

解决方案:

  1. 在变量上单击使光标在变量上.
  2. 按Alt+Enter快捷键,显示
    IDEA|IDEA 出现问题(出现private field 'xxx' is never assigned警告解决方案)
    文章图片


  3. 【IDEA|IDEA 出现问题(出现private field 'xxx' is never assigned警告解决方案)】上下键选中回车或者鼠标单击途中高亮的那个选项即可.

    推荐阅读