In some projects I am currently working on, method overloading is being misused in many classes: methods with the same name are being overloaded for many times just with the difference of a parameter’s presence or absence. And I want to change that.
Is there any existing tool that can count how many times a method is being overloaded in a Java class? Thanks.
Use reflection to get the
List<Method>getDeclaredMethods()for a class and check for same name (getName()) different signature methods (getParameterTypes())