I'm switching to IntelliJ IDEA from Eclipse and i get compile errors in IntelliJ, but not in eclipse.
public class TestClass<K, V extends Comparable<V>> {
private K key;
private V value;
public void someMethod() {
if (this.value instanceof String) {
String stringValue = (String) this.value;
// some code
}
}
}
(dont blame me for that code, it's legacy code and not mine)
In eclipse everything is fine, in intellij it is marked as an error which says "inconvertible type, cannot cast V to java.lang.String".
For both i use my standard MacOS X JDK (1.6.0_65).
It's not only with String, it's with every type/class (i have some other concurrents of this)
Why do i get these errors in intellij but not in eclipse?