IDEA提示 found duplicate code

原因:

  IntelliJ IDEA提示Found duplicated code in this file

  这不是我们代码错误,而是idea提示说我们的代码有重复,在项目的其他地方有同样的代码片段

解决:

  i>:封装我们的代码,将其抽象为一个方法

  ii>:设置IDEA的配置,如图:

    

这样就不会报Found duplicated code in this file提示了。

猜你喜欢

转载自www.cnblogs.com/quan-coder/p/8985991.html