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 2017/01/13 22:03:17 UTC

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

Author: schor
Date: Fri Jan 13 22:03:17 2017
New Revision: 1778670

URL: http://svn.apache.org/viewvc?rev=1778670&view=rev
Log:
[UIMA-4674] add property to disable type system consolidation to aid migration. Rename of FSGenerator. fix ll_getParentType.

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

Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java?rev=1778670&r1=1778669&r2=1778670&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/TypeSystemImpl.java Fri Jan 13 22:03:17 2017
@@ -132,7 +132,10 @@ public class TypeSystemImpl implements T
    */
   public static final String DISABLE_TYPESYSTEM_CONSOLIDATION = "uima.disable_typesystem_consolidation";
 
-  private static final boolean IS_DISABLE_TYPESYSTEM_CONSOLIDATION = //true || // debug
+  /**
+   * public for test case
+   */
+  public static final boolean IS_DISABLE_TYPESYSTEM_CONSOLIDATION = // true || // debug
       Misc.getNoValueSystemProperty(DISABLE_TYPESYSTEM_CONSOLIDATION);
  
 //  private final static String DECOMPILE_JCAS = "uima.decompile.jcas";
@@ -413,7 +416,7 @@ public class TypeSystemImpl implements T
    * Shared by all CASes using this type system
    *   Excludes FsGeneratorArrays - those are built-in and constant 
    */
-  private final Map<ClassLoader, FsGenerator[]> generatorsByClassLoader = new IdentityHashMap<>();
+  private final Map<ClassLoader, FsGenerator3[]> generatorsByClassLoader = new IdentityHashMap<>();
 
   public TypeSystemImpl() {
 
@@ -1846,7 +1849,10 @@ public class TypeSystemImpl implements T
    */
   @Override
   public int ll_getParentType(int typeCode) {
-    return types.get(typeCode).getCode();
+    if (typeCode == 1) {
+      return 0;
+    }
+    return types.get(typeCode).getSuperType().getCode();
   }
   
   /**
@@ -2575,9 +2581,9 @@ public class TypeSystemImpl implements T
    * @param isPear -
    * @return the generators
    */
-  public FsGenerator[] getGeneratorsForClassLoader(ClassLoader cl, boolean isPear) {
+  public FsGenerator3[] getGeneratorsForClassLoader(ClassLoader cl, boolean isPear) {
     synchronized (generatorsByClassLoader) {
-      FsGenerator[] g = generatorsByClassLoader.get(cl);
+      FsGenerator3[] g = generatorsByClassLoader.get(cl);
       if (g == null) {
         g = FSClassRegistry.getGeneratorsForClassLoader(cl, isPear, this);
         generatorsByClassLoader.put(cl, g);