22

Is there a way to disable this inspection? I know, this maybe be a bad design, but I still would like to disable it.

3
  • 7
    Why vote negatively for the question? Please explain. Jan 3, 2019 at 17:30
  • 1
    What inspection do you mean? Please explain.
    – Valerii
    Jan 3, 2019 at 17:37
  • 1
    This inspection checks all calls to a function, and if it finds that in all calls the value of this parameter is the same, it issues a warning. This is a nuisance in case I have not written enough code, and I do not want such warnings to clog my Problems list. Jul 13, 2021 at 11:18

3 Answers 3

22

Find an instance of the inspection, and hit ALT+ENTER to open the content menu. You'll see a suggestion there that looks like "Inline value 'XYZ' for parameter 'myParameter'". Click the right arrow next to it to open a second context menu, and there you'll find options to edit the inspection setting in order to tune the conditions that will produce it, suppress it for the method/class/parameter, or even disable it altogether.

17

@SuppressWarnings("SameParameterValue")

I tested it in Android Studio 3.5, which is based on IntelliJ-Idea, so it probably works in other IntelliJ-Idea based IDEs too.

2
  • 3
    this is IMHO the solution
    – Michal
    Jul 31, 2021 at 9:40
  • 1
    IntelliJ IDEA Ultimate 2023.1.3 on Win10: check
    – Gunnar
    Jul 5 at 12:42
7

Use @SuppressWarnings("SameParameterValue") in java

and @Suppress("SameParameterValue") in kotlin

Tested on Android Studio Arctic Fox | 2020.3.1

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.