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 2016/01/04 02:31:58 UTC
svn commit: r1722779 -
/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASImpl.java
Author: schor
Date: Mon Jan 4 01:31:58 2016
New Revision: 1722779
URL: http://svn.apache.org/viewvc?rev=1722779&view=rev
Log:
[UIMA-4722] remove from proper view.
Modified:
uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASImpl.java
Modified: uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASImpl.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASImpl.java?rev=1722779&r1=1722778&r2=1722779&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASImpl.java (original)
+++ uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASImpl.java Mon Jan 4 01:31:58 2016
@@ -355,9 +355,11 @@ public class CASImpl extends AbstractCas
void addbackSingle(int fsAddr) {
svd.fsTobeAddedbackSingle.addback(fsAddr);
svd.fsTobeAddedbackSingleInUse = false;
+// System.out.format("debug return (addbackSingle) add back single for cas %s%n", this.getViewName());
}
void resetAddbackSingleInUse() {
+// System.out.format("debug return (reset) add back single for cas %s%n", this.getViewName());
svd.fsTobeAddedbackSingleInUse = false;
}
@@ -365,6 +367,7 @@ public class CASImpl extends AbstractCas
if (svd.fsTobeAddedbackSingleInUse) {
throw new RuntimeException(); // internal error
}
+// System.out.format("debug checkout add back single for cas %s%n", this.getViewName());
svd.fsTobeAddedbackSingleInUse = true;
return svd.fsTobeAddedbackSingle;
}
@@ -1461,6 +1464,7 @@ public class CASImpl extends AbstractCas
// first disable auto addbacks for index corruption - this routine is handling that
svd.fsTobeAddedbackSingleInUse = true; // sorry, a bad hack...
+// System.out.format("debug checkout (fake) add back single for cas %s%n", this.getViewName());
try {
for (int i = 0; i < fsmodssz; i++) {
final int heapAddrBeingModified = readInt(dis, swap);
@@ -1470,6 +1474,7 @@ public class CASImpl extends AbstractCas
bds.tobeAddedback.addback(bds.lastRemovedFsAddr);
bds.fssAddrArray = null; // free storage
} finally {
+// System.out.format("debug return (fake) add back single for cas %s%n", this.getViewName());
svd.fsTobeAddedbackSingleInUse = false;
}
}
@@ -4603,13 +4608,14 @@ public class CASImpl extends AbstractCas
}
String newDoc = ll_getSofaDataString(this.mySofaRef);
if (null != newDoc) {
- int count = 0;
final int docAnnot = ll_getDocumentAnnotation();
if (docAnnot != 0) {
- count = this.indexRepository.removeIfInCorrputableIndexInThisView(docAnnot);
+ boolean wasRemoved = this.removeFromCorruptableIndexAnyViewSetCache(docAnnot, this.getAddbackSingle());
setFeatureValueNoIndexCorruptionCheck(docAnnot, TypeSystemImpl.endFeatCode, newDoc.length());
- if (count > 0) {
- ((FSIndexRepositoryImpl)ll_getIndexRepository()).ll_addback(docAnnot, count);
+ if (wasRemoved) {
+ this.addbackSingle(docAnnot);
+ } else {
+ this.svd.fsTobeAddedbackSingleInUse = false;
}
} else {
// not in the index (yet)