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 15:02:17 UTC
svn commit: r1722871 -
/uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/CasTypeSystemMapper.java
Author: schor
Date: Mon Jan 4 14:02:17 2016
New Revision: 1722871
URL: http://svn.apache.org/viewvc?rev=1722871&view=rev
Log:
[UIMA-4718] add support for missing features where the missing feature has an offset > the number of features in the other type system's type
Modified:
uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/CasTypeSystemMapper.java
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/CasTypeSystemMapper.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/CasTypeSystemMapper.java?rev=1722871&r1=1722870&r2=1722871&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/CasTypeSystemMapper.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/CasTypeSystemMapper.java Mon Jan 4 14:02:17 2016
@@ -168,7 +168,14 @@ public class CasTypeSystemMapper {
public FeatureImpl getToFeature(FeatureImpl[][] mapByTypeCode, TypeImpl fromType, FeatureImpl fromFeat) {
FeatureImpl[] map = mapByTypeCode[fromType.getCode()];
- return (map == null) ? null : map[fromFeat.getOffset()];
+ if (map == null) {
+ return null;
+ }
+ final int offset = fromFeat.getOffset();
+ if (map.length <= offset) {
+ return null;
+ }
+ return map[offset];
}