I have one Interface, build and provided as jar, java src, and target = 1.5
interface IGetter {
int getInternalID(final long externId);
int getInternalID(long externId, char specifier);
}
And I implement an inner static class in java 1.8 implementing this interface
public static Calculator {
...
public static class LookupTable implements IGetter {
/* (non-Javadoc)
* @see com.mycompany.IGetter#getInternalID(long)
*/
@Override
public int getInternalID(long externId) {
....
return internId;
}
/* (non-Javadoc)
* @see com.mycompany.IGetter#getInternalID(long, char)
*/
@Override <-- Here compiler error; This method is not detected
as beeing in the interface.
public int getInternalID(long externalId, char specifier) {
return ...;
}
}
}
The second getInternal(long, char)
method is not detected by the compiler as beeing an interface method.
Clicking on the jar file that contains the interface, even the class viewer in eclipse, show on the left pane in the method overview that the method is missing, while in the editor view it shows that the method is implemented in the interface.
What is wrong, Is it not allowed to have the same name for two methods in an interface?
Why the java compiler compiles the interface? (src and target = java 1.5)
Why does the java 1.8 compile does not recognize it as interface method. (src and target 1.8)
Compiler error is: The method getInternalID(long, char) of type Calculator.LookupTable must override or implement a supertype method Calculator.java