1.在进行开发过程中使用IntelliJ IDEA工具,当有重复代码时,此IDE会出现错误提示,如图:
IntelliJ IDEA:Found duplicated code in this File
是因为IDEA会默认开启Duplicated code的校验。
2.解决办法:
可以使用快捷键Ctrl+alt+s(或者File–>Settings–>Editor–>Inspections–>General–>Duplicated code),然后把此选项后面的复选项去掉,Apply–>OK。
或者直接在上面的搜索框直接输入 Duolicated Code.
IntelliJ IDEA:Found duplicated code in this File
此时的警告提示就没有了。
IntelliJ IDEA:Found duplicated code in this File

相关文章:

  • 2021-11-21
  • 2022-01-22
  • 2021-09-23
  • 2022-12-23
  • 2021-12-09
  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-11
  • 2021-08-01
  • 2021-04-21
  • 2021-11-14
  • 2021-07-06
相关资源
相似解决方案