Overloaded varargs method
Reports varargs methods with the same name as other methods in the class or in a superclass. Overloaded methods that take a variable number of arguments can be very confusing because it is often unclear which overload gets called.
Example:
public void execute(Runnable... r) {} // warning
public void execute(Runnable r1, Runnable r2) {}
Use the option to ignore overloaded methods whose parameter types are definitely incompatible.
Inspection options
Option | Type | Default |
---|---|---|
Ignore overloaded methods whose parameter types are definitely incompatible | Checkbox | true |
Inspection Details | |
---|---|
Available in: | IntelliJ IDEA 2023.3, Qodana for JVM 2023.3 |
Plugin: | Java, 233.SNAPSHOT |
Last modified: 13 July 2023