You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by re...@apache.org on 2020/05/18 18:58:01 UTC

[uima-uimaj] 01/01: [UIMA-6168] protect indexes fails when there were no indexed fs that needed protecting

This is an automated email from the ASF dual-hosted git repository.

rec pushed a commit to branch UIMA-6168-protect-indexes-fails-when-there-were-no-indexed-fs-that-needed-protecting
in repository https://gitbox.apache.org/repos/asf/uima-uimaj.git

commit 6a430169f9d83db5258d02fe8aa215ed7bffd6bd
Author: Richard Eckart de Castilho <re...@apache.org>
AuthorDate: Mon May 18 20:57:34 2020 +0200

    [UIMA-6168] protect indexes fails when there were no indexed fs that needed protecting
    
    - Restore dropping protection levels in the CAS when closing a FSsTobeAddedback context
---
 uimaj-core/src/main/java/org/apache/uima/cas/impl/CASImpl.java | 10 +++++++---
 .../main/java/org/apache/uima/cas/impl/FSsTobeAddedback.java   |  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASImpl.java b/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASImpl.java
index 568c3d0..d29dbbf 100644
--- a/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASImpl.java
+++ b/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASImpl.java
@@ -5406,9 +5406,13 @@ public Iterator<CAS> getViewIterator(String localViewNamePrefix) {
     return r;
   }
   
-//  void dropProtectIndexesLevel () {
-//    svd.fssTobeAddedback.remove(svd.fssTobeAddedback.size() -1);
-//  }
+  void dropProtectIndexesLevel () {
+    if (svd.fssTobeAddedback.isEmpty()) {
+      return;
+    }
+    
+    svd.fssTobeAddedback.remove(svd.fssTobeAddedback.size() -1);
+  }
   
   /**
    * This design is to support normal operations where the
diff --git a/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSsTobeAddedback.java b/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSsTobeAddedback.java
index 0342c32..e5d1fd6 100644
--- a/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSsTobeAddedback.java
+++ b/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSsTobeAddedback.java
@@ -208,7 +208,7 @@ abstract class FSsTobeAddedback implements AutoCloseable {
         }
       }
       clear();
-//      cas.dropProtectIndexesLevel();
+      cas.dropProtectIndexesLevel();
     }
     
     @Override