Back to Intellij Community

OverloadedVarargsMethod

java/java-impl/resources/inspectionDescriptions/OverloadedVarargsMethod.html

2025.3-rc-2451 B
Original Source

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.