Merge pull request #96 from apache/UIMA-5847-Remove-UV3-bug-workarounds-in-FSCollectionFactory

[UIMA-5847] Remove uv3 bug workarounds in fs collection factory
diff --git a/README b/README
index 90fd2ec..6bcfe76 100644
--- a/README
+++ b/README
@@ -50,7 +50,7 @@
 Supported Platforms
 -------------------
 
-uimaFIT requires Java 1.8 or higher, UIMA 3.0.2 or higher, and the Spring Framework 4.3.22 or higher.
+uimaFIT requires Java 1.8 or higher, UIMA 3.1.0 or higher, and the Spring Framework 4.3.26 or higher.
 
 
 Availability
diff --git a/uimafit-core/src/main/java/org/apache/uima/fit/util/FSCollectionFactory.java b/uimafit-core/src/main/java/org/apache/uima/fit/util/FSCollectionFactory.java
index 67f1d73..40e39a6 100644
--- a/uimafit-core/src/main/java/org/apache/uima/fit/util/FSCollectionFactory.java
+++ b/uimafit-core/src/main/java/org/apache/uima/fit/util/FSCollectionFactory.java
@@ -100,9 +100,7 @@
     if (ts.subsumes(cas.getAnnotationType(), type)) {
       return (List) create(cas.getAnnotationIndex(type));
     } else {
-      Collection<FeatureStructure> result = create(cas.getIndexRepository().getAllIndexedFS(type));
-      return asList(result.toArray(new FeatureStructure[result.size()]));
-      // return (List) cas.select(type).asList(); - This call is still buggy in UIMA 3.0.0
+      return (List) cas.select(type).asList();
     }
   }
 
@@ -133,10 +131,7 @@
    */
   @Deprecated
   public static <T extends AnnotationFS> List<T> create(AnnotationIndex<T> aIndex) {
-    // Was: return new AnnotationIndexAdapter<T>(aIndex);
-    // return aIndex.select().asList(); // That call is still buggy in UIMA 3.0.0
-    Collection<T> result = new AnnotationIndexAdapter<T>(aIndex);
-    return (List) asList(result.toArray());
+    return aIndex.select().asList();
   }
 
   /**
@@ -164,7 +159,7 @@
    */
   @SuppressWarnings({ "unchecked", "rawtypes" })
   public static <T extends TOP> List<T> create(ArrayFS aArray, Class<T> aType) {
-    return (List) create(aArray, CasUtil.getType(aArray.getCAS(), aType));
+    return create(aArray, CasUtil.getType(aArray.getCAS(), aType));
   }
 
   /**
@@ -553,7 +548,7 @@
    * @return a new collection of all feature structures of the given type.
    */
   public static <T extends TOP> Collection<T> create(FSList<T> aList, Class<? extends T> aType) {
-    return (Collection<T>) create(aList, CasUtil.getType(aList.getCAS(), aType));
+    return create(aList, CasUtil.getType(aList.getCAS(), aType));
   }
 
   // Using TOP here because FSList is only available in the JCas.
diff --git a/uimafit-cpe/.settings/org.eclipse.core.resources.prefs b/uimafit-cpe/.settings/org.eclipse.core.resources.prefs
index 839d647..29abf99 100644
--- a/uimafit-cpe/.settings/org.eclipse.core.resources.prefs
+++ b/uimafit-cpe/.settings/org.eclipse.core.resources.prefs
@@ -2,4 +2,5 @@
 encoding//src/main/java=UTF-8
 encoding//src/main/resources=UTF-8
 encoding//src/test/java=UTF-8
+encoding//src/test/resources=UTF-8
 encoding/<project>=UTF-8