org.sonar.l10n.java.rules.squid.S1610.html Maven / Gradle / Ivy
With Java 8's "default method" feature, any abstract class without direct or inherited field should be converted into an interface.
Noncompliant Code Example
public abstract class Car {
public abstract void start(Environment c);
public void stop(Environment c) {
c.freeze(this);
}
}
Compliant Solution
public interface Car {
public void start(Environment c);
public default void stop(Environment c) {
c.freeze(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy