Package java.util

Examples of java.util.ConcurrentModificationException


         * @exception NoSuchElementException if there is no element left in the map
         */
        public int key()
            throws ConcurrentModificationException, NoSuchElementException {
            if (referenceCount != count) {
                throw new ConcurrentModificationException();
            }
            if (current < 0) {
                throw new NoSuchElementException();
            }
            return keys[current];
View Full Code Here


         * @exception NoSuchElementException if there is no element left in the map
         */
        public T value()
            throws ConcurrentModificationException, NoSuchElementException {
            if (referenceCount != count) {
                throw new ConcurrentModificationException();
            }
            if (current < 0) {
                throw new NoSuchElementException();
            }
            return values[current];
View Full Code Here

         */
        public void advance()
            throws ConcurrentModificationException, NoSuchElementException {

            if (referenceCount != count) {
                throw new ConcurrentModificationException();
            }

            // advance on step
            current = next;

View Full Code Here

        nodeFactory());
    BstMutationResult<E, Node<E>> mutationResult =
        BstOperations.mutate(comparator(), mutationRule, rootReference.get(), e);
    if (!rootReference.compareAndSet(
        mutationResult.getOriginalRoot(), mutationResult.getChangedRoot())) {
      throw new ConcurrentModificationException();
    }
    Node<E> original = mutationResult.getOriginalTarget();
    return countOrZero(original);
  }
View Full Code Here

    Node<E> root = rootReference.get();
    Node<E> cleared = BstRangeOps.minusRange(range,
        BstCountBasedBalancePolicies.<E, Node<E>>fullRebalancePolicy(distinctAggregate()),
        nodeFactory(), root);
    if (!rootReference.compareAndSet(root, cleared)) {
      throw new ConcurrentModificationException();
    }
  }
View Full Code Here

  }
 
  private void incrementHit(K key, long count) {
    Set<K> keys = evictionMap.get(count);
    if (keys == null) {
      throw new ConcurrentModificationException();
    }
    if (keys.remove(key) == false) {
      throw new ConcurrentModificationException();
    }
    if (keys.isEmpty()) {
      evictionMap.remove(count);
    }
    count++;
View Full Code Here

    public void remove() {
      checkState(canRemove,
          "no calls to next() since the last call to remove()");
      int frequency = currentEntry.getValue().get();
      if (frequency <= 0) {
        throw new ConcurrentModificationException();
      }
      if (currentEntry.getValue().addAndGet(-1) == 0) {
        entryIterator.remove();
      }
      size--;
View Full Code Here

          listNodeReferenceValue) {
        return;
    }
      } catch (ObjectNotFoundException onfe) {
      }
      throw new ConcurrentModificationException(
        "The ListNode has been modified or removed");

  }
View Full Code Here

        ValueEntry<K, V> toRemove;
        int expectedModCount = modCount;

        private void checkForComodification() {
          if (modCount != expectedModCount) {
            throw new ConcurrentModificationException();
          }
        }

        @Override
        public boolean hasNext() {
View Full Code Here

      return value;
    }

    public void checkAndSet(@Nullable T expected, T newValue) {
      if (value != expected) {
        throw new ConcurrentModificationException();
      }
      value = newValue;
    }
View Full Code Here

TOP

Related Classes of java.util.ConcurrentModificationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.