A class adds a new superclass.
The class LandVehicle in the library project adds the superclass Vehicle to its declaration.
public abstract class Vehicle {
public static final int INITIAL_KMS = 0;
String getType();
public static void move() {
System.out.println("The vehicle is moving.");
}
}
+public abstract class LandVehicle {
-public abstract class LandVehicle extends Vehicle {
}
Hereafter, we list the broken uses that are currently detected by Maracas.
The concrete Car class in a client project extends the LandVehicle abstract class defined in the library.
The Car class does not provide an implementation for the move method defined in the Vehicle abstract class.
Then, a broken use is reported pointing to the Car class declaration.
// Broken use reported here
public class Car extends LandVehicle {
private String type;
}