Background: The main issue we've been encountering is our Eclipse Helios running in Redhat linux Santiago 6 crashes and sometimes not responding. We are not able to figure out the root cause and tried different solutions i've read from different sites including stackoverflow.
What i have done so far: So i have decided to download Eclipse Luna and imported the existing projects from my Eclipse Helios and changed the installed jre in eclipse luna to jrockit built in WLS 1.8(as we are using a legacy framework)
Issue: After i imported my existing project, there's a problem with eclipse luna.
Duplicate methods named put with the parameters (K, V) and (Object, Object) are inherited from the types HashMap and AbstractMap
The method put(Object, Object) is ambiguous for the type
But this error is not being encountered in eclipse helios.
I also download eclipse Juno, Kepler but same issue as luna.
Question: Is there a workaround for this or how can i turn off and ignore this error in eclipse luna?
Edit: Sample Code As requested
This is one of the classes that has error.
public class DummyMessageMap extends HashMap implements MessageMap {
// implementation of the interface but returns null values.
}
public interface MessageMap extends Map{
public Message getMessage(String key);
public String getLanguage();
}
The problem here is that the interface java.util.Map
reaches your class DummyMessageMap
via two paths, i.e., DummyMessageMap extends HashMap extends AbstractMap implements Map
and DummyMessageMap implements MessageMap extends Map
. In the second path, as the error shows, the generic types K
and V
got specified as object
and object
in your code. This is a design smell called Multipath Hierarchy
and there is no way but to get rid of this path conflict. Try removing extends Map
from MessageMap
if possible.