Interface I can not implement several times with different arguments: I am <String> and I <String>
I have a problem in eclipse with the following four lines distributed across the respective four files:
public interface I<T> {} public interface ISpecial<T> extends I<T> {} public class Base implements I<String> {} public class Special extends Base implements ISpecial<String> {} Eclipse tells me (and only I and not one of the few people having the same, slightly more complex project, imported into their workspace)
The interface I cannot be implemented more than once with different arguments: I<String> and I<String>
This happens since a few days ago I checked and installed the Eclipse updates (which I had not done for several months) and changed some of the Errors / Warnings settings in the Java Compiler settings dialog box (so I don’t know Is any of these changes to blame, but since then I switched everything that could have been an “error” to “Warning,” and the problem persists.)
I would like to tactfully introduce Eclipse that <String> not another argument from <String> , but does not know how or something is missing here.
Update: After the compliance level of the JDK compiler is 1.5 (from 1.7), the problem disappeared in the test project that I created (with the code above), but not in a more complex project, this initially happened. In the first case, the problem did not return after the correspondence level was set to 1.6 or 1.7, so now I can no longer reproduce the problem with a minimal example without solving the problem itself.
A common problem is that such warnings / errors do not mention the full names of conflicting classes. Perhaps there are two “String” classes in your class path and that “Base.java” imports the first and “Special.java” the second. Check your import: it will probably be java.lang.String, and the other from another implementation.