All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.squidjava.rules.squid.S1185.html Maven / Gradle / Ivy

Overriding a method just to call the same method from the super class without performing any other actions is useless and misleading.

The following code snippet illustrates this rule:

public void doSomething() {                     // Non-Compliant
  super.doSomething();
}

@Override
public boolean isLegal(Action action) {         // Non-Compliant
  return super.isLegal(action);
}

@Override
public boolean isLegal(Action action) {         // Compliant - not simply forwarding the call
  return super.isLegal(new Action(/* ... */));
}

@Id
@Override
public int getId() {                            // Compliant - there is annotation different from @Override
  return super.getId();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy