Koloboke icon indicating copy to clipboard operation
Koloboke copied to clipboard

Cursor.setValue(V) does not set the curValue

Open Neiko2002 opened this issue 8 years ago • 0 comments

I was iterating through a HashMap with a cursor and called the setValue(V) method to replace the current value. The new value was set in the vals[] array but did not replaced the curValue.

MutableLHashSeparateKVIntObjMapGO.java

        @Override
        public void setValue(V value) {
            if (curKey != free) {
                if (expectedModCount == modCount()) {
                    vals[index] = value;
                    if (vals != values) {
                        values[index] = value;
                    }
                } else {
                    throw new java.util.ConcurrentModificationException();
                }
            } else {
                throw new java.lang.IllegalStateException();
            }
        }

Neiko2002 avatar Jun 09 '16 09:06 Neiko2002