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/02/09 16:19:58 UTC

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

Author: schor
Date: Thu Feb  9 16:19:58 2017
New Revision: 1782362

URL: http://svn.apache.org/viewvc?rev=1782362&view=rev
Log:
[UIMA-5304] impl fixes for select

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

Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/SelectFSs_impl.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/SelectFSs_impl.java?rev=1782362&r1=1782361&r2=1782362&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/SelectFSs_impl.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-core/src/main/java/org/apache/uima/cas/impl/SelectFSs_impl.java Thu Feb  9 16:19:58 2017
@@ -1101,7 +1101,7 @@ public class SelectFSs_impl <T extends F
    */
   @Override
   public SelectFSs<T> following(Annotation fs) {
-    return commonFollowing(fs, 0);
+    return following(fs, 0);
   }
 
   /* (non-Javadoc)
@@ -1109,7 +1109,7 @@ public class SelectFSs_impl <T extends F
    */
   @Override
   public SelectFSs<T> following(int position) {
-    return commonFollowing(makePosAnnot(0, position), 0);
+    return following(position, 0);
   }
 
   /* (non-Javadoc)
@@ -1117,6 +1117,9 @@ public class SelectFSs_impl <T extends F
    */
   @Override
   public SelectFSs<T> following(Annotation fs, int offset) {
+    if (fs.getBegin() < fs.getEnd()) {
+      fs = makePosAnnot(fs.getEnd(), fs.getEnd());
+    }
     return commonFollowing(fs, offset);
   }
 
@@ -1125,7 +1128,7 @@ public class SelectFSs_impl <T extends F
    */
   @Override
   public SelectFSs<T> following(int position, int offset) {
-    return commonFollowing(makePosAnnot(0, position), offset);
+    return commonFollowing(makePosAnnot(position, position), offset);
   }
 
   /* (non-Javadoc)
@@ -1133,7 +1136,7 @@ public class SelectFSs_impl <T extends F
    */
   @Override
   public SelectFSs<T> preceding(Annotation fs) {
-    return commonPreceding(fs, 0);
+    return preceding(fs, 0);
   }
 
   /* (non-Javadoc)
@@ -1141,7 +1144,7 @@ public class SelectFSs_impl <T extends F
    */
   @Override
   public SelectFSs<T> preceding(int position) {
-    return commonPreceding(makePosAnnot(position, Integer.MAX_VALUE), 0);
+    return preceding(position, 0);
   }
 
   /* (non-Javadoc)
@@ -1149,6 +1152,9 @@ public class SelectFSs_impl <T extends F
    */
   @Override
   public SelectFSs<T> preceding(Annotation annotation, int offset) {
+    if (annotation.getEnd() < Integer.MAX_VALUE) {
+      annotation = makePosAnnot(annotation.getBegin(), Integer.MAX_VALUE);
+    }
     return commonPreceding(annotation, offset);
   }