Author: schor
Date: Fri Sep 16 17:44:22 2016
New Revision: 1761065

URL: http://svn.apache.org/viewvc?rev=1761065&view=rev
Log:
[UIMA-4664] restore concurrency checks (removed in earlier impl using Java 
treeset, needed to be restored when impl changed to OrderedFsSet_array)

Modified:
    
uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/FsIterator_set_sorted.java

Modified: 
uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/FsIterator_set_sorted.java
URL: 
http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/FsIterator_set_sorted.java?rev=1761065&r1=1761064&r2=1761065&view=diff
==============================================================================
--- 
uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/FsIterator_set_sorted.java
 (original)
+++ 
uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/FsIterator_set_sorted.java
 Fri Sep 16 17:44:22 2016
@@ -95,17 +95,18 @@ class FsIterator_set_sorted<T extends Fe
   
   @Override
   public void moveToNextNvc() { 
-//    checkConcurrentModification();  // skip this check because the Treeset 
has its own 
     if (isGoingForward) {
       if (isCurrentElementFromLastGet) {
         isCurrentElementFromLastGet = false;
       } else {
+        checkConcurrentModification();
         currentElement = iterator.next();
         // leave isCurrentElementFromLastGet false because we just moved to 
next, but haven't retrieved that value
       } 
     } else {
       //reverse direction
       if (!isCurrentElementFromLastGet) {
+        checkConcurrentModification();
         currentElement = iterator.next();  // need current value to do reverse 
iterator starting point
       }
       assert(currentElement != null);
@@ -127,18 +128,18 @@ class FsIterator_set_sorted<T extends Fe
   
   @Override
   public void moveToPreviousNvc() {
-
-//  checkConcurrentModification();  // skip this check because the Treeset has 
its own 
     if (!isGoingForward) {
       if (isCurrentElementFromLastGet) {
         isCurrentElementFromLastGet = false;
       } else {
+        checkConcurrentModification();
         currentElement = iterator.next();
         // leave isCurrentElementFromLastGet false
       } 
     } else {
       //reverse direction
       if (!isCurrentElementFromLastGet) {
+        checkConcurrentModification();
         currentElement = iterator.next();  // need current value to do reverse 
iterator starting point
       }
       assert(currentElement != null);
@@ -153,8 +154,8 @@ class FsIterator_set_sorted<T extends Fe
     if (!isValid()) {
       throw new NoSuchElementException();
     }
-//  checkConcurrentModification();  // skip this check because is done on some 
moves 
     if (!isCurrentElementFromLastGet) {
+      checkConcurrentModification(); 
       currentElement = iterator.next();
       isCurrentElementFromLastGet = true;
     }
@@ -163,8 +164,8 @@ class FsIterator_set_sorted<T extends Fe
 
   @Override
   public T getNvc() {
-//    checkConcurrentModification();  // don't need this check on get, only on 
some moves?
     if (!isCurrentElementFromLastGet) {
+      checkConcurrentModification();
       currentElement = iterator.next();
       isCurrentElementFromLastGet = true;
     }


Reply via email to