Merge branch 'main' into bugfix/UIMA-6323-SeedLexer-not-generated-when-building-in-Eclipse

* main: (77 commits)
  [UIMA-6307] Centralize Jenkins pipelines
  [UIMA-6301] Rename "master" branches to "main"
  HD-6268: revised and improved documentation
  UIMA-6281: fix method for null arguments
  UIMA-6281: Ruta: use uimaFIT instead of CAS.select().coveredBy() internally
  UIMA-6281: Ruta: use uimaFIT instead of CAS.select().coveredBy() internally
  no jira - deactivate test for now
  UIMA-6271: Ruta: option to validate internal indexing in RutaEngine
  [UIMA-6231] Reducing memory pressure generated by UIMA Ruta
  [NO JIRA] Copying v3 code to a branch under the v2 spot so it gets included in the GitHub mirror.
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release ruta-3.0.1
  UIMA-6194: merge v2 changes
  no jira - manual rollback
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release ruta-3.0.1
  merged v2: UIMA-6195, UIMA-6194, UIMA-6193, UIMA-6192, UIMA-6191, UIMA-6183, UIMA-6171
  no jira - update updatesite version
  no jira - preparations fro next release - updated versions - updated jira version - updated release notes
  UIMA-6183: fix NPE and visibility problems of literal string matches in v3, behavior adapted in order to avoid unexpected matching within tokens
  ...

% Conflicts:
%	Jenkinsfile
%	ruta-core/src/test/java/org/apache/uima/ruta/expression/annotation/AnnotationLabelExpressionTest.java
diff --git a/README b/README
index 9631e49..49770b6 100644
--- a/README
+++ b/README
@@ -1,7 +1,10 @@
 

-Apache UIMA Ruta (TM) v2.8.1

+Apache UIMA Ruta (TM) v3.0.1

 -------------------------------------------------------------------------

 

+This release is compatible with UIMA v3, but not compatible with UIMA v2. 

+For compatibility to UIMA v2, please refer to the latest UIMA Ruta v2 release, e.g., 2.8.0.

+

 Building from the Source Distribution

 -------------------------------------

 

diff --git a/RELEASE_NOTES.html b/RELEASE_NOTES.html
index d660e5a..e97ef5d 100644
--- a/RELEASE_NOTES.html
+++ b/RELEASE_NOTES.html
@@ -21,10 +21,10 @@
    -->

 

 <head>

-  <title>Apache UIMA Ruta v2.8.1 Release Notes</title>

+  <title>Apache UIMA Ruta v3.0.1 Release Notes</title>

 </head>

 <body>

-<h1>Apache UIMA Ruta&#8482; v2.8.1 Release Notes</h1>

+<h1>Apache UIMA Ruta&#8482; v3.0.1 Release Notes</h1>

 

 <h2>Contents</h2>

 <p>

@@ -37,18 +37,23 @@
    

 <h2><a name="what.is.uima-ruta">1. What is UIMA Ruta?</a></h2>

 

-     <p>

-  			Apache UIMA Ruta&#8482; is a rule-based script language supported by Eclipse-based tooling.

-      The language is designed to enable rapid development of text processing applications within Apache UIMA&#8482;. 

-      A special focus lies on the intuitive and flexible domain specific language for defining 

-      patterns of annotations. The Eclipse-based tooling for Ruta, called the Ruta Workbench,

-      was created to support the user and to facilitate every step when writing Ruta rules. Both the 

-      Ruta rule language and the Ruta Workbench integrate smoothly with Apache UIMA.

-			</p>

+<p>

+  Apache UIMA Ruta&#8482; is a rule-based script language supported by Eclipse-based tooling.

+  The language is designed to enable rapid development of text processing applications within Apache UIMA&#8482;. 

+  A special focus lies on the intuitive and flexible domain specific language for defining 

+  patterns of annotations. The Eclipse-based tooling for Ruta, called the Ruta Workbench,

+  was created to support the user and to facilitate every step when writing Ruta rules. Both the 

+  Ruta rule language and the Ruta Workbench integrate smoothly with Apache UIMA.

+</p>

 

 <h2><a name="major.changes">2. Major Changes in this Release</a></h2>

 

 <p>

+  This release provides compatibility to UIMA v3. An upgrade from UIMA Ruta v2 to this version requires 

+  also an update to UIMA v3 of the overall application or Eclipse installation. Please refer to the 

+  UIMA v3 user's guide for detailed information: https://uima.apache.org/d/uimaj-3.0.0/version_3_users_guide.html

+</p>

+<p>

   <p>UIMA Ruta Language and Analysis Engine:</p>

   <ul>

   	<li>Fixed broken literal string matching.</li>

diff --git a/example-projects/ruta-ep-example-extensions/.gitignore b/example-projects/ruta-ep-example-extensions/.gitignore
index 718773c..7e3a306 100644
--- a/example-projects/ruta-ep-example-extensions/.gitignore
+++ b/example-projects/ruta-ep-example-extensions/.gitignore
@@ -1 +1 @@
-META-INF/
+META-INF/
\ No newline at end of file
diff --git a/example-projects/ruta-ep-example-extensions/pom.xml b/example-projects/ruta-ep-example-extensions/pom.xml
index 01f358d..34bf878 100644
--- a/example-projects/ruta-ep-example-extensions/pom.xml
+++ b/example-projects/ruta-ep-example-extensions/pom.xml
@@ -27,7 +27,7 @@
   <parent>

     <groupId>org.apache.uima</groupId>

     <artifactId>ruta-ep-parent</artifactId>

-    <version>2.8.2-SNAPSHOT</version>

+    <version>3.0.2-SNAPSHOT</version>

     <relativePath>../../ruta-ep-parent/pom.xml</relativePath>

   </parent>

   <properties>

diff --git a/example-projects/ruta-maven-example/pom.xml b/example-projects/ruta-maven-example/pom.xml
index 7df423a..6514e1c 100644
--- a/example-projects/ruta-maven-example/pom.xml
+++ b/example-projects/ruta-maven-example/pom.xml
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.apache.uima</groupId>
     <artifactId>ruta-parent</artifactId>
-    <version>2.8.2-SNAPSHOT</version>
+    <version>3.0.2-SNAPSHOT</version>
     <relativePath>../../ruta-parent/pom.xml</relativePath>
   </parent>
   <url>${uimaWebsiteUrl}</url>
diff --git a/pom.xml b/pom.xml
index a33cdaa..2e2e028 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
   <parent>

     <groupId>org.apache.uima</groupId>

     <artifactId>ruta-parent</artifactId>

-    <version>2.8.2-SNAPSHOT</version>

+    <version>3.0.2-SNAPSHOT</version>

     <relativePath>ruta-parent/pom.xml</relativePath>

   </parent>

 

@@ -35,10 +35,10 @@
   <description>The top project for Apache UIMA Ruta</description>

   <url>${uimaWebsiteUrl}</url>

   <properties>

-    <jiraVersion>12346562</jiraVersion>

-    <!--

-      <assembly.attach>false</assembly.attach>

-    -->

+    <jiraVersion>12346599</jiraVersion>

+    <!-- 

+     <assembly.attach>false</assembly.attach>

+     -->

   </properties>

 

   <!-- override pom setting in the build project. JIRA 5.1 needs different URL -->

diff --git a/ruta-basic-type/pom.xml b/ruta-basic-type/pom.xml
index 45ad6c6..ca57fe1 100644
--- a/ruta-basic-type/pom.xml
+++ b/ruta-basic-type/pom.xml
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.apache.uima</groupId>
     <artifactId>ruta-parent</artifactId>
-    <version>2.8.2-SNAPSHOT</version>
+    <version>3.0.2-SNAPSHOT</version>
     <relativePath>../ruta-parent/pom.xml</relativePath>
   </parent>
 
diff --git a/ruta-basic-type/src/main/java/org/apache/uima/ruta/type/RutaBasic.java b/ruta-basic-type/src/main/java/org/apache/uima/ruta/type/RutaBasic.java
index a2b80f6..dd204b5 100644
--- a/ruta-basic-type/src/main/java/org/apache/uima/ruta/type/RutaBasic.java
+++ b/ruta-basic-type/src/main/java/org/apache/uima/ruta/type/RutaBasic.java
@@ -18,6 +18,8 @@
  */
 package org.apache.uima.ruta.type;
 
+import java.lang.invoke.CallSite;
+import java.lang.invoke.MethodHandle;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -25,18 +27,17 @@
 
 import org.apache.uima.cas.Type;
 import org.apache.uima.cas.TypeSystem;
+import org.apache.uima.cas.impl.CASImpl;
 import org.apache.uima.cas.impl.TypeImpl;
 import org.apache.uima.cas.impl.TypeSystemImpl;
 import org.apache.uima.cas.text.AnnotationFS;
 import org.apache.uima.jcas.JCas;
 import org.apache.uima.jcas.JCasRegistry;
-import org.apache.uima.jcas.cas.TOP_Type;
 import org.apache.uima.jcas.tcas.Annotation;
 
 /**
- * Updated by JCasGen Thu Jul 12 10:42:33 CEST 2012 XML source:
- * D:/work/workspace-uima6/uimaj-ruta/src
- * /main/java/org/apache/uima/ruta/engine/InternalTypeSystem.xml
+ * Updated by JCasGen Fri Feb 16 11:29:59 CET 2018 XML source:
+ * C:/work/ws/ws-uima-ruta/ruta-v3/ruta-typesystem/target/jcasgen/typesystem.xml
  * 
  * @generated
  */
@@ -348,45 +349,85 @@
    * @generated
    * @ordered
    */
+  @SuppressWarnings("hiding")
+  public final static String _TypeName = "org.apache.uima.ruta.type.RutaBasic";
+
+  /**
+   * @generated
+   * @ordered
+   */
+  @SuppressWarnings("hiding")
   public final static int typeIndexID = JCasRegistry.register(RutaBasic.class);
 
   /**
    * @generated
    * @ordered
    */
+  @SuppressWarnings("hiding")
   public final static int type = typeIndexID;
 
-  /** @generated */
+  /**
+   * @generated
+   * @return index of the type
+   */
   @Override
   public int getTypeIndexID() {
     return typeIndexID;
   }
 
+  /*
+   * ******************* Feature Offsets *
+   *******************/
+
+  public final static String _FeatName_replacement = "replacement";
+
+  /* Feature Adjusted Offsets */
+  private final static CallSite _FC_replacement = TypeSystemImpl.createCallSite(RutaBasic.class,
+          "replacement");
+
+  private final static MethodHandle _FH_replacement = _FC_replacement.dynamicInvoker();
+
   /**
    * Never called. Disable default constructor
    * 
    * @generated
    */
-  protected RutaBasic() {/* intentionally empty block */
-  }
+  protected RutaBasic() {
+    /* intentionally empty block */}
 
   /**
    * Internal - constructor used by generator
    * 
    * @generated
+   * @param casImpl
+   *          the CAS this Feature Structure belongs to
+   * @param type
+   *          the type of this Feature Structure
    */
-  public RutaBasic(int addr, TOP_Type type) {
-    super(addr, type);
+  public RutaBasic(TypeImpl type, CASImpl casImpl) {
+    super(type, casImpl);
     readObject();
   }
 
-  /** @generated */
+  /**
+   * @generated
+   * @param jcas
+   *          JCas to which this Feature Structure belongs
+   */
   public RutaBasic(JCas jcas) {
     super(jcas);
     readObject();
   }
 
-  /** @generated */
+  /**
+   * @generated
+   * @param jcas
+   *          JCas to which this Feature Structure belongs
+   * @param begin
+   *          offset to the begin spot in the SofA
+   * @param end
+   *          offset to the end spot in the SofA
+   */
   public RutaBasic(JCas jcas, int begin, int end) {
     super(jcas);
     setBegin(begin);
@@ -396,36 +437,34 @@
 
   /**
    * <!-- begin-user-doc --> Write your own initialization here <!-- end-user-doc -->
-   * 
+   *
    * @generated modifiable
    */
   private void readObject() {
-  }
+    /* default - does nothing empty block */}
 
   // *--------------*
-  // * Feature: Replacement
+  // * Feature: replacement
 
   /**
-   * getter for Replacement - gets
+   * getter for replacement - gets
    * 
    * @generated
+   * @return value of the feature
    */
   public String getReplacement() {
-    if (RutaBasic_Type.featOkTst && ((RutaBasic_Type) jcasType).casFeat_replacement == null)
-      jcasType.jcas.throwFeatMissing("replacement", "org.apache.uima.ruta.type.RutaBasic");
-    return jcasType.ll_cas.ll_getStringValue(addr,
-            ((RutaBasic_Type) jcasType).casFeatCode_replacement);
+    return _getStringValueNc(wrapGetIntCatchException(_FH_replacement));
   }
 
   /**
-   * setter for Replacement - sets
+   * setter for replacement - sets
    * 
    * @generated
+   * @param v
+   *          value to set into the feature
    */
   public void setReplacement(String v) {
-    if (RutaBasic_Type.featOkTst && ((RutaBasic_Type) jcasType).casFeat_replacement == null)
-      jcasType.jcas.throwFeatMissing("replacement", "org.apache.uima.ruta.type.RutaBasic");
-    jcasType.ll_cas.ll_setStringValue(addr, ((RutaBasic_Type) jcasType).casFeatCode_replacement, v);
+    _setStringValueNfc(wrapGetIntCatchException(_FH_replacement), v);
   }
 
 }
diff --git a/ruta-basic-type/src/main/java/org/apache/uima/ruta/type/RutaBasic_Type.java b/ruta-basic-type/src/main/java/org/apache/uima/ruta/type/RutaBasic_Type.java
deleted file mode 100644
index 0b6f364..0000000
--- a/ruta-basic-type/src/main/java/org/apache/uima/ruta/type/RutaBasic_Type.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.uima.ruta.type;
-
-import org.apache.uima.cas.Feature;
-import org.apache.uima.cas.FeatureStructure;
-import org.apache.uima.cas.Type;
-import org.apache.uima.cas.impl.CASImpl;
-import org.apache.uima.cas.impl.FSGenerator;
-import org.apache.uima.cas.impl.FeatureImpl;
-import org.apache.uima.cas.impl.TypeImpl;
-import org.apache.uima.jcas.JCas;
-import org.apache.uima.jcas.JCasRegistry;
-import org.apache.uima.jcas.tcas.Annotation_Type;
-
-/**
- * Updated by JCasGen Thu Jul 12 10:42:33 CEST 2012
- * 
- * @generated
- */
-public class RutaBasic_Type extends Annotation_Type {
-  /** @generated */
-  @SuppressWarnings({ "unchecked", "rawtypes" })
-  protected FSGenerator getFSGenerator() {
-    return fsGenerator;
-  }
-
-  /** @generated */
-  @SuppressWarnings("rawtypes")
-  private final FSGenerator fsGenerator = new FSGenerator() {
-    public FeatureStructure createFS(int addr, CASImpl cas) {
-      if (RutaBasic_Type.this.useExistingInstance) {
-        // Return eq fs instance if already created
-        FeatureStructure fs = RutaBasic_Type.this.jcas.getJfsFromCaddr(addr);
-        if (null == fs) {
-          fs = new RutaBasic(addr, RutaBasic_Type.this);
-          RutaBasic_Type.this.jcas.putJfsFromCaddr(addr, fs);
-          return fs;
-        }
-        return fs;
-      } else
-        return new RutaBasic(addr, RutaBasic_Type.this);
-    }
-  };
-
-  /** @generated */
-  public final static int typeIndexID = RutaBasic.typeIndexID;
-
-  /**
-   * @generated
-   * @modifiable
-   */
-  public final static boolean featOkTst = JCasRegistry
-          .getFeatOkTst("org.apache.uima.ruta.type.RutaBasic");
-
-  /** @generated */
-  final Feature casFeat_replacement;
-
-  /** @generated */
-  final int casFeatCode_replacement;
-
-  /** @generated */
-  public String getReplacement(int addr) {
-    if (featOkTst && casFeat_replacement == null)
-      jcas.throwFeatMissing("replacement", "org.apache.uima.ruta.type.RutaBasic");
-    return ll_cas.ll_getStringValue(addr, casFeatCode_replacement);
-  }
-
-  /** @generated */
-  public void setReplacement(int addr, String v) {
-    if (featOkTst && casFeat_replacement == null)
-      jcas.throwFeatMissing("replacement", "org.apache.uima.ruta.type.RutaBasic");
-    ll_cas.ll_setStringValue(addr, casFeatCode_replacement, v);
-  }
-
-  /**
-   * initialize variables to correspond with Cas Type and Features
-   * 
-   * @generated
-   */
-  public RutaBasic_Type(JCas jcas, Type casType) {
-    super(jcas, casType);
-    casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl) this.casType, getFSGenerator());
-
-    casFeat_replacement = jcas.getRequiredFeatureDE(casType, "replacement", "uima.cas.String",
-            featOkTst);
-    casFeatCode_replacement = (null == casFeat_replacement) ? JCas.INVALID_FEATURE_CODE
-            : ((FeatureImpl) casFeat_replacement).getCode();
-
-  }
-}
diff --git a/ruta-core-ext/pom.xml b/ruta-core-ext/pom.xml
index b665411..200eabb 100644
--- a/ruta-core-ext/pom.xml
+++ b/ruta-core-ext/pom.xml
@@ -30,7 +30,7 @@
   <parent>
     <groupId>org.apache.uima</groupId>
     <artifactId>ruta-parent</artifactId>
-    <version>2.8.2-SNAPSHOT</version>
+    <version>3.0.2-SNAPSHOT</version>
     <relativePath>../ruta-parent/pom.xml</relativePath>
   </parent>
 
diff --git a/ruta-core/pom.xml b/ruta-core/pom.xml
index b6f263e..6204fd4 100644
--- a/ruta-core/pom.xml
+++ b/ruta-core/pom.xml
@@ -22,10 +22,11 @@
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

   <modelVersion>4.0.0</modelVersion>

   <artifactId>ruta-core</artifactId>

+

   <parent>

     <groupId>org.apache.uima</groupId>

     <artifactId>ruta-parent</artifactId>

-    <version>2.8.2-SNAPSHOT</version>

+    <version>3.0.2-SNAPSHOT</version>

     <relativePath>../ruta-parent/pom.xml</relativePath>

   </parent>

 

diff --git a/ruta-core/src/main/java/org/apache/uima/ruta/FilterManager.java b/ruta-core/src/main/java/org/apache/uima/ruta/FilterManager.java
index a6e630e..8dc7110 100644
--- a/ruta-core/src/main/java/org/apache/uima/ruta/FilterManager.java
+++ b/ruta-core/src/main/java/org/apache/uima/ruta/FilterManager.java
@@ -194,8 +194,11 @@
 

   public FSIterator<AnnotationFS> createFilteredIterator(CAS cas, Type basicType) {

     if (windowAnnotation != null) {

-      FSIterator<AnnotationFS> windowIt = cas.getAnnotationIndex(basicType)

-              .subiterator(windowAnnotation);

+      // TODO: UIMA-6281 replace select

+      FSIterator<AnnotationFS> windowIt = cas.getAnnotationIndex(basicType).select()

+              .coveredBy(windowAnnotation).fsIterator();

+//     was: FSIterator<AnnotationFS> windowIt = cas.getAnnotationIndex(basicType)

+//              .subiterator(windowAnnotation);

       FSIterator<AnnotationFS> iterator = cas.createFilteredIterator(windowIt,

               createCurrentConstraint(false));

       return iterator;

diff --git a/ruta-core/src/main/java/org/apache/uima/ruta/RutaEnvironment.java b/ruta-core/src/main/java/org/apache/uima/ruta/RutaEnvironment.java
index 0aab776..fa70516 100644
--- a/ruta-core/src/main/java/org/apache/uima/ruta/RutaEnvironment.java
+++ b/ruta-core/src/main/java/org/apache/uima/ruta/RutaEnvironment.java
@@ -634,7 +634,6 @@
    */

   public void importPackage(String packageName, String alias) {

     List<String> aliases = packageImports.get(packageName);

-

     if (aliases == null) {

       aliases = new ArrayList<>(1);

       packageImports.put(packageName, aliases);

diff --git a/ruta-core/src/main/java/org/apache/uima/ruta/RutaStream.java b/ruta-core/src/main/java/org/apache/uima/ruta/RutaStream.java
index a63c052..08a53d8 100644
--- a/ruta-core/src/main/java/org/apache/uima/ruta/RutaStream.java
+++ b/ruta-core/src/main/java/org/apache/uima/ruta/RutaStream.java
@@ -53,7 +53,6 @@
 import org.apache.uima.cas.StringArrayFS;

 import org.apache.uima.cas.Type;

 import org.apache.uima.cas.TypeSystem;

-import org.apache.uima.cas.impl.FSIteratorImplBase;

 import org.apache.uima.cas.impl.TypeImpl;

 import org.apache.uima.cas.text.AnnotationFS;

 import org.apache.uima.cas.text.AnnotationIndex;

@@ -62,7 +61,6 @@
 import org.apache.uima.jcas.JCas;

 import org.apache.uima.jcas.tcas.Annotation;

 import org.apache.uima.ruta.block.RutaBlock;

-import org.apache.uima.ruta.engine.RutaEngine;

 import org.apache.uima.ruta.expression.AnnotationTypeExpression;

 import org.apache.uima.ruta.expression.IRutaExpression;

 import org.apache.uima.ruta.expression.annotation.IAnnotationExpression;

@@ -92,7 +90,7 @@
 import org.apache.uima.ruta.utils.UIMAUtils;

 import org.apache.uima.ruta.visitor.InferenceCrowd;

 

-public class RutaStream extends FSIteratorImplBase<AnnotationFS> {

+public class RutaStream {

 

   private final CAS cas;

 

@@ -205,9 +203,12 @@
   private void updateIterators(CAS cas, Type basicType, FilterManager filter,

           AnnotationFS additionalWindow) {

     if (additionalWindow != null) {

-      basicIt = cas.getAnnotationIndex(basicType).subiterator(additionalWindow);

+      // TODO UIMA-6281 replace select

+      this.basicIt = cas.getAnnotationIndex(basicType).select().coveredBy(additionalWindow)

+              .fsIterator();

+      // was: this.basicIt = cas.getAnnotationIndex(basicType).subiterator(additionalWindow);

     } else {

-      basicIt = cas.getAnnotationIndex(basicType).iterator();

+      this.basicIt = cas.getAnnotationIndex(basicType).iterator();

     }

     currentIt = filter.createFilteredIterator(cas, basicType);

   }

@@ -669,8 +670,7 @@
     return stream;

   }

 

-  @Override

-  public FSIterator<AnnotationFS> copy() {

+  public RutaStream copy() {

     RutaStream stream = new RutaStream(cas, basicType, beginAnchors, endAnchors, filter,

             lowMemoryProfile, simpleGreedyForComposed, emptyIsInvisible, typeUsage, crowd);

     stream.setDynamicAnchoring(dynamicAnchoring);

@@ -681,17 +681,14 @@
     return stream;

   }

 

-  @Override

   public AnnotationFS get() throws NoSuchElementException {

     return currentIt.get();

   }

 

-  @Override

   public boolean isValid() {

     return currentIt.isValid();

   }

 

-  @Override

   public void moveTo(FeatureStructure fs) {

     try {

       currentIt.moveTo(fs);

@@ -700,22 +697,26 @@
     }

   }

 

-  @Override

+  public boolean hasNext() {

+    return currentIt.hasNext();

+  }

+

+  public AnnotationFS next() {

+    return currentIt.next();

+  }

+

   public void moveToFirst() {

     currentIt.moveToFirst();

   }

 

-  @Override

   public void moveToLast() {

     currentIt.moveToLast();

   }

 

-  @Override

   public void moveToNext() {

     currentIt.moveToNext();

   }

 

-  @Override

   public void moveToPrevious() {

     currentIt.moveToPrevious();

   }

@@ -783,16 +784,7 @@
 

   public List<AnnotationFS> getAnnotationsInWindow(AnnotationFS windowAnnotation, Type type) {

 

-    if (windowAnnotation == null || type == null) {

-      return Collections.emptyList();

-    }

-    TypeSystem typeSystem = getCas().getTypeSystem();

-    List<AnnotationFS> result = new ArrayList<>();

-    if (typeSystem.subsumes(type, windowAnnotation.getType())) {

-      result.add(windowAnnotation);

-    }

-    result.addAll(CasUtil.selectCovered(cas, type, windowAnnotation));

-    return result;

+    return getAnnotationsInWindow(type, windowAnnotation, false);

   }

 

   public Collection<RutaBasic> getAllBasicsInWindow(AnnotationFS windowAnnotation) {

@@ -864,8 +856,12 @@
       return result;

     }

     FSMatchConstraint defaultConstraint = filter.getDefaultConstraint();

+    // TODO UIMA-6281 replace select

     FSIterator<AnnotationFS> iterator = cas.createFilteredIterator(

-            cas.getAnnotationIndex(basicType).subiterator(windowAnnotation), defaultConstraint);

+            cas.getAnnotationIndex(basicType).select().coveredBy(windowAnnotation).fsIterator(),

+            defaultConstraint);

+//    FSIterator<AnnotationFS> iterator = cas.createFilteredIterator(

+//            cas.getAnnotationIndex(basicType).subiterator(windowAnnotation), defaultConstraint);

 

     while (iterator.isValid()) {

       result.add((RutaBasic) iterator.get());

@@ -902,6 +898,10 @@
     return basicIt;

   }

 

+  public FSIterator<AnnotationFS> getCurrentIterator() {

+    return currentIt;

+  }

+

   public AnnotationFS getDocumentAnnotation() {

     return documentAnnotation;

   }

@@ -1064,6 +1064,9 @@
     Set<Type> currentHiddenTypes = filter.getCurrentHiddenTypes();

     RutaBasic beginAnchor = getBeginAnchor(begin);

     if (beginAnchor != null) {

+      if (beginAnchor.isEmpty() && emptyIsInvisible) {

+        return false;

+      }

       for (Type type : currentHiddenTypes) {

         boolean partOf = beginAnchor.isPartOf(type);

         if (partOf) {

@@ -1073,6 +1076,9 @@
     }

     RutaBasic endAnchor = getEndAnchor(end);

     if (endAnchor != null) {

+      if (endAnchor.isEmpty() && emptyIsInvisible) {

+        return false;

+      }

       for (Type type : currentHiddenTypes) {

         boolean partOf = endAnchor.isPartOf(type);

         if (partOf) {

@@ -1092,7 +1098,6 @@
         }

       }

     }

-

     return true;

   }

 

@@ -1118,15 +1123,8 @@
     if (windowAnnotation != null

             && (windowAnnotation.getBegin() != cas.getDocumentAnnotation().getBegin()

                     || windowAnnotation.getEnd() != cas.getDocumentAnnotation().getEnd())) {

-      AnnotationFS frame = cas.createAnnotation(cas.getTypeSystem().getType(RutaEngine.FRAME_TYPE),

-              windowAnnotation.getBegin(), windowAnnotation.getEnd());

-      FSIterator<AnnotationFS> subiterator = cas.getAnnotationIndex(type).subiterator(frame);

-      while (subiterator.hasNext()) {

-        AnnotationFS each = subiterator.next();

-        if (isVisible(each)) {

-          result.add(each);

-        }

-      }

+

+      return getAnnotationsInWindow(type, windowAnnotation, true);

     } else {

       AnnotationIndex<AnnotationFS> annotationIndex = cas.getAnnotationIndex(type);

       for (AnnotationFS each : annotationIndex) {

@@ -1138,6 +1136,30 @@
     return result;

   }

 

+  public List<AnnotationFS> getAnnotationsInWindow(Type type, AnnotationFS windowAnnotation,

+          boolean sensitiveToVisibility) {

+

+    if (type == null || windowAnnotation == null) {

+      return Collections.emptyList();

+    }

+

+    List<AnnotationFS> result = new LinkedList<>();

+

+    if (cas.getTypeSystem().subsumes(type, windowAnnotation.getType())) {

+      if (!sensitiveToVisibility || isVisible(windowAnnotation)) {

+        result.add(windowAnnotation);

+      }

+    }

+

+    List<AnnotationFS> selectCovered = CasUtil.selectCovered(cas, type, windowAnnotation);

+    for (AnnotationFS each : selectCovered) {

+      if (!sensitiveToVisibility || isVisible(each)) {

+        result.add(each);

+      }

+    }

+    return result;

+  }

+

   public String getVisibleCoveredText(AnnotationFS annotationFS) {

     StringBuilder result = new StringBuilder();

     List<RutaBasic> basicsInWindow = getBasicsInWindow(annotationFS);

@@ -1195,12 +1217,12 @@
       if (value instanceof IStringListExpression) {

         IStringListExpression stringListExpr = (IStringListExpression) value;

         List<String> stringList = stringListExpr.getStringList(context, this);

-        StringArrayFS stringArray = FSCollectionFactory.createStringArray(cas, stringList);

+        StringArrayFS stringArray = FSCollectionFactory.createStringArrayFS(cas, stringList);

         annotation.setFeatureValue(feature, stringArray);

       } else if (value instanceof IStringExpression) {

         IStringExpression stringExpr = (IStringExpression) value;

         String string = stringExpr.getStringValue(context, this);

-        StringArrayFS array = FSCollectionFactory.createStringArray(cas, new String[] { string });

+        StringArrayFS array = FSCollectionFactory.createStringArrayFS(cas, new String[] { string });

         annotation.setFeatureValue(feature, array);

       }

     } else if (rangeName.equals(CAS.TYPE_NAME_INTEGER) || rangeName.equals(CAS.TYPE_NAME_LONG)

@@ -1222,12 +1244,13 @@
       if (value instanceof INumberExpression) {

         INumberExpression numberExpr = (INumberExpression) value;

         int v = numberExpr.getIntegerValue(context, this);

-        IntArrayFS array = FSCollectionFactory.createIntArray(cas, new int[] { v });

+        IntArrayFS array = FSCollectionFactory.createIntArrayFS(cas, new int[] { v });

         annotation.setFeatureValue(feature, array);

       } else if (value instanceof INumberListExpression) {

         INumberListExpression expr = (INumberListExpression) value;

         List<Number> list = expr.getNumberList(context, this);

-        IntArrayFS array = FSCollectionFactory.createIntArray(cas, RutaListUtils.toIntArray(list));

+        IntArrayFS array = FSCollectionFactory.createIntArrayFS(cas,

+                RutaListUtils.toIntArray(list));

         annotation.setFeatureValue(feature, array);

       }

     } else if (rangeName.equals(CAS.TYPE_NAME_DOUBLE)) {

@@ -1240,12 +1263,12 @@
       if (value instanceof INumberExpression) {

         INumberExpression numberExpr = (INumberExpression) value;

         double v = numberExpr.getDoubleValue(context, this);

-        DoubleArrayFS array = FSCollectionFactory.createDoubleArray(cas, new double[] { v });

+        DoubleArrayFS array = FSCollectionFactory.createDoubleArrayFS(cas, new double[] { v });

         annotation.setFeatureValue(feature, array);

       } else if (value instanceof INumberListExpression) {

         INumberListExpression expr = (INumberListExpression) value;

         List<Number> list = expr.getNumberList(context, this);

-        DoubleArrayFS array = FSCollectionFactory.createDoubleArray(cas,

+        DoubleArrayFS array = FSCollectionFactory.createDoubleArrayFS(cas,

                 RutaListUtils.toDoubleArray(list));

         annotation.setFeatureValue(feature, array);

       }

@@ -1259,12 +1282,12 @@
       if (value instanceof INumberExpression) {

         INumberExpression numberExpr = (INumberExpression) value;

         float v = numberExpr.getFloatValue(context, this);

-        FloatArrayFS array = FSCollectionFactory.createFloatArray(cas, new float[] { v });

+        FloatArrayFS array = FSCollectionFactory.createFloatArrayFS(cas, new float[] { v });

         annotation.setFeatureValue(feature, array);

       } else if (value instanceof INumberListExpression) {

         INumberListExpression expr = (INumberListExpression) value;

         List<Number> list = expr.getNumberList(context, this);

-        FloatArrayFS array = FSCollectionFactory.createFloatArray(cas,

+        FloatArrayFS array = FSCollectionFactory.createFloatArrayFS(cas,

                 RutaListUtils.toFloatArray(list));

         annotation.setFeatureValue(feature, array);

       }

@@ -1278,12 +1301,12 @@
       if (value instanceof IBooleanListExpression) {

         IBooleanListExpression expr = (IBooleanListExpression) value;

         List<Boolean> list = expr.getBooleanList(context, this);

-        BooleanArrayFS array = FSCollectionFactory.createBooleanArray(cas, list);

+        BooleanArrayFS array = FSCollectionFactory.createBooleanArrayFS(cas, list);

         annotation.setFeatureValue(feature, array);

       } else if (value instanceof IBooleanExpression) {

         IBooleanExpression expr = (IBooleanExpression) value;

         Boolean v = expr.getBooleanValue(context, this);

-        BooleanArrayFS array = FSCollectionFactory.createBooleanArray(cas, new boolean[] { v });

+        BooleanArrayFS array = FSCollectionFactory.createBooleanArrayFS(cas, new boolean[] { v });

         annotation.setFeatureValue(feature, array);

       }

     } else if (value instanceof AnnotationTypeExpression && !range.isPrimitive()) {

diff --git a/ruta-core/src/main/java/org/apache/uima/ruta/condition/NearCondition.java b/ruta-core/src/main/java/org/apache/uima/ruta/condition/NearCondition.java
index 4330eed..e788e7a 100644
--- a/ruta-core/src/main/java/org/apache/uima/ruta/condition/NearCondition.java
+++ b/ruta-core/src/main/java/org/apache/uima/ruta/condition/NearCondition.java
@@ -67,7 +67,7 @@
     int minValue = min.getIntegerValue(context, stream);

     boolean forwardValue = forward.getBooleanValue(context, stream);

 

-    FSIterator<AnnotationFS> it = filtered.getBooleanValue(context, stream) ? stream

+    FSIterator<AnnotationFS> it = filtered.getBooleanValue(context, stream) ? stream.getCurrentIterator()

             : stream.getUnfilteredBasicIterator();

     AnnotationFS pointer = null;

     if (forwardValue) {

diff --git a/ruta-core/src/main/java/org/apache/uima/ruta/resource/MultiTreeWordList.java b/ruta-core/src/main/java/org/apache/uima/ruta/resource/MultiTreeWordList.java
index 74047d7..c382c38 100644
--- a/ruta-core/src/main/java/org/apache/uima/ruta/resource/MultiTreeWordList.java
+++ b/ruta-core/src/main/java/org/apache/uima/ruta/resource/MultiTreeWordList.java
@@ -823,7 +823,7 @@
 

     Collection<AnnotationFS> results = new HashSet<AnnotationFS>();

     stream.moveToFirst();

-    FSIterator<AnnotationFS> streamPointer = stream.copy();

+    RutaStream streamPointer = stream.copy();

 

     while (stream.isValid()) {

       RutaBasic anchorBasic = (RutaBasic) stream.get();

diff --git a/ruta-core/src/main/java/org/apache/uima/ruta/resource/TreeWordList.java b/ruta-core/src/main/java/org/apache/uima/ruta/resource/TreeWordList.java
index 7c9d6e7..4c1ca1e 100644
--- a/ruta-core/src/main/java/org/apache/uima/ruta/resource/TreeWordList.java
+++ b/ruta-core/src/main/java/org/apache/uima/ruta/resource/TreeWordList.java
@@ -329,7 +329,7 @@
           char[] ignoreChars, int maxIgnoredChars, boolean ignoreWS) {

     ArrayList<AnnotationFS> results = new ArrayList<AnnotationFS>();

     stream.moveToFirst();

-    FSIterator<AnnotationFS> streamPointer = stream.copy();

+    RutaStream streamPointer = stream.copy();

     while (stream.isValid()) {

       RutaBasic anchorBasic = (RutaBasic) stream.get();

       streamPointer.moveTo(anchorBasic);

diff --git a/ruta-core/src/main/java/org/apache/uima/ruta/rule/AnnotationListFSIterator.java b/ruta-core/src/main/java/org/apache/uima/ruta/rule/AnnotationListFSIterator.java
index 8c3ab92..c053d20 100644
--- a/ruta-core/src/main/java/org/apache/uima/ruta/rule/AnnotationListFSIterator.java
+++ b/ruta-core/src/main/java/org/apache/uima/ruta/rule/AnnotationListFSIterator.java
@@ -18,13 +18,17 @@
  */
 package org.apache.uima.ruta.rule;
 
+import java.util.Comparator;
 import java.util.List;
 import java.util.NoSuchElementException;
 
+import org.apache.commons.lang3.NotImplementedException;
 import org.apache.uima.cas.FSIterator;
 import org.apache.uima.cas.FeatureStructure;
 import org.apache.uima.cas.impl.FSIteratorImplBase;
+import org.apache.uima.cas.impl.LowLevelIndex;
 import org.apache.uima.cas.text.AnnotationFS;
+import org.apache.uima.jcas.cas.TOP;
 
 public class AnnotationListFSIterator extends FSIteratorImplBase<AnnotationFS> {
 
@@ -89,4 +93,94 @@
     return new AnnotationListFSIterator(list);
   }
 
+  @Override
+  public int ll_indexSizeMaybeNotCurrent() {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public LowLevelIndex<AnnotationFS> ll_getIndex() {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public int ll_maxAnnotSpan() {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public boolean isIndexesHaveBeenUpdated() {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public boolean maybeReinitIterator() {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public void moveToFirstNoReinit() {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public void moveToLastNoReinit() {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public void moveToNoReinit(FeatureStructure fs) {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public Comparator<TOP> getComparator() {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public AnnotationFS getNvc() {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public void moveToNextNvc() {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public void moveToPreviousNvc() {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public boolean hasPrevious() {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public AnnotationFS previous() {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public int nextIndex() {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public int previousIndex() {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public void set(AnnotationFS e) {
+    throw new NotImplementedException("Not supported.");
+  }
+
+  @Override
+  public void add(AnnotationFS e) {
+    throw new NotImplementedException("Not supported.");
+  }
+
 }
diff --git a/ruta-core/src/main/java/org/apache/uima/ruta/rule/RutaAnnotationTypeMatcher.java b/ruta-core/src/main/java/org/apache/uima/ruta/rule/RutaAnnotationTypeMatcher.java
index 0fa25e1..98780c7 100644
--- a/ruta-core/src/main/java/org/apache/uima/ruta/rule/RutaAnnotationTypeMatcher.java
+++ b/ruta-core/src/main/java/org/apache/uima/ruta/rule/RutaAnnotationTypeMatcher.java
@@ -107,99 +107,70 @@
   public Collection<? extends AnnotationFS> getAnnotationsAfter(RutaRuleElement ruleElement,
           AnnotationFS annotation, RutaBlock parent, RutaStream stream) {
     if (annotation.getEnd() == stream.getDocumentAnnotation().getEnd()) {
-      return emptyList();
+      return Collections.emptyList();
     }
-    
-    RutaBasic lastBasic = stream.getEndAnchor(annotation.getEnd());
-    int end = 0;
-    if (lastBasic == null) {
-      if (annotation.getEnd() != 0) {
-        return emptyList();
-      }
-    } else {
-      end = lastBasic.getEnd();
-    }
-    
-    if (end == stream.getDocumentAnnotation().getBegin()) {
-      // non existing wildcard match
-      stream.moveToFirst();
-    } else if (annotation.getEnd() > 0) {
-      stream.moveTo(lastBasic);
-      if (stream.isVisible(lastBasic) && stream.isValid()
-              && stream.get().getEnd() == lastBasic.getEnd()) {
-        stream.moveToNext();
-      }
-    } else {
-      stream.moveToFirst();
-    }
-
-    if (!stream.isValid()) {
-      return emptyList();
-    }
-    
-    RutaBasic nextBasic = (RutaBasic) stream.get();
-    // TODO HOTFIX for annotation of length 0
-    while (stream.isValid() && nextBasic.getBegin() < end) {
-      stream.moveToNext();
-      if (stream.isValid()) {
-        nextBasic = (RutaBasic) stream.get();
-      }
+    RutaBasic nextBasic = stream.getBasicNextTo(false, annotation);
+    if (nextBasic == null) {
+      return Collections.emptyList();
     }
 
     MatchContext context = new MatchContext(parent);
     // just for forcing expression top initialize
     expression.getType(context, stream);
     if (expression.getAnnotationExpression() != null) {
-      AnnotationFS ref = expression.getAnnotation(context, stream);
-      
-      if (ref == null) {
-        return emptyList();
-      }
 
-      if (nextBasic.getBegin() == ref.getBegin()) {
-        return asList(ref);
-      }
-      
-      return emptyList();
-    }
-    
-    if (expression.getAnnotationListExpression() != null) {
-      RutaBasic referenceElement = nextBasic;
-      return expression.getAnnotationList(context, stream).stream()
-          .filter(each -> referenceElement.getBegin() == each.getBegin())
-          .collect(Collectors.toList());
-    } 
-    
-    List<Type> types;
-    if (expression.getTypeListExpression() != null) {
-      types = expression.getTypeListExpression().getTypeList(context, stream);
-    } else {
-      types = asList(getType(context.getParent(), stream));
-    }
-    
-    List<AnnotationFS> annotations = new ArrayList<>();
-    for (Type type : types) {
-      Collection<AnnotationFS> beginAnchors = nextBasic.getBeginAnchors(type);
-      Collection<AnnotationFS> anchors = new ArrayList<>(beginAnchors.size());
-      
-      if (beginAnchors != null) {
-        for (AnnotationFS afs : beginAnchors) {
-          if (afs.getBegin() >= stream.getDocumentAnnotation().getBegin()
-                  && afs.getEnd() <= stream.getDocumentAnnotation().getEnd()) {
-            anchors.add(afs);
-          }
+      AnnotationFS ref = expression.getAnnotation(context, stream);
+      if (ref != null) {
+        boolean beginsWith = nextBasic.getBegin() == ref.getBegin();
+        if (beginsWith) {
+          Collection<AnnotationFS> result = new ArrayList<>(1);
+          result.add(ref);
+          return result;
         }
       }
-      
-      if (expression.getFeatureExpression() != null) {
-        annotations.addAll(expression.getFeatureExpression().getAnnotations(anchors,
-                CHECK_ON_FEATURE, context, stream));
-      } else {
-        annotations.addAll(anchors);
+    } else if (expression.getAnnotationListExpression() != null) {
+      List<AnnotationFS> annotations = expression.getAnnotationList(context, stream);
+      Collection<AnnotationFS> result = new ArrayList<>();
+      for (AnnotationFS each : annotations) {
+        boolean beginsWith = nextBasic.getBegin() == each.getBegin();
+        if (beginsWith) {
+          result.add(each);
+        }
       }
+      return result;
+    } else {
+      List<Type> types = null;
+      if (expression.getTypeListExpression() != null) {
+        types = expression.getTypeListExpression().getTypeList(context, stream);
+      } else {
+        Type type = getType(context.getParent(), stream);
+        types = new ArrayList<>(1);
+        types.add(type);
+      }
+      List<AnnotationFS> annotations = new ArrayList<>();
+      for (Type type : types) {
+        Collection<AnnotationFS> anchors = new ArrayList<>();
+        Collection<AnnotationFS> beginAnchors = nextBasic.getBeginAnchors(type);
+        if (beginAnchors != null) {
+          for (AnnotationFS afs : beginAnchors) {
+            if (afs.getBegin() >= stream.getDocumentAnnotation().getBegin()
+                    && afs.getEnd() <= stream.getDocumentAnnotation().getEnd()) {
+              anchors.add(afs);
+            }
+          }
+        }
+        if (expression.getFeatureExpression() != null) {
+          annotations.addAll(expression.getFeatureExpression().getAnnotations(anchors,
+                  CHECK_ON_FEATURE, context, stream));
+        } else {
+          annotations.addAll(anchors);
+        }
+
+      }
+      return annotations;
     }
-    
-    return annotations;
+
+    return Collections.emptyList();
   }
 
   @Override
@@ -208,82 +179,63 @@
     if (annotation.getBegin() == stream.getDocumentAnnotation().getBegin()) {
       return Collections.emptyList();
     }
-    
-    RutaBasic firstBasic = stream.getBeginAnchor(annotation.getBegin());
-    if (firstBasic == null) {
+    RutaBasic nextBasic = stream.getBasicNextTo(true, annotation);
+    if (nextBasic == null) {
       return Collections.emptyList();
     }
-    
-    stream.moveTo(firstBasic);
-    if (stream.isVisible(firstBasic)) {
-      stream.moveToPrevious();
-    }
-    if (firstBasic.getBegin() == stream.getDocumentAnnotation().getEnd()) {
-      // non existing wildcard match
-      stream.moveToLast();
-    }
-
-    if (!stream.isValid()) {
-      return emptyList();
-    }
-
-    RutaBasic nextBasic = (RutaBasic) stream.get();
-    // TODO HOTFIX for annotation of length 0
-    while (stream.isValid() && nextBasic.getEnd() > firstBasic.getBegin()) {
-      stream.moveToPrevious();
-      if (stream.isValid()) {
-        nextBasic = (RutaBasic) stream.get();
-      }
-    }
 
     MatchContext context = new MatchContext(parent);
     // just for forcing expression top initialize
     expression.getType(context, stream);
     if (expression.getAnnotationExpression() != null) {
       AnnotationFS ref = expression.getAnnotationExpression().getAnnotation(context, stream);
-      
-      if (nextBasic.getEnd() == ref.getEnd()) {
-        return asList(ref);
+      boolean endsWith = nextBasic.getEnd() == ref.getEnd();
+      if (endsWith) {
+        Collection<AnnotationFS> result = new ArrayList<>(1);
+        result.add(ref);
+        return result;
       }
-      
-      return emptyList();
-    } 
-    
-    if (expression.getAnnotationListExpression() != null) {
-      RutaBasic referenceElement = nextBasic;
-      return expression.getAnnotationListExpression().getAnnotationList(context, stream).stream()
-          .filter(each -> referenceElement.getEnd() == each.getEnd())
-          .collect(Collectors.toList());
-    }
-    
-    List<Type> types;
-    if (expression.getTypeListExpression() != null) {
-      types = expression.getTypeListExpression().getTypeList(context, stream);
-    } else {
-      types = asList(getType(context.getParent(), stream));
-    }
-    
-    List<AnnotationFS> annotations = new ArrayList<>();
-    for (Type type : types) {
-      Collection<AnnotationFS> endAnchors = nextBasic.getEndAnchors(type);
-      Collection<AnnotationFS> anchors = new ArrayList<>(endAnchors.size());
-      if (endAnchors != null) {
-        for (AnnotationFS afs : endAnchors) {
-          if (afs.getBegin() >= stream.getDocumentAnnotation().getBegin()) {
-            anchors.add(afs);
-          }
+    } else if (expression.getAnnotationListExpression() != null) {
+      List<AnnotationFS> annotations = expression.getAnnotationListExpression()
+              .getAnnotationList(context, stream);
+      for (AnnotationFS each : annotations) {
+        boolean endsWith = nextBasic.getEnd() == each.getEnd();
+        if (endsWith) {
+          Collection<AnnotationFS> result = new ArrayList<>();
+          result.add(each);
+          return result;
         }
       }
-      
-      if (expression.getFeatureExpression() != null) {
-        annotations.addAll(expression.getFeatureExpression().getAnnotations(anchors,
-                CHECK_ON_FEATURE, context, stream));
+    } else {
+      List<Type> types = null;
+      if (expression.getTypeListExpression() != null) {
+        types = expression.getTypeListExpression().getTypeList(context, stream);
       } else {
-        annotations.addAll(anchors);
+        Type type = getType(context.getParent(), stream);
+        types = new ArrayList<>(1);
+        types.add(type);
       }
+      List<AnnotationFS> annotations = new ArrayList<>();
+      for (Type type : types) {
+        Collection<AnnotationFS> anchors = new ArrayList<>();
+        Collection<AnnotationFS> endAnchors = nextBasic.getEndAnchors(type);
+        if (endAnchors != null) {
+          for (AnnotationFS afs : endAnchors) {
+            if (afs.getBegin() >= stream.getDocumentAnnotation().getBegin()) {
+              anchors.add(afs);
+            }
+          }
+        }
+        if (expression.getFeatureExpression() != null) {
+          annotations.addAll(expression.getFeatureExpression().getAnnotations(anchors,
+                  CHECK_ON_FEATURE, context, stream));
+        } else {
+          annotations.addAll(anchors);
+        }
+      }
+      return annotations;
     }
-    
-    return annotations;
+    return Collections.emptyList();
   }
 
   @Override
diff --git a/ruta-core/src/main/java/org/apache/uima/ruta/rule/WildCardRuleElement.java b/ruta-core/src/main/java/org/apache/uima/ruta/rule/WildCardRuleElement.java
index c2aa66d..347b400 100644
--- a/ruta-core/src/main/java/org/apache/uima/ruta/rule/WildCardRuleElement.java
+++ b/ruta-core/src/main/java/org/apache/uima/ruta/rule/WildCardRuleElement.java
@@ -30,11 +30,9 @@
 import org.apache.commons.lang3.tuple.ImmutablePair;

 import org.apache.commons.lang3.tuple.Pair;

 import org.apache.uima.cas.CAS;

-import org.apache.uima.cas.CASException;

 import org.apache.uima.cas.FSIterator;

 import org.apache.uima.cas.Type;

 import org.apache.uima.cas.text.AnnotationFS;

-import org.apache.uima.jcas.JCas;

 import org.apache.uima.ruta.RutaEnvironment;

 import org.apache.uima.ruta.RutaStream;

 import org.apache.uima.ruta.action.AbstractRutaAction;

@@ -44,7 +42,6 @@
 import org.apache.uima.ruta.expression.AnnotationTypeExpression;

 import org.apache.uima.ruta.expression.string.IStringExpression;

 import org.apache.uima.ruta.type.RutaBasic;

-import org.apache.uima.ruta.type.RutaFrame;

 import org.apache.uima.ruta.visitor.InferenceCrowd;

 

 public class WildCardRuleElement extends AbstractRuleElement {

@@ -508,14 +505,20 @@
     } else {

       iterator = getIteratorOfType(after, defaultType, annotation, stream);

     }

-    if (iterator != null && iterator.isValid() && iterator.get().equals(annotation)) {

-      moveOn(after, iterator, stream);

+    if (annotation != null && iterator != null && iterator.isValid()) {

+      AnnotationFS pointer = iterator.get();

+      if ((after && pointer.getEnd() == annotation.getEnd())

+              || (!after && pointer.getBegin() == annotation.getBegin())) {

+        moveOn(after, iterator, stream);

+      }

     }

     return iterator;

   }

 

   private FSIterator<AnnotationFS> getIteratorOfType(boolean after, Type type,

           AnnotationFS annotation, RutaStream stream) {

+    // TODO reimplement with cas select logic

+

     CAS cas = stream.getCas();

     // TODO adapt logic to changes in UIMA iterator behavior!

     FSIterator<AnnotationFS> result = null;

@@ -562,23 +565,17 @@
         }

       }

     } else {

-      JCas jcas = null;

-      try {

-        jcas = cas.getJCas();

-      } catch (CASException e) {

-        e.printStackTrace();

-      }

-      RutaFrame window = new RutaFrame(jcas, stream.getDocumentAnnotation().getBegin(),

-              stream.getDocumentAnnotation().getEnd());

+      // TODO UIMA-6281 replace select and rewrite complete block

+      result = cas.getAnnotationIndex(type).select().coveredBy(stream.getDocumentAnnotation())

+              .fsIterator();

       if (annotation == null) {

-        result = cas.getAnnotationIndex(type).subiterator(window);

       } else {

-        result = cas.getAnnotationIndex(type).subiterator(window);

         AnnotationFS pointer = stream.getAnchor(after, annotation);

         result.moveTo(pointer);

+

         if (!result.isValid()) {

           if (after) {

-            // result.moveToFirst();

+//            result.moveToFirst();

           } else {

             // TODO due to type priorities: RutaBasic is last -> moveTo will not work

             result.moveToLast();

@@ -748,8 +745,7 @@
 

     RuleElementMatch result = new RuleElementMatch(this, containerMatch);

     result.setRuleAnchor(ruleAnchor);

-    List<EvaluatedCondition> evaluatedConditions = new ArrayList<>(

-            conditions.size());

+    List<EvaluatedCondition> evaluatedConditions = new ArrayList<>(conditions.size());

     boolean base = true;

 

     MatchContext context = new MatchContext(annotation, this, ruleMatch, true);

diff --git a/ruta-core/src/test/java/org/apache/uima/ruta/ReindexUpdateModeTest.java b/ruta-core/src/test/java/org/apache/uima/ruta/ReindexUpdateModeTest.java
index 86e24e9..dd054d3 100644
--- a/ruta-core/src/test/java/org/apache/uima/ruta/ReindexUpdateModeTest.java
+++ b/ruta-core/src/test/java/org/apache/uima/ruta/ReindexUpdateModeTest.java
@@ -27,6 +27,7 @@
 import org.apache.uima.ruta.engine.Ruta;
 import org.apache.uima.ruta.engine.RutaEngine;
 import org.apache.uima.ruta.engine.RutaTestUtils;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class ReindexUpdateModeTest {
@@ -230,6 +231,7 @@
   }
 
   @Test
+  @Ignore
   public void testSafeAdditive() throws Exception {
 
     Map<String, Object> params = new LinkedHashMap<>();
diff --git a/ruta-core/src/test/java/org/apache/uima/ruta/engine/DummySeeder.java b/ruta-core/src/test/java/org/apache/uima/ruta/engine/DummySeeder.java
index 840f8dc..b403f03 100644
--- a/ruta-core/src/test/java/org/apache/uima/ruta/engine/DummySeeder.java
+++ b/ruta-core/src/test/java/org/apache/uima/ruta/engine/DummySeeder.java
@@ -1,37 +1,37 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.uima.ruta.engine;
-
-import org.apache.uima.cas.CAS;
-import org.apache.uima.cas.Type;
-import org.apache.uima.cas.text.AnnotationFS;
-import org.apache.uima.ruta.seed.RutaAnnotationSeeder;
-import org.apache.uima.ruta.seed.TextSeeder;
-
-public class DummySeeder implements RutaAnnotationSeeder{
-
-  @Override
-  public Type seed(String text, CAS cas) {
-    Type type = cas.getTypeSystem().getType(TextSeeder.seedType);
-    AnnotationFS annotation = cas.createAnnotation(type, 0, text.length());
-    cas.addFsToIndexes(annotation);
-    return type;
-  }
-
-}
+/*

+ * Licensed to the Apache Software Foundation (ASF) under one

+ * or more contributor license agreements.  See the NOTICE file

+ * distributed with this work for additional information

+ * regarding copyright ownership.  The ASF licenses this file

+ * to you under the Apache License, Version 2.0 (the

+ * "License"); you may not use this file except in compliance

+ * with the License.  You may obtain a copy of the License at

+ * 

+ * http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing,

+ * software distributed under the License is distributed on an

+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

+ * KIND, either express or implied.  See the License for the

+ * specific language governing permissions and limitations

+ * under the License.

+ */

+package org.apache.uima.ruta.engine;

+

+import org.apache.uima.cas.CAS;

+import org.apache.uima.cas.Type;

+import org.apache.uima.cas.text.AnnotationFS;

+import org.apache.uima.ruta.seed.RutaAnnotationSeeder;

+import org.apache.uima.ruta.seed.TextSeeder;

+

+public class DummySeeder implements RutaAnnotationSeeder{

+

+  @Override

+  public Type seed(String text, CAS cas) {

+    Type type = cas.getTypeSystem().getType(TextSeeder.seedType);

+    AnnotationFS annotation = cas.createAnnotation(type, 0, text.length());

+    cas.addFsToIndexes(annotation);

+    return type;

+  }

+

+}

diff --git a/ruta-core/src/test/java/org/apache/uima/ruta/engine/MultipleSeedersTest.java b/ruta-core/src/test/java/org/apache/uima/ruta/engine/MultipleSeedersTest.java
index 4dc4595..2cb8fc9 100644
--- a/ruta-core/src/test/java/org/apache/uima/ruta/engine/MultipleSeedersTest.java
+++ b/ruta-core/src/test/java/org/apache/uima/ruta/engine/MultipleSeedersTest.java
@@ -1,50 +1,50 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.uima.ruta.engine;
-
-import org.apache.uima.analysis_engine.AnalysisEngine;
-import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
-import org.apache.uima.fit.factory.AnalysisEngineFactory;
-import org.apache.uima.fit.util.JCasUtil;
-import org.apache.uima.jcas.JCas;
-import org.apache.uima.resource.ResourceInitializationException;
-import org.apache.uima.ruta.type.ALL;
-import org.apache.uima.ruta.type.TruePositive;
-import org.junit.Assert;
-import org.junit.Test;
-
-public class MultipleSeedersTest {
-
-  @Test
-  public void test() throws ResourceInitializationException, AnalysisEngineProcessException {
-    
-    AnalysisEngine ae = AnalysisEngineFactory.createEngine(RutaEngine.class, 
-            RutaEngine.PARAM_RULES, "TokenSeed{-> TruePositive};",
-            RutaEngine.PARAM_SEEDERS, new String[] {DummySeeder.class.getName(),DummySeeder.class.getName()});
-    
-    JCas jcas = ae.newJCas();
-    jcas.setDocumentText("Dummy text.");
-    ae.process(jcas);
-    
-    Assert.assertEquals(2, JCasUtil.select(jcas, TruePositive.class).size());
-    Assert.assertEquals(0, JCasUtil.select(jcas, ALL.class).size());
-    
-  }
-  
-}
+/*

+ * Licensed to the Apache Software Foundation (ASF) under one

+ * or more contributor license agreements.  See the NOTICE file

+ * distributed with this work for additional information

+ * regarding copyright ownership.  The ASF licenses this file

+ * to you under the Apache License, Version 2.0 (the

+ * "License"); you may not use this file except in compliance

+ * with the License.  You may obtain a copy of the License at

+ * 

+ * http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing,

+ * software distributed under the License is distributed on an

+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

+ * KIND, either express or implied.  See the License for the

+ * specific language governing permissions and limitations

+ * under the License.

+ */

+package org.apache.uima.ruta.engine;

+

+import org.apache.uima.analysis_engine.AnalysisEngine;

+import org.apache.uima.analysis_engine.AnalysisEngineProcessException;

+import org.apache.uima.fit.factory.AnalysisEngineFactory;

+import org.apache.uima.fit.util.JCasUtil;

+import org.apache.uima.jcas.JCas;

+import org.apache.uima.resource.ResourceInitializationException;

+import org.apache.uima.ruta.type.ALL;

+import org.apache.uima.ruta.type.TruePositive;

+import org.junit.Assert;

+import org.junit.Test;

+

+public class MultipleSeedersTest {

+

+  @Test

+  public void test() throws ResourceInitializationException, AnalysisEngineProcessException {

+    

+    AnalysisEngine ae = AnalysisEngineFactory.createEngine(RutaEngine.class, 

+            RutaEngine.PARAM_RULES, "TokenSeed{-> TruePositive};",

+            RutaEngine.PARAM_SEEDERS, new String[] {DummySeeder.class.getName(),DummySeeder.class.getName()});

+    

+    JCas jcas = ae.newJCas();

+    jcas.setDocumentText("Dummy text.");

+    ae.process(jcas);

+    

+    Assert.assertEquals(2, JCasUtil.select(jcas, TruePositive.class).size());

+    Assert.assertEquals(0, JCasUtil.select(jcas, ALL.class).size());

+    

+  }

+  

+}

diff --git a/ruta-core/src/test/java/org/apache/uima/ruta/expression/annotation/AnnotationLabelExpressionTest.java b/ruta-core/src/test/java/org/apache/uima/ruta/expression/annotation/AnnotationLabelExpressionTest.java
index 1e5984e..27f8dde 100644
--- a/ruta-core/src/test/java/org/apache/uima/ruta/expression/annotation/AnnotationLabelExpressionTest.java
+++ b/ruta-core/src/test/java/org/apache/uima/ruta/expression/annotation/AnnotationLabelExpressionTest.java
@@ -795,38 +795,4 @@
 

   }

 

-  @Test

-  public void testComplexLabelReset() throws Exception {

-    // UIMA-6262

-    // Enumeration

-    // <-{dc1:DiagnosisConcept{dc1.negatedBy!=null}; cue:dc1.negatedBy;}

-    // ->{dc2:DiagnosisConcept{dc2.negatedBy==null -> dc2.negatedBy=cue};

-    // };

-    // solved by rewriting

-

-    String document = "Test 1. Test 2. Test 3. Test 4.";

-

-    String script = "";

-    script += "ANY+{-PARTOF(T1),-PARTOF(PERIOD)-> T1};\n";

-    script += "T1<-{n1:NUM{REGEXP(\"1|3\")};}<-{n2:n1;}\n"; // one applies always

-    script += "->{n2{->T2};};"; //

-

-    CAS cas = RutaTestUtils.getCAS(document);

-    Ruta.apply(cas, script);

-    RutaTestUtils.assertAnnotationsEquals(cas, 2, 2, "1", "3");

-  }

-

-  @Test

-  @Ignore

-  public void testInlineWithQuantifier() throws Exception {

-

-    String script = "";

-    script += "CW{-> Struct1, Struct1.a=sw} sw:SW;\n";

-    script += "sw:SW{-> Struct1, Struct1.a=sw};\n";

-    script += "p:PERIOD{-> Struct1, Struct1.a=p};\n";

-    script += "(s1:Struct1<-{u1:s1.a;} (s2:Struct1<-{u2:s2.a{u2.ct==u1.ct};})+){-> T1};\n";

-    CAS cas = this.applyOnStruct4Cas(script);

-    RutaTestUtils.assertAnnotationsEquals(cas, 1, 1, "Some text");

-  }

-

 }

diff --git a/ruta-core/src/test/java/org/apache/uima/ruta/resource/CSVTableTest.java b/ruta-core/src/test/java/org/apache/uima/ruta/resource/CSVTableTest.java
index 927226c..6588a91 100644
--- a/ruta-core/src/test/java/org/apache/uima/ruta/resource/CSVTableTest.java
+++ b/ruta-core/src/test/java/org/apache/uima/ruta/resource/CSVTableTest.java
@@ -1,76 +1,76 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.uima.ruta.resource;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.io.IOException;
-
-import org.junit.Test;
-
-public class CSVTableTest {
-  private static final String CUSTOM_SEPARATOR = "#|#";
-
-  @Test
-  public void testDefaultLookup() throws IOException {
-    CSVTable csvTable = new CSVTable(CSVTable.class.getResourceAsStream("test_csvfile.csv"),
-            CSVTable.DEFAULT_CSV_SEPARATOR);
-    checkValue(csvTable, 0, 0, "this is the first line first column");
-    checkValue(csvTable, 0, 1, "ONE");
-    checkValue(csvTable, 1, 0, "this is the second line first column");
-    checkValue(csvTable, 1, 1, "TWO");
-    checkValue(csvTable, 2, 0, "this is the a line with custom");
-    checkValue(csvTable, 2, 1, " non default separator used#|#THREE");
-  }
-
-  @Test
-  public void testDefaultLookupWithEmptyColumn() throws IOException {
-    CSVTable csvTable = new CSVTable(CSVTable.class.getResourceAsStream("test_csvfile.csv"),
-            CSVTable.DEFAULT_CSV_SEPARATOR);
-    checkValue(csvTable, 3, 0, "line with empty column");
-    checkValue(csvTable, 3, 1, " "); // spacer added by table implementation
-    checkValue(csvTable, 3, 2, "AFTER_EMPTY_COLUMN");
-  }
-
-  @Test
-  public void testLookupWithCustomSeparator() throws IOException {
-    CSVTable csvTable = new CSVTable(CSVTable.class.getResourceAsStream("test_csvfile.csv"),
-            CUSTOM_SEPARATOR);
-    checkValue(csvTable, 0, 0, "this is the first line first column;ONE");
-    checkValue(csvTable, 1, 0, "this is the second line first column;TWO");
-    checkValue(csvTable, 2, 0, "this is the a line with custom; non default separator used");
-    checkValue(csvTable, 2, 1, "THREE");
-  }
-
-  @Test
-  public void testLookupWithCustomSeparatorAndEmptyColumn() throws IOException {
-    CSVTable csvTable = new CSVTable(CSVTable.class.getResourceAsStream("test_csvfile.csv"),
-            CUSTOM_SEPARATOR);
-    checkValue(csvTable, 4, 0, "line with empty column custom separator");
-    checkValue(csvTable, 4, 1, " "); // spacer added by table implementation
-    checkValue(csvTable, 4, 2, "AFTER_EMPTY_COLUMN2");
-  }
-
-  private void checkValue(CSVTable table, int row, int column, String expectedValue) {
-    String actualValue = table.getEntry(row, column);
-    assertThat(actualValue, is(expectedValue));
-  }
-
+/*

+ * Licensed to the Apache Software Foundation (ASF) under one

+ * or more contributor license agreements.  See the NOTICE file

+ * distributed with this work for additional information

+ * regarding copyright ownership.  The ASF licenses this file

+ * to you under the Apache License, Version 2.0 (the

+ * "License"); you may not use this file except in compliance

+ * with the License.  You may obtain a copy of the License at

+ * 

+ * http://www.apache.org/licenses/LICENSE-2.0

+ * 

+ * Unless required by applicable law or agreed to in writing,

+ * software distributed under the License is distributed on an

+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY

+ * KIND, either express or implied.  See the License for the

+ * specific language governing permissions and limitations

+ * under the License.

+ */

+package org.apache.uima.ruta.resource;

+

+import static org.hamcrest.CoreMatchers.is;

+import static org.junit.Assert.assertThat;

+

+import java.io.IOException;

+

+import org.junit.Test;

+

+public class CSVTableTest {

+  private static final String CUSTOM_SEPARATOR = "#|#";

+

+  @Test

+  public void testDefaultLookup() throws IOException {

+    CSVTable csvTable = new CSVTable(CSVTable.class.getResourceAsStream("test_csvfile.csv"),

+            CSVTable.DEFAULT_CSV_SEPARATOR);

+    checkValue(csvTable, 0, 0, "this is the first line first column");

+    checkValue(csvTable, 0, 1, "ONE");

+    checkValue(csvTable, 1, 0, "this is the second line first column");

+    checkValue(csvTable, 1, 1, "TWO");

+    checkValue(csvTable, 2, 0, "this is the a line with custom");

+    checkValue(csvTable, 2, 1, " non default separator used#|#THREE");

+  }

+

+  @Test

+  public void testDefaultLookupWithEmptyColumn() throws IOException {

+    CSVTable csvTable = new CSVTable(CSVTable.class.getResourceAsStream("test_csvfile.csv"),

+            CSVTable.DEFAULT_CSV_SEPARATOR);

+    checkValue(csvTable, 3, 0, "line with empty column");

+    checkValue(csvTable, 3, 1, " "); // spacer added by table implementation

+    checkValue(csvTable, 3, 2, "AFTER_EMPTY_COLUMN");

+  }

+

+  @Test

+  public void testLookupWithCustomSeparator() throws IOException {

+    CSVTable csvTable = new CSVTable(CSVTable.class.getResourceAsStream("test_csvfile.csv"),

+            CUSTOM_SEPARATOR);

+    checkValue(csvTable, 0, 0, "this is the first line first column;ONE");

+    checkValue(csvTable, 1, 0, "this is the second line first column;TWO");

+    checkValue(csvTable, 2, 0, "this is the a line with custom; non default separator used");

+    checkValue(csvTable, 2, 1, "THREE");

+  }

+

+  @Test

+  public void testLookupWithCustomSeparatorAndEmptyColumn() throws IOException {

+    CSVTable csvTable = new CSVTable(CSVTable.class.getResourceAsStream("test_csvfile.csv"),

+            CUSTOM_SEPARATOR);

+    checkValue(csvTable, 4, 0, "line with empty column custom separator");

+    checkValue(csvTable, 4, 1, " "); // spacer added by table implementation

+    checkValue(csvTable, 4, 2, "AFTER_EMPTY_COLUMN2");

+  }

+

+  private void checkValue(CSVTable table, int row, int column, String expectedValue) {

+    String actualValue = table.getEntry(row, column);

+    assertThat(actualValue, is(expectedValue));

+  }

+

 }
\ No newline at end of file
diff --git a/ruta-core/src/test/java/org/apache/uima/ruta/rule/WildCard2Test.java b/ruta-core/src/test/java/org/apache/uima/ruta/rule/WildCard2Test.java
index 937bfeb..720670b 100644
--- a/ruta-core/src/test/java/org/apache/uima/ruta/rule/WildCard2Test.java
+++ b/ruta-core/src/test/java/org/apache/uima/ruta/rule/WildCard2Test.java
@@ -271,4 +271,18 @@
     RutaTestUtils.assertAnnotationsEquals(cas, 2, 0);

   }

 

+  @Test

+  public void testLastElementAlsoAnnotatedWithLookahead() throws Exception {

+    String document = "a b c. a b c.";

+    String script = "ANY+{-PARTOF({PERIOD, T1})->T1};\n";

+    script += "\"a\" -> T2, T3;\n";

+    script += "\"c\" -> T3;\n";

+    script += "T1 -> { T2 # T3{-> T4};};\n";

+

+    CAS cas = RutaTestUtils.getCAS(document, null, null, false);

+    Ruta.apply(cas, script);

+

+    RutaTestUtils.assertAnnotationsEquals(cas, 4, 2, "c", "c");

+  }

+

 }

diff --git a/ruta-docbook/pom.xml b/ruta-docbook/pom.xml
index e8efb90..7167bb7 100644
--- a/ruta-docbook/pom.xml
+++ b/ruta-docbook/pom.xml
@@ -26,11 +26,12 @@
   <parent>

     <groupId>org.apache.uima</groupId>

     <artifactId>ruta-parent</artifactId>

-    <version>2.8.2-SNAPSHOT</version>

+    <version>3.0.2-SNAPSHOT</version>

     <relativePath>../ruta-parent/pom.xml</relativePath>

   </parent>

   <name>Apache UIMA Ruta Documentation</name>

   <url>${uimaWebsiteUrl}</url>

+

   <properties>

     <uimaScmProject>${project.artifactId}</uimaScmProject>

     <bookNameRoot>tools.ruta.book</bookNameRoot>

diff --git a/ruta-docbook/src/docbook/tools.ruta.howtos.xml b/ruta-docbook/src/docbook/tools.ruta.howtos.xml
index 39e8532..3cecf68 100644
--- a/ruta-docbook/src/docbook/tools.ruta.howtos.xml
+++ b/ruta-docbook/src/docbook/tools.ruta.howtos.xml
@@ -250,7 +250,7 @@
 		<programlisting><![CDATA[<plugin>
 <groupId>org.apache.uima</groupId>
 <artifactId>ruta-maven-plugin</artifactId>
-<version>2.8.1</version>
+<version>3.0.1</version>
 <configuration>
 
  <!-- This is a exemplary configuration, which explicitly specifies the 
@@ -403,7 +403,7 @@
     <programlisting><![CDATA[<plugin>
 <groupId>org.apache.uima</groupId>
 <artifactId>ruta-maven-plugin</artifactId>
-<version>2.8.1</version>
+<version>3.0.1</version>
 <configuration></configuration>
 <executions>
 <execution>
@@ -456,7 +456,7 @@
     <programlisting><![CDATA[<plugin>
 <groupId>org.apache.uima</groupId>
 <artifactId>ruta-maven-plugin</artifactId>
-<version>2.8.1</version>
+<version>3.0.1</version>
 <configuration></configuration>
 <executions>
 <execution>
@@ -527,7 +527,7 @@
     </para>  
     
     <programlisting><![CDATA[mvn archetype:generate -DarchetypeGroupId=org.apache.uima 
-    -DarchetypeArtifactId=ruta-maven-archetype -DarchetypeVersion=2.8.1
+    -DarchetypeArtifactId=ruta-maven-archetype -DarchetypeVersion=3.0.1
     -DgroupId=my.domain -DartifactId=my-ruta-project]]></programlisting>
     
     <para>
diff --git a/ruta-docbook/src/docbook/tools.ruta.language.internal_indexing.xml b/ruta-docbook/src/docbook/tools.ruta.language.internal_indexing.xml
index 74a7ebb..595407b 100644
--- a/ruta-docbook/src/docbook/tools.ruta.language.internal_indexing.xml
+++ b/ruta-docbook/src/docbook/tools.ruta.language.internal_indexing.xml
@@ -23,38 +23,38 @@
    stores and updates additional indexing information directly in the CAS. 
    This indexing is not related to the annotation indexes of UIMA itself. 
    The internal indexing provides additional information, which is only utilized 
-   by the Ruta rules. This section provides an overview why and how it is included in
-   UIMA Ruta. And how Ruta can be configured in order to optimize its performance.
+   by the Ruta rules. This section provides an overview on why and how it is integrated in
+   UIMA Ruta, and how Ruta can be configured in order to optimize its performance.
   </para>
   <section id="ugr.tools.ruta.language.internal_indxexing.why">
     <title>Why additional indexing?</title>
     <para>
-	  The internal indexing is utilized for many different parts of functionality within Ruta.
+	  The internal indexing plays a an essential role in different parts of functionality within Ruta.
 	  The need for the indexing is motivated by two main and important features. 
 	</para>
 	<para>
-	  Ruta provides different language elements, for example conditions, which are fulfill 
+	  Ruta provides different language elements like conditions, which are fulfilled 
 	  depending on some investigation of the CAS annotation indexes. There are several 
-	  condition like PARTOF which require many index operations in worst case. Here, potentially
-	  the complete index needed to be iterated in order to validate if a specific annotation 
-	  is part of another annotation of a specific type. And this check need to be performed 
-	  for each considered annotation and for each rule match and for each rule where a PARTOF 
-	  condition is used. Without additional internal indexing Ruta would be too slow to 
-	  actually be useful. With this feature, it is just a fast lookup. This situation applies also for many other language elements and 
+	  conditions like PARTOF, which require many index operations in the worst case. Here, potentially
+	  the complete index needs to be iterated in order to validate if a specific annotation 
+	  is part of another annotation of a specific type. This check needs to be performed 
+	  for each considered annotation, for each rule match and for each rule where a PARTOF 
+	  condition is used. Without additional internal indexing, Ruta would be too slow to 
+	  actually be useful. With this feature, the process is just a fast lookup. This situation applies also for many other language elements and 
 	  conditions like STARTSWITH and ENDSWITH.
     </para>
     <para>
       A second necessity is the coverage-based visibility concept of Ruta.
       Annotations and any text spans are invisible if their begin or end is covered by some 
       invisible annotation, i.e., an annotation of a type that is configured to be invisible.
-      This is a powerful feature that enables many different engineering approaches and makes
-      rules also more maintainable. For a (reasonably fast) implementation of this features, 
-      it is necessary to know for each position if it is covered by annotations of specific types.
+      This is a powerful feature that enables many different engineering approaches and makes the
+      rules more maintainable as well. For a (reasonably fast) implementation of this feature, 
+      it is necessary to know for each position, if it is covered by annotations of specific types.
     </para>
     <para>
-      The internal indexing comes, however, with some costs. The indexing requires time and memory.
-      the information needs to be collected and/or updated for every Ruta script (RutaEngine) 
-      in a pipeline. This may require many operations if many annotations are available.
+      The internal indexing comes, however, at some costs. The indexing requires time and memory.
+      The information needs to be collected and/or updated for every Ruta script (RutaEngine) 
+      in a pipeline. This may be expensive operation-wise, if the scripts consist of many annotations to be checked.
       Straightforward, the storage of this information at potentially all text positions 
       requires a lot memory. Nevertheless, the advantages outweigh the disadvantages considerably. 
     </para>
@@ -84,13 +84,13 @@
     <para>
       The information is stored in additional annotations of the type RutaBasic, 
       which provides by implementation, and not by features, additional fields for
-      these three kinds of information. RutaBasic provide a complete disjunct 
+      these three kinds of information. RutaBasic types provide a complete disjunct 
       partitioning of the document. They begin and end at every position where an 
       annotation starts and ends. This also includes, for examples, one RutaBasic for each 
       SPACE annotation, registering which annotation start and end at these offsets.
       They are automatically created and also extended if new smaller annotations are added.
-      Their initial creation is called <quote>indexing</quote> and their updating
-      if RutaBasics are available, but other Java analysis engines potentially added or
+      Their initial creation is called <quote>indexing</quote> and their updating,
+      if RutaBasics are available, while other Java analysis engines potentially added or
       removed annotations, is called <quote>reindexing</quote>. 
     </para>
     <para> 
@@ -103,16 +103,16 @@
       e.g., a PARTOF condition is still fulfilled although the annotation is not present in the 
       UIMA indexes anymore. This problem can be avoided (if necessary) either by switching to a more costly
       ReindexUpdateMode COMPLETE, or by updating the internal indexing directly in the Java analysis
-      engine if necessary by using the class RutaBasicUtils.
+      engine by using the class RutaBasicUtils.
     </para>
   </section>
   <section id="ugr.tools.ruta.language.internal_indxexing.optimize">
     <title>How to optimize the performance?</title>
     <para>
       The are many different options and possibilities to optimize the runtime performance and
-      memory footprint of Ruta script, by configuring the RutaEngine. The most useful configuration, 
+      memory footprint of a Ruta script, by configuring the RutaEngine. The most useful configuration, 
       however, depends on the actual situation: How much information is available about the pipeline
-      and the types of annotations and their update operations? In the following a selection 
+      and the types of annotations and their update operations? In the following, a selection 
       of optimizations are discussed.
     </para>
     <para>
@@ -128,7 +128,7 @@
       Thus, the set of types that need to be considered for internal indexing can be restricted, which
       makes the indexing faster and requires less memory.
     </para>
-      For a reindexing/updating step the corresponding reindex parameters need to be considered.
+      For a reindexing/updating step, the corresponding reindex parameters need to be considered.
       Even relevant annotations do not need to be reindexed/updated all the time.
       The updating can, for example, be restricted to
       types that have been potentially modified by previous Java analysis engines according to their capabilities.
@@ -137,13 +137,13 @@
       Tokens and similar annotations. They do not need to be reindexed, which can be configured using the
       reindexSkipTypes parameter.
     <para>
-      An extension to this is the parameter indexOnlyMentionTypes/reindexOnlyMentionedTypes. 
+      An extension to this is the parameter indexOnlyMentionedTypes/reindexOnlyMentionedTypes. 
       Here, the relevant types are collected using the
       actual script:  the types that are actually used in the rules and thus their internal indexing needs
-      to be up to date. This mainly can increase the indexing speed. This feature is highlighted with example:
+      to be up to date. This can increase the indexing speed. This feature is highlighted in the following example:
       Considering a larger pipeline with many annotations of different types, and also with many 
       modifications since the last RutaEngine, a script with one rule does not require much reindexing,
-      only the types that are used in this rule.
+      except the exclusive types used in this rule.
     </para>
   </section>
 </section>
\ No newline at end of file
diff --git a/ruta-eclipse-feature/pom.xml b/ruta-eclipse-feature/pom.xml
index 3ad9038..2bca59a 100644
--- a/ruta-eclipse-feature/pom.xml
+++ b/ruta-eclipse-feature/pom.xml
@@ -25,7 +25,7 @@
   <parent>

     <groupId>org.apache.uima</groupId>

     <artifactId>ruta-parent</artifactId>

-    <version>2.8.2-SNAPSHOT</version>

+    <version>3.0.2-SNAPSHOT</version>

     <relativePath>../ruta-parent/pom.xml</relativePath>

   </parent>

 

diff --git a/ruta-eclipse-update-site/category.xml b/ruta-eclipse-update-site/category.xml
index fea9ffa..b53d5f7 100644
--- a/ruta-eclipse-update-site/category.xml
+++ b/ruta-eclipse-update-site/category.xml
@@ -20,7 +20,7 @@
    ***************************************************************
    -->
 <site>
-   <feature url="features/org.apache.uima.ruta.feature_2.8.1.jar" id="org.apache.uima.ruta.feature" version="2.8.1">
+   <feature url="features/org.apache.uima.ruta.feature_3.0.0.jar" id="org.apache.uima.ruta.feature" version="3.0.0">
       <category name="apache-uima-ruta"/>
    </feature>
    <category-def name="apache-uima-ruta" label="Apache UIMA Ruta">
diff --git a/ruta-eclipse-update-site/pom.xml b/ruta-eclipse-update-site/pom.xml
index f7217d0..b5b4454 100644
--- a/ruta-eclipse-update-site/pom.xml
+++ b/ruta-eclipse-update-site/pom.xml
@@ -30,7 +30,7 @@
   

 	<artifactId>ruta-eclipse-update-site</artifactId>

 	<packaging>pom</packaging>

-	<version>2.8.1</version>

+	<version>3.0.1</version>

   

 	<name>Apache UIMA Ruta Eclipse: ${project.artifactId}</name>

   <description>The UIMA Ruta Eclipse update site</description>

@@ -46,9 +46,9 @@
   <properties>

     <uimaScmProject>${project.artifactId}</uimaScmProject>

     <eclipseUpdateSiteComponent>ruta</eclipseUpdateSiteComponent>

-    <eclipseUpdateSubSite>${project.build.directory}/eclipse-update-site/${eclipseUpdateSiteComponent}</eclipseUpdateSubSite>

-    <item-maven-release-version>2.8.1</item-maven-release-version>

-    <item-eclipse-release-version>2.8.1</item-eclipse-release-version>

+    <eclipseUpdateSubSite>${project.build.directory}/eclipse-update-site-v3/${eclipseUpdateSiteComponent}</eclipseUpdateSubSite>

+    <item-maven-release-version>3.0.1</item-maven-release-version>

+    <item-eclipse-release-version>3.0.1</item-eclipse-release-version>

     <dropPrevVersions>false</dropPrevVersions>

   </properties>

 	<build>

@@ -89,7 +89,7 @@
                 <artifactItem><groupId>org.apache.uima</groupId><artifactId>ruta-ep-ide</artifactId>            <version>${item-maven-release-version}</version><destFileName>org.apache.uima.ruta.ide_${item-eclipse-release-version}.jar      </destFileName></artifactItem>

                 <artifactItem><groupId>org.apache.uima</groupId><artifactId>ruta-ep-ide-ui</artifactId>         <version>${item-maven-release-version}</version><destFileName>org.apache.uima.ruta.ide.ui_${item-eclipse-release-version}.jar   </destFileName></artifactItem>

                 <artifactItem><groupId>org.apache.uima</groupId><artifactId>ruta-ep-textruler</artifactId>      <version>${item-maven-release-version}</version><destFileName>org.apache.uima.ruta.textruler_${item-eclipse-release-version}.jar</destFileName></artifactItem>

-                <artifactItem><groupId>org.apache.uima</groupId><artifactId>ruta-ep-core-ext</artifactId>      <version>${item-maven-release-version}</version><destFileName>org.apache.uima.ruta.core.ext_${item-eclipse-release-version}.jar</destFileName></artifactItem>

+                <artifactItem><groupId>org.apache.uima</groupId><artifactId>ruta-ep-core-ext</artifactId>       <version>${item-maven-release-version}</version><destFileName>org.apache.uima.ruta.core.ext_${item-eclipse-release-version}.jar</destFileName></artifactItem>

               </artifactItems>            

               <outputDirectory>${toBePacked}</outputDirectory>              

             </configuration>

@@ -158,7 +158,7 @@
 	                        <delete dir="${eclipseUpdateSubSite}" quiet="true" />

 	                        <exec executable="svn" failonerror="true">

 	                          <arg value="checkout" />

-	                          <arg value="${distsvnroot}repos/dist/release/uima/eclipse-update-site/${eclipseUpdateSiteComponent}" />

+	                          <arg value="${distsvnroot}repos/dist/release/uima/eclipse-update-site-v3/${eclipseUpdateSiteComponent}" />

 	                          <arg value="${eclipseUpdateSubSite}" />

 	                        </exec> 

 	                        

diff --git a/ruta-ep-addons/pom.xml b/ruta-ep-addons/pom.xml
index 2fdb2a3..78691e7 100644
--- a/ruta-ep-addons/pom.xml
+++ b/ruta-ep-addons/pom.xml
@@ -25,7 +25,7 @@
   <parent>

     <groupId>org.apache.uima</groupId>

     <artifactId>ruta-ep-parent</artifactId>

-    <version>2.8.2-SNAPSHOT</version>

+    <version>3.0.2-SNAPSHOT</version>

     <relativePath>../ruta-ep-parent/pom.xml</relativePath>

   </parent>

   <properties>

diff --git a/ruta-ep-addons/src/main/java/org/apache/uima/ruta/explain/tree/ExplainTree.java b/ruta-ep-addons/src/main/java/org/apache/uima/ruta/explain/tree/ExplainTree.java
index 1268cbe..9c0ea11 100755
--- a/ruta-ep-addons/src/main/java/org/apache/uima/ruta/explain/tree/ExplainTree.java
+++ b/ruta-ep-addons/src/main/java/org/apache/uima/ruta/explain/tree/ExplainTree.java
@@ -107,7 +107,7 @@
             debugInlinedBlock.getAsCondition(), debugInlinedBlock.getMatched(), ts);

     parent.addChild(inlinedBlockNode);

 

-    FSArray inlinedRules = debugInlinedBlock.getInlinedRules();

+    FSArray<DebugScriptApply> inlinedRules = debugInlinedBlock.getInlinedRules();

     if (inlinedRules != null) {

       for (FeatureStructure each : inlinedRules) {

         buildTree(each, inlinedBlockNode, ts, offset, onlyRules);

@@ -234,7 +234,7 @@
       }

     }

 

-    FSArray inlinedActionBlocks = fs.getInlinedActionBlocks();

+    FSArray<DebugInlinedBlock> inlinedActionBlocks = fs.getInlinedActionBlocks();

     if (inlinedActionBlocks != null) {

       InlinedRootNode inlinedRootNode = new InlinedRootNode(remsNode, ts);

       remsNode.setInlined(inlinedRootNode);

@@ -269,7 +269,7 @@
         buildTree(each, remNode, ts, offset, onlyRules);

       }

     }

-    FSArray inlinedConditionBlocks = fs.getInlinedConditionBlocks();

+    FSArray<DebugInlinedBlock> inlinedConditionBlocks = fs.getInlinedConditionBlocks();

     if (inlinedConditionBlocks != null) {

       InlinedRootNode inlinedRootNode = new InlinedRootNode(remNode, ts);

       remNode.setInlined(inlinedRootNode);

diff --git a/ruta-ep-addons/src/main/java/org/apache/uima/ruta/explain/tree/RuleElementMatchNode.java b/ruta-ep-addons/src/main/java/org/apache/uima/ruta/explain/tree/RuleElementMatchNode.java
index 2ef1a35..39d8fe0 100755
--- a/ruta-ep-addons/src/main/java/org/apache/uima/ruta/explain/tree/RuleElementMatchNode.java
+++ b/ruta-ep-addons/src/main/java/org/apache/uima/ruta/explain/tree/RuleElementMatchNode.java
@@ -27,8 +27,8 @@
 import org.apache.uima.ruta.caseditor.view.tree.IAnnotationNode;

 import org.apache.uima.ruta.explain.ExplainConstants;

 

-public class RuleElementMatchNode extends ExplainAbstractTreeNode implements IEvaluatedNode,

-        IAnnotationNode {

+public class RuleElementMatchNode extends ExplainAbstractTreeNode

+        implements IEvaluatedNode, IAnnotationNode {

 

   private boolean matched;

 

@@ -40,7 +40,8 @@
     matched = baseFS.getBooleanValue(baseFeat);

 

     f = fs.getType().getFeatureByBaseName(ExplainConstants.CONDITIONS);

-    ArrayFS value = (ArrayFS) fs.getFeatureValue(f);

+    @SuppressWarnings("unchecked")

+    ArrayFS<FeatureStructure> value = (ArrayFS<FeatureStructure>) fs.getFeatureValue(f);

     if (value != null) {

       FeatureStructure[] fsarray = value.toArray();

       for (FeatureStructure each : fsarray) {

diff --git a/ruta-ep-caseditor/.gitignore b/ruta-ep-caseditor/.gitignore
index 718773c..7e3a306 100644
--- a/ruta-ep-caseditor/.gitignore
+++ b/ruta-ep-caseditor/.gitignore
@@ -1 +1 @@
-META-INF/
+META-INF/
\ No newline at end of file
diff --git a/ruta-ep-caseditor/pom.xml b/ruta-ep-caseditor/pom.xml
index eed81f1..3306d69 100644
--- a/ruta-ep-caseditor/pom.xml
+++ b/ruta-ep-caseditor/pom.xml
@@ -25,7 +25,7 @@
   <parent>

     <groupId>org.apache.uima</groupId>

     <artifactId>ruta-ep-parent</artifactId>

-    <version>2.8.2-SNAPSHOT</version>

+    <version>3.0.2-SNAPSHOT</version>

     <relativePath>../ruta-ep-parent/pom.xml</relativePath>

   </parent>

   <properties>

diff --git a/ruta-ep-core-ext/pom.xml b/ruta-ep-core-ext/pom.xml
index a072c93..0991dd9 100644
--- a/ruta-ep-core-ext/pom.xml
+++ b/ruta-ep-core-ext/pom.xml
@@ -26,7 +26,7 @@
   <parent>
     <groupId>org.apache.uima</groupId>
     <artifactId>ruta-ep-parent</artifactId>
-    <version>2.8.2-SNAPSHOT</version>
+    <version>3.0.2-SNAPSHOT</version>
     <relativePath>../ruta-ep-parent/pom.xml</relativePath>
   </parent>
   <properties>
diff --git a/ruta-ep-engine/.gitignore b/ruta-ep-engine/.gitignore
index 718773c..7e3a306 100644
--- a/ruta-ep-engine/.gitignore
+++ b/ruta-ep-engine/.gitignore
@@ -1 +1 @@
-META-INF/
+META-INF/
\ No newline at end of file
diff --git a/ruta-ep-engine/pom.xml b/ruta-ep-engine/pom.xml
index 1eb6f2e..c1705bb 100644
--- a/ruta-ep-engine/pom.xml
+++ b/ruta-ep-engine/pom.xml
@@ -25,7 +25,7 @@
   <parent>

     <groupId>org.apache.uima</groupId>

     <artifactId>ruta-parent</artifactId>

-    <version>2.8.2-SNAPSHOT</version>

+    <version>3.0.2-SNAPSHOT</version>

     <relativePath>../ruta-parent/pom.xml</relativePath>

   </parent>

 

diff --git a/ruta-ep-ide-ui/.gitignore b/ruta-ep-ide-ui/.gitignore
index 718773c..7e3a306 100644
--- a/ruta-ep-ide-ui/.gitignore
+++ b/ruta-ep-ide-ui/.gitignore
@@ -1 +1 @@
-META-INF/
+META-INF/
\ No newline at end of file
diff --git a/ruta-ep-ide-ui/pom.xml b/ruta-ep-ide-ui/pom.xml
index 4775b98..9d815f3 100644
--- a/ruta-ep-ide-ui/pom.xml
+++ b/ruta-ep-ide-ui/pom.xml
@@ -25,7 +25,7 @@
   <parent>

     <groupId>org.apache.uima</groupId>

     <artifactId>ruta-ep-parent</artifactId>

-    <version>2.8.2-SNAPSHOT</version>

+    <version>3.0.2-SNAPSHOT</version>

     <relativePath>../ruta-ep-parent/pom.xml</relativePath>

   </parent>

 

diff --git a/ruta-ep-ide/.gitignore b/ruta-ep-ide/.gitignore
index 718773c..7e3a306 100644
--- a/ruta-ep-ide/.gitignore
+++ b/ruta-ep-ide/.gitignore
@@ -1 +1 @@
-META-INF/
+META-INF/
\ No newline at end of file
diff --git a/ruta-ep-ide/pom.xml b/ruta-ep-ide/pom.xml
index b2de160..4057c37 100644
--- a/ruta-ep-ide/pom.xml
+++ b/ruta-ep-ide/pom.xml
@@ -25,7 +25,7 @@
   <parent>

     <groupId>org.apache.uima</groupId>

     <artifactId>ruta-ep-parent</artifactId>

-    <version>2.8.2-SNAPSHOT</version>

+    <version>3.0.2-SNAPSHOT</version>

     <relativePath>../ruta-ep-parent/pom.xml</relativePath>

   </parent>

 

diff --git a/ruta-ep-parent/pom.xml b/ruta-ep-parent/pom.xml
index 09b7f8f..1b041c8 100644
--- a/ruta-ep-parent/pom.xml
+++ b/ruta-ep-parent/pom.xml
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.apache.uima</groupId>
     <artifactId>ruta-parent</artifactId>
-    <version>2.8.2-SNAPSHOT</version>
+    <version>3.0.2-SNAPSHOT</version>
     <relativePath>../ruta-parent/pom.xml</relativePath>
   </parent>
 
diff --git a/ruta-ep-textruler/.gitignore b/ruta-ep-textruler/.gitignore
index 718773c..7e3a306 100644
--- a/ruta-ep-textruler/.gitignore
+++ b/ruta-ep-textruler/.gitignore
@@ -1 +1 @@
-META-INF/
+META-INF/
\ No newline at end of file
diff --git a/ruta-ep-textruler/pom.xml b/ruta-ep-textruler/pom.xml
index 84b3836..e675b10 100644
--- a/ruta-ep-textruler/pom.xml
+++ b/ruta-ep-textruler/pom.xml
@@ -25,7 +25,7 @@
   <parent>

     <groupId>org.apache.uima</groupId>

     <artifactId>ruta-ep-parent</artifactId>

-    <version>2.8.2-SNAPSHOT</version>

+    <version>3.0.2-SNAPSHOT</version>

     <relativePath>../ruta-ep-parent/pom.xml</relativePath>

   </parent>

 

diff --git a/ruta-maven-archetype/pom.xml b/ruta-maven-archetype/pom.xml
index c6292cd..3529af5 100644
--- a/ruta-maven-archetype/pom.xml
+++ b/ruta-maven-archetype/pom.xml
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.uima</groupId>
     <artifactId>ruta-parent</artifactId>
-    <version>2.8.2-SNAPSHOT</version>
+    <version>3.0.2-SNAPSHOT</version>
     <relativePath>../ruta-parent/pom.xml</relativePath>
   </parent>
   <properties>
diff --git a/ruta-maven-archetype/src/main/resources/archetype-resources/pom.xml b/ruta-maven-archetype/src/main/resources/archetype-resources/pom.xml
index 55a3da4..3eea8b2 100644
--- a/ruta-maven-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/ruta-maven-archetype/src/main/resources/archetype-resources/pom.xml
@@ -35,7 +35,7 @@
 
   <properties>
     <junit-version>4.11</junit-version>
-    <uima-version>2.10.4</uima-version>
+    <uima-version>3.1.1</uima-version>
     <ruta-version>${archetypeVersion}</ruta-version>
   </properties>
 
diff --git a/ruta-maven-plugin/pom.xml b/ruta-maven-plugin/pom.xml
index 544c151..2c23714 100644
--- a/ruta-maven-plugin/pom.xml
+++ b/ruta-maven-plugin/pom.xml
@@ -22,7 +22,7 @@
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <!-- This artifact name follows the conventions described http://books.sonatype.com/mvnref-book/reference/writing-plugins-sect-custom-plugin.html
-    where patterns like xxx-maven-plugin and maven-xxx-plugin can be invoked just using xxx if the right 
+    where patterns like xxx-maven-plugin and maven-xxx-plugin can be invoked just using xxx if the right
     settings are in place -->
   <artifactId>ruta-maven-plugin</artifactId>
   <packaging>maven-plugin</packaging>
@@ -34,7 +34,7 @@
   <parent>
     <groupId>org.apache.uima</groupId>
     <artifactId>ruta-parent</artifactId>
-    <version>2.8.2-SNAPSHOT</version>
+    <version>3.0.2-SNAPSHOT</version>
     <relativePath>../ruta-parent/pom.xml</relativePath>
   </parent>
   <properties>
@@ -142,7 +142,7 @@
             </execution>
           </executions>
         </plugin>
-        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence 
+        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence
           on the Maven build itself. -->
         <plugin>
           <groupId>org.eclipse.m2e</groupId>
diff --git a/ruta-parent/pom.xml b/ruta-parent/pom.xml
index 5492b12..537a602 100644
--- a/ruta-parent/pom.xml
+++ b/ruta-parent/pom.xml
@@ -31,7 +31,7 @@
 

   <artifactId>ruta-parent</artifactId>

   <packaging>pom</packaging>

-  <version>2.8.2-SNAPSHOT</version>

+  <version>3.0.2-SNAPSHOT</version>

   <name>Apache UIMA Ruta: ${project.artifactId}</name>

   <url>${uimaWebsiteUrl}</url>

   <inceptionYear>2011</inceptionYear>

@@ -130,8 +130,8 @@
       (http://www.famfamfam.com/lab/icons/silk/), licensed under the

       Creative Commons Attribution 3.0 License.

     </postNoticeText>

-    <uimaVersion>2.10.4</uimaVersion>

-    <uimafit-version>2.5.0</uimafit-version>

+    <uimaVersion>3.1.1</uimaVersion>

+    <uimafit-version>3.1.0</uimafit-version>

     <spring-version>4.3.22.RELEASE</spring-version>

     <!--

       BACKWARD_COMPATIBLE_IMPLEMENTER - patch version (=.=.+)

diff --git a/ruta-typesystem/pom.xml b/ruta-typesystem/pom.xml
index db5920a..10bb713 100644
--- a/ruta-typesystem/pom.xml
+++ b/ruta-typesystem/pom.xml
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.apache.uima</groupId>
     <artifactId>ruta-parent</artifactId>
-    <version>2.8.2-SNAPSHOT</version>
+    <version>3.0.2-SNAPSHOT</version>
     <relativePath>../ruta-parent/pom.xml</relativePath>
   </parent>