Suppress duplicate warnings in IntelliJ IDEA by annotation

后端 未结 3 1097
遇见更好的自我
遇见更好的自我 2021-01-31 01:26

Since version 15, IntelliJ warns me about code duplicates.

In some cases this might be intentional, so I want to ignore/suppress this warning by using the @Suppres

3条回答
  •  孤街浪徒
    2021-01-31 01:50

    Thank you for all the answers. There is also another more generic approach to suppress warnings:

    1. Place the cursor within the code that gives you a warning
    2. Hit Alt+Enter
    3. Go to the warning entry (in this case "Navigate to duplicate")
    4. Don't hit Enter but (right arrow)
    5. Now you can select some suppressing options (for class/method/statement)

提交回复
热议问题