首先点击file>settings按钮 如图
点击Inspections 在右侧搜索框中搜索General 把Duplicated code fragment的沟个去掉 如图
然后点击apply、ok就好了