You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2015/12/31 15:50:19 UTC

svn commit: r1722446 - /uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/BinaryCasSerDes6.java

Author: schor
Date: Thu Dec 31 14:50:19 2015
New Revision: 1722446

URL: http://svn.apache.org/viewvc?rev=1722446&view=rev
Log:
[UIMA-4718] when deserializing type Document Annotation, remove it from all indexes first, update, then add back

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

Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/BinaryCasSerDes6.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/BinaryCasSerDes6.java?rev=1722446&r1=1722445&r2=1722446&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/BinaryCasSerDes6.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/BinaryCasSerDes6.java Thu Dec 31 14:50:19 2015
@@ -1800,8 +1800,18 @@ public class BinaryCasSerDes6 {
               preventFsGc.add(currentFs = view.createFS(srcType));
             }
           }
-          for (Runnable r : singleFsDefer) {
-            r.run();
+          if (srcType.getCode() == TypeSystemImpl.docTypeCode) { 
+            boolean wasRemoved = cas.removeFromCorruptableIndexAnyViewSetCache(currentFs, cas.getAddbackSingle());
+            for (Runnable r : singleFsDefer) {
+              r.run();
+            }
+            if (wasRemoved) {
+              cas.addbackSingle(currentFs);
+            }
+          } else {
+            for (Runnable r : singleFsDefer) {
+              r.run();
+            }
           }
         }
       }