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 2013/03/27 21:20:04 UTC

svn commit: r1461838 - /uima/uimaj/branches/filteredCompress-uima-2498/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java

Author: schor
Date: Wed Mar 27 20:20:04 2013
New Revision: 1461838

URL: http://svn.apache.org/r1461838
Log:
[UIMA-2498] merge in from trunk, pick up sync fix to typesystem impl.

Modified:
    uima/uimaj/branches/filteredCompress-uima-2498/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java

Modified: uima/uimaj/branches/filteredCompress-uima-2498/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/filteredCompress-uima-2498/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java?rev=1461838&r1=1461837&r2=1461838&view=diff
==============================================================================
--- uima/uimaj/branches/filteredCompress-uima-2498/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java (original)
+++ uima/uimaj/branches/filteredCompress-uima-2498/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java Wed Mar 27 20:20:04 2013
@@ -198,6 +198,10 @@ public class TypeSystemImpl implements T
 
   private int numCommittedTypes = 0;
 
+  private int numTypeNames = 0;
+
+  private int numFeatureNames = 0;
+
   final CASMetadata casMetadata; // needs to be visible in package
   
   // map from type code to TypeInfo instance for that type code,
@@ -841,6 +845,9 @@ public class TypeSystemImpl implements T
    * Get the overall number of features defined in the type system.
    */
   public int getNumberOfFeatures() {
+    if (this.isCommitted()) {
+      return this.numFeatureNames;
+    }
     return this.featureNameST.size();
   }
 
@@ -848,6 +855,9 @@ public class TypeSystemImpl implements T
    * Get the overall number of types defined in the type system.
    */
   public int getNumberOfTypes() {
+    if (this.isCommitted()) {
+      return this.numTypeNames;
+    }
     return this.typeNameST.size();
   }
 
@@ -1101,6 +1111,8 @@ public class TypeSystemImpl implements T
     // because subsumes depends on it
     // and generator initialization uses subsumes
     this.numCommittedTypes = this.types.size(); // do before
+    this.numTypeNames = this.typeNameST.size();
+    this.numFeatureNames = this.featureNameST.size();
     this.typeInfoArray = new TypeInfo[getTypeArraySize()];
     // cas.commitTypeSystem -
     // because it will call the type system iterator