Question:
In one project, an ICar interface was created, it has methods
CarsReturnCode addOwner(Owner owner);
CarsReturnCode addCar(Car car);
CarsReturnCode addModel(Model model);
CarsReturnCode updateOwner(int regNumber, int ownerId);
CarsReturnCode removeOwner(int ownerId);
etc.
In another project, using Maven, I create a dependency. I create a class that implements the ICar interface. As soon as I implement the methods, in some methods the argument names change and look like this:
CarsReturnCode updateOwner(int i, int i1){
return null;
}
CarsReturnCode removeOwner(int i){
return null;
}
Why do the argument names change? How can this be resolved?
Answer:
To know what names to use, IDEA needs access from the project in which the interface is inherited to the source code of the project in which this interface is defined. Go to Project Structure → Modules → Dependencies and specify one project as a dependency of another.