If you look at the code, it will be obvious. A ClassCastException will occur when doing operations like: aLocatorSet = (TreeSet) ((Map.Entry) aValueIterator.next()).getValue(); That is because the Iterator being used is from a Collection, not a map. The change is to get the Iterator from the entrySet() of the TreeMap instead of the values(). e.g. aValueIterator = itsValues.entrySet().iterator(); instead of aValueIterator = itsValues.values().iterator(); If you run the buggy version, everything appears OK (poor error handling) but indexes are not used. Patch for org.apache.xindice.core.indexer.MemValueIndexer is attached.
Created attachment 16892 [details] Patch for MemValueIndexer.java Fixed silent failure with ClassCastException. The MemValueIndexer did not work as originally written but poor error handling caused tests to think everything was OK.
Patch applied. Thanks!