[maven-release-plugin]  copy for tag uimaj-2.8.0

git-svn-id: https://svn.apache.org/repos/asf/uima/uimaj/tags/uimaj-2.8.0@1690092 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/uimaj-core/src/main/java/org/apache/uima/cas/CAS.java b/uimaj-core/src/main/java/org/apache/uima/cas/CAS.java
index 149569e..c2d4e04 100644
--- a/uimaj-core/src/main/java/org/apache/uima/cas/CAS.java
+++ b/uimaj-core/src/main/java/org/apache/uima/cas/CAS.java
@@ -472,6 +472,7 @@
    * 
    * @param type
    *          The type of the FS.
+   * @param <T> the Java cover class for the FS being created
    * @return The new FS.
    */
   <T extends FeatureStructure> T createFS(Type type) throws CASRuntimeException;
@@ -704,7 +705,7 @@
   /**
    * Get the standard annotation index.
    * 
-   * Generics: The object can be either Annotation (if JCas is in use) or AnnotationImpl 
+   * @param <T> either Annotation (if JCas is in use) or AnnotationImpl 
    * 
    * @return The standard annotation index.
    */
@@ -715,6 +716,7 @@
    * 
    * @param type
    *          The annotation type the index is restricted to.
+   * @param <T> the topmost Java class corresponding to the type
    * @return The standard annotation index, restricted to <code>type</code>.
    * @exception CASRuntimeException When <code>type</code> is not an annotation type.
    */
@@ -730,6 +732,7 @@
    *          The start of the annotation.
    * @param end
    *          The end of the annotation.
+   * @param <T> the Java class corresponding to the type
    * @return A new annotation object.
    */
   <T extends AnnotationFS> AnnotationFS createAnnotation(Type type, int begin, int end);
@@ -738,6 +741,7 @@
    * Get the document annotation. The document has a string-valued feature called "language" where
    * the document language is specified.
    * 
+   * @param <T> the Java class for the document annotation.  Could be the JCas cover class or FeatureStructure
    * @return The document annotation, or <code>null</code> if there is none.  The return value is the
    *         JCas cover class or the plain Java cover class for FeatureStructures if JCas is not in use.
    */
diff --git a/uimaj-core/src/main/java/org/apache/uima/cas/FSIndex.java b/uimaj-core/src/main/java/org/apache/uima/cas/FSIndex.java
index fc701b1..cae79a2 100644
--- a/uimaj-core/src/main/java/org/apache/uima/cas/FSIndex.java
+++ b/uimaj-core/src/main/java/org/apache/uima/cas/FSIndex.java
@@ -58,6 +58,12 @@
  * Only use a bag index if you want very fast adding and will have to iterate
  * over the whole index anyway.
  * 
+ * <p>
+ * Indexes have a top-most type, either the top of the type hierarchy, or some subtype of that.
+ * The top-most type in an index is represented by the generic T.
+ * 
+ * @param T the topmost type in this Index
+ * 
  */
 public interface FSIndex<T extends FeatureStructure> extends Iterable<T> {
 
diff --git a/uimaj-core/src/main/java/org/apache/uima/cas/FSIndexRepository.java b/uimaj-core/src/main/java/org/apache/uima/cas/FSIndexRepository.java
index 96cfb52..9b9f9fe 100644
--- a/uimaj-core/src/main/java/org/apache/uima/cas/FSIndexRepository.java
+++ b/uimaj-core/src/main/java/org/apache/uima/cas/FSIndexRepository.java
@@ -40,6 +40,7 @@
    * 
    * @param label
    *          The name of the index.
+   * @param <T> the Java class associated with the top-most type of the index
    * @return The index with the name <code>label</code>, or <code>null</code> if no such index
    *         is defined.
    */
@@ -55,6 +56,7 @@
    *          The name of the index.
    * @param type
    *          A subtype of the type of the index.
+   * @param <T> The Java class associated with the type
    * @return The specified, or <code>null</code> if an index with that name doesn't exist.
    * @exception CASRuntimeException When <code>type</code> is not a subtype of the index's type.
    */
@@ -130,7 +132,7 @@
    * Generics: T is the Java class for aType.
    * @param aType
    *          The type
-   * 
+   * @param <T> The Java class associated with aType
    * @return An iterator that returns all indexed FeatureStructures of type <code>aType</code>
    *         and its subtypes, in no particular order.
    */
diff --git a/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASImpl.java b/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASImpl.java
index 0b96be3..2670368 100644
--- a/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASImpl.java
+++ b/uimaj-core/src/main/java/org/apache/uima/cas/impl/CASImpl.java
@@ -384,7 +384,7 @@
    * to bypass any index corruption checking, e.g., CasCopier
    * 
    * Internal use only
-   * @param fsAddr
+   * @param fsAddr the address of the feature structure
    */
   public void setCacheNotInIndex(int fsAddr) {
     svd.cache_not_in_index = fsAddr;
@@ -1985,6 +1985,7 @@
    * 
    * @param addr
    *                The address of the feature structure to be created.
+   * @param <T> The Java class associated with this feature structure
    * @return A FeatureStructure object. Note that no checking whatsoever is done
    *         on the input address. There is really no way of finding out which
    *         addresses in the valid address space actually represent feature
@@ -4528,8 +4529,10 @@
   }
   
   /**
-   * The <T extends AnnotationFS> (rather than AnnotationFS) allows the method
+   * The generic spec T extends AnnotationFS (rather than AnnotationFS) allows the method
    * JCasImpl getAnnotationIndex to return Annotation instead of AnnotationFS
+   * @param <T> the Java class associated with the annotation index
+   * @return the annotation index
    */
   public <T extends AnnotationFS> AnnotationIndex<T> getAnnotationIndex() {
     return new AnnotationIndexImpl<T>(
@@ -4537,6 +4540,9 @@
              CAS.STD_ANNOTATION_INDEX));
   }
 
+  /**
+   * @see org.apache.uima.cas.CAS#getAnnotationIndex(Type)
+   */
   public <T extends AnnotationFS> AnnotationIndex<T> getAnnotationIndex(Type type) {
     return new AnnotationIndexImpl<T>(
              getIndexRepository().<T>getIndex(
diff --git a/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSBagIndex.java b/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSBagIndex.java
index 964f60a..68ce36c 100644
--- a/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSBagIndex.java
+++ b/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSBagIndex.java
@@ -110,7 +110,7 @@
    * This only works if not use Positive Int Set
    * because that's the only time there are multiple instances of the same
    * (meaning having the same heap address) item
-   * @param ele
+   * @param ele the featuresturcture to match
    * @return -1 if the item is not found, or a position value that can be used with iterators to start at that item.
    */
   int findLeftmost(int ele) {
@@ -195,6 +195,9 @@
 
   /**
    * @see org.apache.uima.cas.FSIndex#contains(FeatureStructure)
+   * @param fs A Feature Structure used a template to match for equality with the
+   *           FSs in the index.
+   * @return <code>true</code> if the index contains such an element.
    */
   public boolean contains(FeatureStructure fs) {
     return ll_contains(((FeatureStructureImpl) fs).getAddress());
diff --git a/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSIntArrayIndex.java b/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSIntArrayIndex.java
index b77978c..843d1f5 100644
--- a/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSIntArrayIndex.java
+++ b/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSIntArrayIndex.java
@@ -339,6 +339,8 @@
 
   /**
    * @see org.apache.uima.cas.FSIndex#contains(FeatureStructure)
+   * @param fs the feature structure
+   * @return true if the fs is contained
    */
   public boolean contains(FeatureStructure fs) {
     return (find(((FeatureStructureImpl) fs).getAddress()) >= 0);
diff --git a/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSIteratorWrapperDoubleCheck.java b/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSIteratorWrapperDoubleCheck.java
index 36f2028..37698fb 100644
--- a/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSIteratorWrapperDoubleCheck.java
+++ b/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSIteratorWrapperDoubleCheck.java
@@ -30,7 +30,7 @@
  * Only used for debugging

  * Takes two iterators, and compares them; returns the 1st, throws error if unequal

  *

- * @param <T>

+ * @param <T> -

  */

 public class FSIteratorWrapperDoubleCheck<T extends FeatureStructure> extends FSIteratorImplBase<T> {

   

diff --git a/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSLeafIndexImpl.java b/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSLeafIndexImpl.java
index 32f357b..faaa01b 100644
--- a/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSLeafIndexImpl.java
+++ b/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSLeafIndexImpl.java
@@ -252,7 +252,7 @@
    * Note: may return other than -1 , 0, and 1  (e.g., might return -6)
    * @param fs1 -
    * @param fs2 -
-   * @return 0 if equal, < 0 if fs1 < fs2, > 0 if fs1 > fs2
+   * @return 0 if equal, &lt; 0 if fs1 &lt; fs2, &gt; 0 if fs1 &gt; fs2
    */
   public int ll_compare(int fs1, int fs2) {
     return this.compare(fs1, fs2);
@@ -262,7 +262,7 @@
    * Note: may return other than -1 , 0, and 1  (e.g., might return -6)
    * @param fs1 -
    * @param fs2 -
-   * @return 0 if equal, < 0 if fs1 < fs2, > 0 if fs1 > fs2
+   * @return 0 if equal, &lt; 0 if fs1 &lt; fs2, &gt; 0 if fs1 &gt; fs2
    */
   public int compare(int fs1, int fs2) {
     final int[] heap = this.lowLevelCAS.getHeap().heap;
@@ -459,6 +459,7 @@
 
   /**
    * @see org.apache.uima.cas.FSIndex#getType()
+   * @return The type of feature structures in this index.
    */
   public Type getType() {
     return this.type;
@@ -476,7 +477,7 @@
 
   /**
    * For serialization: get all the items in this index and bulk add to an IntVector
-   * @param v
+   * @param v the set of items to add
    */
   protected abstract void bulkAddTo(IntVector v);
   
@@ -502,6 +503,8 @@
    * This has no callers, and is probably not used.
    * The iterator it produces is only over one leaf index and
    * doesn't include Concurrent Modification Exception testing
+   * @param fs -
+   * @return -
    */
   public FSIterator<T> iterator(FeatureStructure fs) {
     return new FSIteratorWrapper<T>(refIterator(((FeatureStructureImpl) fs).getAddress()),
diff --git a/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSRBTSetIndex.java b/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSRBTSetIndex.java
index 30f6b2a..e390656 100644
--- a/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSRBTSetIndex.java
+++ b/uimaj-core/src/main/java/org/apache/uima/cas/impl/FSRBTSetIndex.java
@@ -47,7 +47,9 @@
   /**
    * Constructor for FSRBTIndex.
    * 
-   * @param cas
+   * @param cas -
+   * @param type -
+   * @param indexType -
    */
   public FSRBTSetIndex(CASImpl cas, Type type, int indexType) {
     super(cas, type, indexType);
@@ -112,6 +114,8 @@
 
   /**
    * @see org.apache.uima.cas.FSIndex#contains(FeatureStructure)
+   * @param fs feature structure
+   * @return true if the set contains the feature structure
    */
   public boolean contains(FeatureStructure fs) {
     return ll_contains(((FeatureStructureImpl) fs).getAddress());
diff --git a/uimaj-core/src/main/java/org/apache/uima/cas/impl/LowLevelCAS.java b/uimaj-core/src/main/java/org/apache/uima/cas/impl/LowLevelCAS.java
index db538bd..40060d1 100644
--- a/uimaj-core/src/main/java/org/apache/uima/cas/impl/LowLevelCAS.java
+++ b/uimaj-core/src/main/java/org/apache/uima/cas/impl/LowLevelCAS.java
@@ -248,6 +248,7 @@
    * 
    * @param fsRef
    *          The FS reference.
+   * @param <T> the Java class for the Feature Structure
    * @return A FS object corresponding to the input reference.
    */
   <T extends FeatureStructure> T ll_getFSForRef(int fsRef);
diff --git a/uimaj-core/src/main/java/org/apache/uima/cas/text/AnnotationIndex.java b/uimaj-core/src/main/java/org/apache/uima/cas/text/AnnotationIndex.java
index eeb6a74..73b3751 100644
--- a/uimaj-core/src/main/java/org/apache/uima/cas/text/AnnotationIndex.java
+++ b/uimaj-core/src/main/java/org/apache/uima/cas/text/AnnotationIndex.java
@@ -26,8 +26,8 @@
  * An annotation index provides additional iterator functionality that applies only to instances of
  * <code>uima.tcas.Annotation</code> (or its subtypes). You can obtain an AnnotationIndex by calling:
  * <p>
- * <code>AnnotationIndex idx = cas.getAnnotationIndex();</code> or <br/>
- * <code AnnotationIndex<SomeJCasType> idx = jcas.getAnnotationIndex(SomeJCasType.class);  
+ * <code>AnnotationIndex idx = cas.getAnnotationIndex();</code> or <br>
+ * <code>AnnotationIndex&lt;SomeJCasType&gt; idx = jcas.getAnnotationIndex(SomeJCasType.class);</code> 
  * </p>
  * <p>
  * Note that the AnnotationIndex defines the following sort order between two annotations:
diff --git a/uimaj-core/src/main/java/org/apache/uima/internal/util/rb_trees/IntArrayRBTcommon.java b/uimaj-core/src/main/java/org/apache/uima/internal/util/rb_trees/IntArrayRBTcommon.java
index fb1fe99..012b6db 100644
--- a/uimaj-core/src/main/java/org/apache/uima/internal/util/rb_trees/IntArrayRBTcommon.java
+++ b/uimaj-core/src/main/java/org/apache/uima/internal/util/rb_trees/IntArrayRBTcommon.java
@@ -111,8 +111,8 @@
   }

   

   /**

-   * @param node

-   * @param value

+   * @param node -

+   * @param value -

    * @return the value

    */

   protected int setParent(int node, int value) {

@@ -421,7 +421,7 @@
    *   If k is less than all the nodes, then the first node is returned

    *   If k is greater than all the nodes, then NIL is returned (invalid signal)

    * @param k the key

-   * @return the index of the node, or NIL if k > all keys

+   * @return the index of the node, or NIL if k &gt; all keys

    */

   public int findInsertionPoint(final int k) {

     return findInsertionPointCmn(k, true);

diff --git a/uimaj-core/src/main/java/org/apache/uima/jcas/JCas.java b/uimaj-core/src/main/java/org/apache/uima/jcas/JCas.java
index fa51944..e42a9de 100644
--- a/uimaj-core/src/main/java/org/apache/uima/jcas/JCas.java
+++ b/uimaj-core/src/main/java/org/apache/uima/jcas/JCas.java
@@ -591,6 +591,7 @@
    * 
    * @param type
    *          The annotation type the index is restricted to.
+   * @param <T> the Java class corresponding to type
    * @return The standard annotation index, restricted to <code>type</code>.
    */
   <T extends Annotation> AnnotationIndex<T> getAnnotationIndex(Type type) throws CASRuntimeException;
@@ -602,6 +603,7 @@
    *          The annotation type the index is restricted to, 
    *          passed as an integer using the form
    *          MyAnnotationType.type
+   * @param <T> the Java class corresponding to type
    * @return The standard annotation index, restricted to <code>type</code>.
    * @throws CASRuntimeException -
    */
@@ -611,6 +613,7 @@
    * Get the standard annotation index restricted to a specific annotation type.
    * 
    * @param clazz The JCas cover class for the annotation type the index is restricted to, 
+   * @param <T> the Java class clazz
    * @return The standard annotation index, restricted to <code>type</code>.
    * @throws CASRuntimeException -
    */
@@ -621,10 +624,9 @@
    * subtypes).  The elements are returned in arbitrary order, and duplicates (if they exist)
    * are not removed.
    *
-   * Generics: T is the JCas Java class
-   * 
    * @param clazz - the JCas Java class specifing which type and subtypes are included
-   * 
+   * @param <T> the Java clazz
+   *  
    * @return An iterator that returns all indexed FeatureStructures of the JCas clazz 
    *         and its subtypes, in no particular order.
    */
@@ -693,6 +695,7 @@
    * 
    * @param label The name of the index.
    * @param clazz The JCas class (mostly likely written as MyJCasClass.class), which must correspond to a subtype of the type of the index.
+   * @param <T> the Java clazz
    * @return The specified, or <code>null</code> if an index with that name doesn't exist.
    * @exception CASRuntimeException When <code>clazz</code> doesn't correspond to a subtype of the index's type.
    */
diff --git a/uimaj-core/src/main/java/org/apache/uima/jcas/JFSIndexRepository.java b/uimaj-core/src/main/java/org/apache/uima/jcas/JFSIndexRepository.java
index df0bce9..e77a032 100644
--- a/uimaj-core/src/main/java/org/apache/uima/jcas/JFSIndexRepository.java
+++ b/uimaj-core/src/main/java/org/apache/uima/jcas/JFSIndexRepository.java
@@ -47,6 +47,7 @@
    * 
    * @param label
    *          The name of the index.
+   * @param <T> the Java class corresponding to the top most type defined by this index
    * @return The index with the name <code>label</code>, or <code>null</code> if no such index
    *         is defined.
    */
@@ -60,6 +61,7 @@
    *          The name of the index
    * @param type
    *          A subtype of the type of the index, written as Foo.type
+   * @param <T> the Java class corresponding to the type
    * @return The specified index, or <code>null</code> if an index with that name doesn't exist,
    *         or it exists but <code>type</code> is not a subtype of the index's type.
    */
@@ -77,6 +79,7 @@
    * 
    * @param type
    *          The annotation type the index is restricted to, written as Foo.type
+   * @param <T> the Java class corresponding to type
    * @return The standard annotation index, restricted to <code>type</code>.
    */
   <T extends Annotation> AnnotationIndex<T> getAnnotationIndex(int type);
@@ -90,10 +93,9 @@
 
   /**
    * Get all indexes in this repository.
-   * Generics: Some may be for things not having JCas cover classes, so the type of FSIndex is ? extends FeatureStructure
    * @return All indexes.
    */
-  Iterator<FSIndex<FeatureStructure>> getIndexes();
+  Iterator<FSIndex<TOP>> getIndexes();
 
   /**
    * Get the underlying FSIndexRepository associated with this JFSIndexRepository.
@@ -114,11 +116,11 @@
    * 
    * @param aType
    *          The type
-   * 
+   * @param <T> the Java Class corresponding to aType
    * @return An iterator that returns all indexed FeatureStructures of type <code>aType</code>,
    *         in no particular order.
    */
-  FSIterator<FeatureStructure> getAllIndexedFS(Type aType);
+  <T extends TOP> FSIterator<T> getAllIndexedFS(Type aType);
 
   /**
    * Gets an iterator over all indexed FeatureStructures of the specified Type (and any of its
@@ -132,10 +134,10 @@
    * 
    * @param aType
    *          The type obtained by doing MyJCasClass.type
-   * 
+   * @param <T> the Java Class corresponding to aType
    * @return An iterator that returns all indexed FeatureStructures of type <code>aType</code>,
    *         in no particular order.
    */
-  FSIterator<FeatureStructure> getAllIndexedFS(int aType);
+  <T extends TOP> FSIterator<T> getAllIndexedFS(int aType);
 
 }
diff --git a/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JCasImpl.java b/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JCasImpl.java
index 33d1be4..f8786bb 100644
--- a/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JCasImpl.java
+++ b/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JCasImpl.java
@@ -1632,7 +1632,7 @@
   /**
    * Return the UIMA Type object corresponding to this JCas's JCas cover class
    *   (Note: different JCas's, with different type systems, may share the same cover class impl)
-   * @param clazz
+   * @param clazz a JCas cover class
    * @return the corresponding UIMA Type object
    */
   public Type getCasType(Class<? extends TOP> clazz) {
diff --git a/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JFSIndexRepositoryImpl.java b/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JFSIndexRepositoryImpl.java
index eed7f68..504d03c 100644
--- a/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JFSIndexRepositoryImpl.java
+++ b/uimaj-core/src/main/java/org/apache/uima/jcas/impl/JFSIndexRepositoryImpl.java
@@ -98,8 +98,8 @@
    * @see org.apache.uima.jcas.JFSIndexRepository#getIndexes()
    */
   @Override
-  public Iterator<FSIndex<FeatureStructure>> getIndexes() {
-    return fsIndexRepository.getIndexes();
+  public Iterator<FSIndex<TOP>> getIndexes() {
+    return (Iterator<FSIndex<TOP>>)(Object)fsIndexRepository.getIndexes();
 
   }
 
@@ -115,14 +115,14 @@
   /* (non-Javadoc)
    * @see org.apache.uima.jcas.JFSIndexRepository#getAllIndexedFS(org.apache.uima.cas.Type)
    */
-  public FSIterator<FeatureStructure> getAllIndexedFS(Type aType) {
+  public <T extends TOP> FSIterator<T> getAllIndexedFS(Type aType) {
     return fsIndexRepository.getAllIndexedFS(aType);
   }
 
   /* (non-Javadoc)
    * @see org.apache.uima.jcas.JFSIndexRepository#getAllIndexedFS(int)
    */
-  public FSIterator<FeatureStructure> getAllIndexedFS(int aType) {
+  public <T extends TOP> FSIterator<T> getAllIndexedFS(int aType) {
     return fsIndexRepository.getAllIndexedFS(jcas.getCasType(aType));
   }
 }
diff --git a/uimaj-core/src/main/java/org/apache/uima/resource/impl/CasManager_impl.java b/uimaj-core/src/main/java/org/apache/uima/resource/impl/CasManager_impl.java
index 6e2bec6..87e39c3 100644
--- a/uimaj-core/src/main/java/org/apache/uima/resource/impl/CasManager_impl.java
+++ b/uimaj-core/src/main/java/org/apache/uima/resource/impl/CasManager_impl.java
@@ -301,6 +301,7 @@
    *          The CAS
    * @param requiredInterface
    *          interface to get. Currently must be one of CAS or JCas.
+   * @param <T> the particular interface
    * @return -         
    */
   @SuppressWarnings("unchecked")