UC.AAI
Avoid unnecessary modifiers in an "interface"
Description
This rule flags any unnecessary modifier used in "interface" members.
Interface methods are always "public" and "abstract". Interface fields are always "public", "static" and "final". It is thus unnecessary and confusing to add those modifiers when declaring "interface" fields or methods.
Example
package UC;
interface AAI
{
public void method (); // Violation
abstract int getSize (); // Violation
static int SIZE = 100; // Violation
}
Repair
interface AAI_fixed
{
void method ();
int getSize ();
int SIZE = 100;
}
|