I'd really tough time understanding what went wrong. Beginning with this, I've an interface like this...
public interface UserRecordsInterface
{
public abstract List getRecordsVector()
throws UserExitException;
}
I wanted to implement this interface in my class MyRecordsClass.java like this...
public class MyRecordsClass implements UserRecordsInterface{
private List addendaRecs = null;
/**
* Return the list of addenda records
*
* @return List
*/
public List getRecordsVector() {
return addendaRecs;
}
}
While compiling using ant, I got 2 errors..
1 Class MyRecordsClass is not abstract and does not override the abstract method getRecordsVector() in UserRecordInterface.
2 getRecordsVector() in MyRecordsClass cannot implement getRecordsVector() in UserRecordsInterface; attempting to use incompatible return type.
- [javac] found : java.util.List
- [javac] required: java.util.Vector
- [javac] public List getRecordsVector() {
Initially, the method getRecordsVector()
had return type Vector in the interface. Now, it was changed to List. So, I've changed accordingly in my class. Now, its giving this error. If I change my class to Vector & compile, then its working fine. But I want to use List, because thats what currently the interface has. So, I believe that ant is still pointed to the old lib that has vector interface. Not sure, if this is some problem with ant or with my code. Please suggest..