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 2014/12/09 23:12:35 UTC
svn commit: r1644206 -
/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FeatureStructureImpl.java
Author: schor
Date: Tue Dec 9 22:12:35 2014
New Revision: 1644206
URL: http://svn.apache.org/r1644206
Log:
[UIMA-4135] slight optimizations to skip index corruption checks where possible
Modified:
uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FeatureStructureImpl.java
Modified: uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FeatureStructureImpl.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FeatureStructureImpl.java?rev=1644206&r1=1644205&r2=1644206&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FeatureStructureImpl.java (original)
+++ uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FeatureStructureImpl.java Tue Dec 9 22:12:35 2014
@@ -34,6 +34,11 @@ import org.apache.uima.internal.util.rb_
/**
* Feature structure implementation.
*
+ * This is the common super class of all Feature Structures
+ *
+ * including the JCAS (derived from TOP)
+ * and non JCas FSs
+ *
*
* @version $Revision: 1.6 $
*/
@@ -68,7 +73,8 @@ public abstract class FeatureStructureIm
new String[] { feat.getName(), feat.getRange().getName(), fs.getType().getName() });
throw e;
}
- this.getCASImpl().setFeatureValue(this.getAddress(), featCode, valueAddr);
+ // keys are not fsRefs
+ this.getCASImpl().setFeatureValueNoIndexCorruptionCheck(this.getAddress(), featCode, valueAddr);
}
private final void setNullValue(int featCode, int rangeType) {
@@ -78,7 +84,8 @@ public abstract class FeatureStructureIm
new String[] { this.getCASImpl().getTypeSystemImpl().ll_getFeatureForCode(featCode).getName() });
throw e;
}
- this.getCASImpl().setFeatureValue(this.getAddress(), featCode, CASImpl.NULL);
+ // a null fsref is never an index key
+ this.getCASImpl().setFeatureValueNoIndexCorruptionCheck(this.getAddress(), featCode, CASImpl.NULL);
}
public void setIntValue(Feature feat, int val) {
@@ -143,7 +150,7 @@ public abstract class FeatureStructureIm
}
final int featCode = ((FeatureImpl) feat).getCode();
- this.getCASImpl().setFeatureValue(this.getAddress(), featCode, val);
+ this.getCASImpl().setFeatureValueNoIndexCorruptionCheck(this.getAddress(), featCode, val);
}
public void setBooleanValue(Feature feat, boolean b) throws CASRuntimeException {
@@ -158,7 +165,6 @@ public abstract class FeatureStructureIm
throwIllegalRangeExc(feat, ts.getType(CAS.TYPE_NAME_BOOLEAN));
}
final int featCode = ((FeatureImpl) feat).getCode();
-
this.getCASImpl().setFeatureValue(this.getAddress(), featCode, b);
}