Hi, I enounter a very odd behaviour of a TreeMap. This is the code fragment: System.err.println("contains: " + state.getIndexMap().containsKey(termString)); for (TerminalString term : state.getIndexMap().keySet()) System.err.println("KEYS: " + term + "==" + termString +":" + term.equals(termString) + " compare: " + state.getIndexMap().comparator().compare(term, termString)); The TreeMap returned getIndexMap contains mappings from TerminalString to Integer. This is the output: contains: false KEYS: redeclare (1581148120) ==redeclare (1581148120) :true compare: 0 So the key _is_ in that map. It also has the very same hashcode and the comparator returns 0 and equals() is true. But still containsKey returns zero. Any guess why that?
Attachment:
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
-- fedora-devel-java-list mailing list fedora-devel-java-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/fedora-devel-java-list