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/10/05 19:23:41 UTC

svn commit: r1811239 - /uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSClassRegistry.java

Author: schor
Date: Thu Oct  5 19:23:41 2017
New Revision: 1811239

URL: http://svn.apache.org/viewvc?rev=1811239&view=rev
Log:
no Jira - handle use case where a JCas type defines some feature which the current type system doesn't have.  Allow this to proceed, throwing errors in the future only if that feature is accessed (since it isn't part of the loaded type system).

Modified:
    uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSClassRegistry.java

Modified: uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSClassRegistry.java
URL: http://svn.apache.org/viewvc/uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSClassRegistry.java?rev=1811239&r1=1811238&r2=1811239&view=diff
==============================================================================
--- uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSClassRegistry.java (original)
+++ uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSClassRegistry.java Thu Oct  5 19:23:41 2017
@@ -482,6 +482,10 @@ public abstract class FSClassRegistry {
       if (null != callsites) {
         for (Entry<String, MutableCallSite> e : callsites) {
           final int index = TypeSystemImpl.getAdjustedFeatureOffset(e.getKey());
+          if (index == -1) {
+            continue;  // a feature in the JCas class doesn't exist in the currently loaded type system
+                       // skip setting it.  If code uses this, a runtime error will happen.
+          }
           final int prev = (int) e.getValue().getTarget().invokeExact();
           
           if (prev == -1) {