You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by jo...@apache.org on 2009/08/14 17:07:37 UTC

svn commit: r804253 - in /incubator/uima/uimaj/trunk/uimaj-core/src: main/java/org/apache/uima/util/ test/java/org/apache/uima/cas/test/ test/java/org/apache/uima/cas_data/impl/ test/java/org/apache/uima/flow/impl/ test/java/org/apache/uima/impl/ test/...

Author: joern
Date: Fri Aug 14 15:07:36 2009
New Revision: 804253

URL: http://svn.apache.org/viewvc?rev=804253&view=rev
Log:
UIMA-1489 Also generified test code to use generic FSIndex, FSIterator and FSIndexRepository. Previously the access to generic FSIndex and FSIterator was often not possible because FSIndexRepository was a raw class. 

Modified:
    incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasCopier.java
    incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/ConsumerCasUtils.java
    incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TCasToInlineXml.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/AnnotationIteratorTest.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/ArrayIndexTest.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/GetAllIndexedTest.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IndexComparitorTest.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IndexRepositoryTest.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IndexSerializationTest.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IteratorTest.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SerializationNoMDTest.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SerializationReinitTest.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SofaTest.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SubiteratorTest.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/TypeOrderTest.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/TypeSystemReinitTest.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas_data/impl/CasComparer.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/flow/impl/FixedFlowControllerTest.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/impl/UimaContext_implTest.java
    incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/util/CasCopierTest.java

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasCopier.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasCopier.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasCopier.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/CasCopier.java Fri Aug 14 15:07:36 2009
@@ -131,13 +131,13 @@
     }
 
     // now copy indexed FS, but keep track so we don't index anything more than once
-    Set indexedFs = new HashSet();
-    Iterator indexes = aSrcCasView.getIndexRepository().getIndexes();
+    Set<FeatureStructure> indexedFs = new HashSet<FeatureStructure>();
+    Iterator<FSIndex<FeatureStructure>> indexes = aSrcCasView.getIndexRepository().getIndexes();
     while (indexes.hasNext()) {
-      FSIndex index = (FSIndex) indexes.next();
-      Iterator iter = index.iterator();
+      FSIndex<FeatureStructure> index = indexes.next();
+      Iterator<FeatureStructure> iter = index.iterator();
       while (iter.hasNext()) {
-        FeatureStructure fs = (FeatureStructure) iter.next();
+        FeatureStructure fs = iter.next();
         if (!indexedFs.contains(fs)) {
           FeatureStructure copyOfFs = copyFs(fs);
           //check for annotations with null Sofa reference - this can happen

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/ConsumerCasUtils.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/ConsumerCasUtils.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/ConsumerCasUtils.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/ConsumerCasUtils.java Fri Aug 14 15:07:36 2009
@@ -23,13 +23,14 @@
 import org.apache.uima.cas.FSIterator;
 import org.apache.uima.cas.FeatureStructure;
 import org.apache.uima.cas.Type;
+import org.apache.uima.cas.text.AnnotationFS;
 
 public class ConsumerCasUtils {
   public static int getIntFeatValue(CAS aCasView, String aTypeS, String aFeatS) {
     int result = 0;
     Type type = aCasView.getTypeSystem().getType(aTypeS);
     if (type != null) {
-      FSIterator idIter = aCasView.getAnnotationIndex(type).iterator();
+      FSIterator<AnnotationFS> idIter = aCasView.getAnnotationIndex(type).iterator();
       while (idIter.isValid()) {
         org.apache.uima.cas.FeatureStructure idFS = idIter.get();
         result = idFS
@@ -44,7 +45,7 @@
     String result = null;
     Type type = aCasView.getTypeSystem().getType(aTypeS);
     if (type != null) {
-      FSIterator idIter = aCasView.getAnnotationIndex(type).iterator();
+      FSIterator<AnnotationFS> idIter = aCasView.getAnnotationIndex(type).iterator();
       while (idIter.isValid()) {
         org.apache.uima.cas.FeatureStructure idFS = idIter.get();
         result = idFS.getStringValue(aCasView.getTypeSystem().getFeatureByFullName(
@@ -59,7 +60,7 @@
     org.apache.uima.cas.FeatureStructure idFS = null;
     Type type = aCasView.getTypeSystem().getType(aTypeS);
     if (type != null) {
-      FSIterator idIter = aCasView.getAnnotationIndex(type).iterator();
+      FSIterator<AnnotationFS> idIter = aCasView.getAnnotationIndex(type).iterator();
       while (idIter.isValid()) {
         idFS = idIter.get();
         idIter.moveToNext();

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TCasToInlineXml.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TCasToInlineXml.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TCasToInlineXml.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/util/TCasToInlineXml.java Fri Aug 14 15:07:36 2009
@@ -102,7 +102,7 @@
 
     // get iterator over annotations sorted by increasing start position and
     // decreasing end position
-    FSIterator iterator = aCAS.getAnnotationIndex().iterator();
+    FSIterator<AnnotationFS> iterator = aCAS.getAnnotationIndex().iterator();
 
     // filter the iterator if desired
     if (aFilter != null) {
@@ -114,7 +114,7 @@
     // annotations, and if an annotation contains other annotations, we
     // push the parent annotation on the stack, process the children, and
     // then come back to the parent later.
-    ArrayList stack = new ArrayList();
+    ArrayList<AnnotationFS> stack = new ArrayList<AnnotationFS>();
     int pos = 0;
 
     try {
@@ -218,8 +218,8 @@
 
     Type stringType = aCAS.getTypeSystem().getType(CAS.TYPE_NAME_STRING);
 
-    List aFeatures = aFS.getType().getFeatures();
-    Iterator iter = aFeatures.iterator();
+    List<Feature> aFeatures = aFS.getType().getFeatures();
+    Iterator<Feature> iter = aFeatures.iterator();
     while (iter.hasNext()) {
       Feature feat = (Feature) iter.next();
       String featName = feat.getShortName();

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/AnnotationIteratorTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/AnnotationIteratorTest.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/AnnotationIteratorTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/AnnotationIteratorTest.java Fri Aug 14 15:07:36 2009
@@ -161,7 +161,7 @@
 
     int count;
     AnnotationIndex annotIndex = this.cas.getAnnotationIndex();
-    FSIterator it = annotIndex.iterator(true);
+    FSIterator<AnnotationFS> it = annotIndex.iterator(true);
     count = 0;
     while (it.isValid()) {
       ++count;

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/ArrayIndexTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/ArrayIndexTest.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/ArrayIndexTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/ArrayIndexTest.java Fri Aug 14 15:07:36 2009
@@ -76,8 +76,8 @@
     }
   }
 
-  private static final int countIndexMembers(FSIndex idx) {
-    FSIterator it = idx.iterator();
+  private static final int countIndexMembers(FSIndex<? extends FeatureStructure> idx) {
+    FSIterator<? extends FeatureStructure> it = idx.iterator();
     int count = 0;
     for (it.moveToFirst(); it.isValid(); it.moveToNext()) {
       ++count;

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/GetAllIndexedTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/GetAllIndexedTest.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/GetAllIndexedTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/GetAllIndexedTest.java Fri Aug 14 15:07:36 2009
@@ -132,15 +132,15 @@
     this.otherAnnotationType = null;
   }
   
-  private final FSIterator getAllIndexed() {
+  private final FSIterator<FeatureStructure> getAllIndexed() {
     return getAllIndexed(this.cas.getTypeSystem().getTopType());
   }
 
-  private final FSIterator getAllIndexed(Type type) {
+  private final FSIterator<FeatureStructure> getAllIndexed(Type type) {
     return this.cas.getIndexRepository().getAllIndexedFS(type);
   }
   
-  private final int getIteratorSize(FSIterator it) {
+  private final int getIteratorSize(FSIterator<? extends FeatureStructure> it) {
     int count = 0;
     for (it.moveToFirst(); it.isValid(); it.moveToNext()) {
       ++count;
@@ -186,7 +186,7 @@
     addFS(createAnnot(3, 4));
     
     // Iterate backwards, check only that it returns correct number of FSs
-    FSIterator it = getAllIndexed();
+    FSIterator<FeatureStructure> it = getAllIndexed();
     int down = this.fsCount;
     for (it.moveToLast(); it.isValid(); it.moveToPrevious()) {
       --down;
@@ -195,7 +195,7 @@
 
     // Get all indexed, create copy and iterate in parallel.
     it = getAllIndexed();
-    FSIterator copy = it.copy();
+    FSIterator<FeatureStructure> copy = it.copy();
     copy.moveToFirst();
     for (it.moveToFirst(); it.isValid(); it.moveToNext()) {
       assertTrue(copy.isValid());
@@ -216,7 +216,7 @@
     //test getAllIndexed(Type)
     Type tokenType = this.cas.getTypeSystem().getType(TOKEN_TYPE);
     assertNotNull(tokenType);
-    FSIterator tokenIter = this.cas.getIndexRepository().getAllIndexedFS(tokenType);
+    FSIterator<FeatureStructure> tokenIter = this.cas.getIndexRepository().getAllIndexedFS(tokenType);
     assertFalse(tokenIter.hasNext());
   }
 

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IndexComparitorTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IndexComparitorTest.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IndexComparitorTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IndexComparitorTest.java Fri Aug 14 15:07:36 2009
@@ -75,29 +75,29 @@
 
   FeatureStructure fss[][][];
 
-  FSIndex sortedType1;
+  FSIndex<FeatureStructure> sortedType1;
 
-  FSIndex sortedType1TypeOrder;
+  FSIndex<FeatureStructure> sortedType1TypeOrder;
 
-  private FSIndex setType1;
+  private FSIndex<FeatureStructure> setType1;
 
-  private FSIndex bagType1;
+  private FSIndex<FeatureStructure> bagType1;
 
-  private FSIndex sortedType1Sub1;
+  private FSIndex<FeatureStructure> sortedType1Sub1;
 
-  private FSIndex setType1Sub1;
+  private FSIndex<FeatureStructure> setType1Sub1;
 
-  private FSIndex bagType1Sub1;
+  private FSIndex<FeatureStructure> bagType1Sub1;
 
-  private FSIndex setType1TypeOrder;
+  private FSIndex<FeatureStructure> setType1TypeOrder;
 
-  private FSIndex bagType1TypeOrder;
+  private FSIndex<FeatureStructure> bagType1TypeOrder;
 
-  private FSIndex sortedType1Sub1TypeOrder;
+  private FSIndex<FeatureStructure> sortedType1Sub1TypeOrder;
 
-  private FSIndex setType1Sub1TypeOrder;
+  private FSIndex<FeatureStructure> setType1Sub1TypeOrder;
 
-  private FSIndex bagType1Sub1TypeOrder;
+  private FSIndex<FeatureStructure> bagType1Sub1TypeOrder;
 
   public IndexComparitorTest(String arg0) {
     super(arg0);

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IndexRepositoryTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IndexRepositoryTest.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IndexRepositoryTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IndexRepositoryTest.java Fri Aug 14 15:07:36 2009
@@ -61,7 +61,7 @@
     this.indexRep.addFS(tokenTypeFs1);
 
     // now try to retrieve
-    FSIterator iter = this.indexRep.getAllIndexedFS(tokenTypeType);
+    FSIterator<FeatureStructure> iter = this.indexRep.getAllIndexedFS(tokenTypeType);
     assertTrue(iter.hasNext());
     assertEquals(tokenTypeFs1, iter.next());
     assertFalse(iter.hasNext());
@@ -72,7 +72,7 @@
     this.indexRep.addFS(tokenTypeFs2);
 
     // now there should be two instances in the index
-    FSIterator iter2 = this.indexRep.getAllIndexedFS(tokenTypeType);
+    FSIterator<FeatureStructure> iter2 = this.indexRep.getAllIndexedFS(tokenTypeType);
     assertTrue(iter2.hasNext());
     iter2.next();
     assertTrue(iter2.hasNext());

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IndexSerializationTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IndexSerializationTest.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IndexSerializationTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IndexSerializationTest.java Fri Aug 14 15:07:36 2009
@@ -25,6 +25,7 @@
 import org.apache.uima.cas.CASException;
 import org.apache.uima.cas.FSIndex;
 import org.apache.uima.cas.Feature;
+import org.apache.uima.cas.FeatureStructure;
 import org.apache.uima.cas.Type;
 import org.apache.uima.cas.TypeSystem;
 import org.apache.uima.cas.admin.CASFactory;
@@ -217,7 +218,7 @@
     casMgr = (CASMgr) cas;
 
     // System.out.println("After serialization\n");
-    FSIndex index = cas.getAnnotationIndex();
+    FSIndex<? extends FeatureStructure> index = cas.getAnnotationIndex();
     assertTrue(index != null);
     assertTrue(index.getIndexingStrategy() == FSIndex.SORTED_INDEX);
     // System.out.println("Size of ordered index: " + index.size());

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IteratorTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IteratorTest.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IteratorTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IteratorTest.java Fri Aug 14 15:07:36 2009
@@ -209,11 +209,11 @@
     // Create a reverse iterator for the set index and check that the result
     // is the same as for forward iteration.
     IntVector v = new IntVector();
-    FSIndex bagIndex = this.cas.getIndexRepository().getIndex(CASTestSetup.ANNOT_BAG_INDEX);
-    FSIndex setIndex = this.cas.getIndexRepository().getIndex(CASTestSetup.ANNOT_SET_INDEX);
-    FSIndex sortedIndex = this.cas.getIndexRepository().getIndex(CASTestSetup.ANNOT_SORT_INDEX);
+    FSIndex<FeatureStructure> bagIndex = this.cas.getIndexRepository().getIndex(CASTestSetup.ANNOT_BAG_INDEX);
+    FSIndex<FeatureStructure> setIndex = this.cas.getIndexRepository().getIndex(CASTestSetup.ANNOT_SET_INDEX);
+    FSIndex<FeatureStructure> sortedIndex = this.cas.getIndexRepository().getIndex(CASTestSetup.ANNOT_SORT_INDEX);
 
-    FSIterator it = setIndex.iterator();
+    FSIterator<FeatureStructure> it = setIndex.iterator();
     AnnotationFS a, b = null;
     while (it.isValid()) {
       a = (AnnotationFS) it.get();
@@ -386,18 +386,18 @@
     assertTrue(sortedIndex.size() == v.size());
 
     // Test moveTo()
-    List<FeatureStructure> list = new ArrayList<FeatureStructure>();
-    it = this.cas.getAnnotationIndex().iterator();
-    for (it.moveToFirst(); it.isValid(); it.moveToNext()) {
-      list.add(it.get());
+    List<AnnotationFS> list = new ArrayList<AnnotationFS>();
+    FSIterator<AnnotationFS> it2 = this.cas.getAnnotationIndex().iterator();
+    for (it2.moveToFirst(); it2.isValid(); it2.moveToNext()) {
+      list.add(it2.get());
     }
     // AnnotationFS an;
     for (int i = 0; i < list.size(); i++) {
       // System.out.println("Iteration: " + i);
-      it.moveToFirst();
-      it.moveTo(list.get(i));
-      assertTrue(((AnnotationFS) it.get()).getBegin() == ((AnnotationFS) list.get(i)).getBegin());
-      assertTrue(((AnnotationFS) it.get()).getEnd() == ((AnnotationFS) list.get(i)).getEnd());
+      it2.moveToFirst();
+      it2.moveTo(list.get(i));
+      assertTrue(((AnnotationFS) it2.get()).getBegin() == ((AnnotationFS) list.get(i)).getBegin());
+      assertTrue(((AnnotationFS) it2.get()).getEnd() == ((AnnotationFS) list.get(i)).getEnd());
     }
 
     // Check that reverse iterator produces reverse sequence.
@@ -544,7 +544,7 @@
     }
 
     // Test iterator copy.
-    FSIterator source, copy;
+    FSIterator<AnnotationFS> source, copy;
     source = this.cas.getAnnotationIndex().iterator();
     // Count items.
     int count = 0;
@@ -625,7 +625,7 @@
    */
   public void testDelete() {
     // Create a bunch of FSs.
-    FeatureStructure[] fsArray = new FeatureStructure[100];
+    AnnotationFS[] fsArray = new AnnotationFS[100];
     FSIndexRepository ir = this.cas.getIndexRepository();
     for (int i = 0; i < fsArray.length; i++) {
       fsArray[i] = this.cas.createAnnotation(this.tokenType, i * 5, (i * 5) + 4);
@@ -635,7 +635,7 @@
         this.tokenType);
     FSIterator<FeatureStructure> setIt = setIndex.iterator();
     FSIndex<AnnotationFS> sortedIndex = this.cas.getAnnotationIndex(this.tokenType);
-    FSIterator sortedIt = sortedIndex.iterator();
+    FSIterator<AnnotationFS> sortedIt = sortedIndex.iterator();
     FSIndex<FeatureStructure> bagIndex = ir.getIndex(CASTestSetup.ANNOT_BAG_INDEX, this.tokenType);
     FSIterator<FeatureStructure> bagIt = bagIndex.iterator();
     // For each index, check that the FSs are actually in the index.

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SerializationNoMDTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SerializationNoMDTest.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SerializationNoMDTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SerializationNoMDTest.java Fri Aug 14 15:07:36 2009
@@ -267,10 +267,10 @@
     Iterator<String> labelIt = indexRepository.getLabels();
     assertTrue(labelIt != null);
     // Get the standard index for tokens.
-    FSIndex tokenIndex = cas.getAnnotationIndex(tokenType);
+    FSIndex<AnnotationFS> tokenIndex = cas.getAnnotationIndex(tokenType);
     // assert(tokenIndex != null);
     // Get an iterator over tokens.
-    FSIterator it = tokenIndex.iterator();
+    FSIterator<AnnotationFS> it = tokenIndex.iterator();
     // assert(it != null);
     // Now create sentences. We do this as follows: a sentence starts where
     // the first token after an EOS starts, and ends with an EOS.
@@ -315,8 +315,8 @@
 
     // Print the first few sentences.
     // System.out.println("\nThe first 10 sentences:\n");
-    FSIndex sentenceIndex = cas.getAnnotationIndex(localSentenceType);
-    FSIterator it = sentenceIndex.iterator();
+    FSIndex<AnnotationFS> sentenceIndex = cas.getAnnotationIndex(localSentenceType);
+    FSIterator<AnnotationFS> it = sentenceIndex.iterator();
     AnnotationFS sentFS;
     if (it.isValid()) {
       sentFS = (AnnotationFS) it.get();
@@ -335,7 +335,7 @@
     // }
 
     // Now get an iterator over all annotations.
-    FSIndex annotIndex = cas.getAnnotationIndex();
+    FSIndex<AnnotationFS> annotIndex = cas.getAnnotationIndex();
     // System.out.println("\nNumber of annotations in index: " + annotIndex.size());
 
     // Print the first few sentences.

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SerializationReinitTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SerializationReinitTest.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SerializationReinitTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SerializationReinitTest.java Fri Aug 14 15:07:36 2009
@@ -368,10 +368,10 @@
     Iterator<String> labelIt = indexRepository.getLabels();
     assertTrue(labelIt != null);
     // Get the standard index for tokens.
-    FSIndex tokenIndex = cas.getAnnotationIndex(tokenType);
+    FSIndex<AnnotationFS> tokenIndex = cas.getAnnotationIndex(tokenType);
     // assert(tokenIndex != null);
     // Get an iterator over tokens.
-    FSIterator it = tokenIndex.iterator();
+    FSIterator<AnnotationFS> it = tokenIndex.iterator();
     // assert(it != null);
     // Now create sentences. We do this as follows: a sentence starts where
     // the first token after an EOS starts, and ends with an EOS.
@@ -688,8 +688,8 @@
     ByteArrayInputStream fis = new ByteArrayInputStream(fos.toByteArray());
     Serialization.deserializeCAS(cas, fis);
 
-    FSIndex idx = cas.getAnnotationIndex(theTypeType);
-    FSIterator iter = idx.iterator();
+    FSIndex<AnnotationFS> idx = cas.getAnnotationIndex(theTypeType);
+    FSIterator<AnnotationFS> iter = idx.iterator();
     for (int tc=0; tc<cycle+1; tc++) {
       FeatureStructure testFS = iter.get();
       iter.moveToNext();
@@ -754,7 +754,7 @@
       cas1.getIndexRepository().addFS(anAnnot3);
       AnnotationFS anAnnot4 = cas1.createAnnotation(cas1.getAnnotationType(), 15, 30);
       cas1.getIndexRepository().addFS(anAnnot4);
-      FSIndex tIndex = cas1.getAnnotationIndex();
+      FSIndex<AnnotationFS> tIndex = cas1.getAnnotationIndex();
       assertTrue(tIndex.size() == 5); //doc annot plus 4 annots
       
       FeatureStructure entityFS = cas1.createFS(entityType);
@@ -805,11 +805,11 @@
       //=======================================================================
       //create Marker, add/modify fs and serialize in delta xmi format.
       Marker marker = cas2.createMarker();
-      FSIndex cas2tIndex = cas2.getAnnotationIndex();
+      FSIndex<AnnotationFS> cas2tIndex = cas2.getAnnotationIndex();
       CAS cas2preexistingView = cas2.getView("preexistingView");
-      FSIndex cas2personIndex = cas2preexistingView.getAnnotationIndex(personType);
-      FSIndex cas2orgIndex = cas2preexistingView.getAnnotationIndex(orgType);
-      FSIndex cas2ownerIndex = cas2preexistingView.getAnnotationIndex(ownerType);
+      FSIndex<AnnotationFS> cas2personIndex = cas2preexistingView.getAnnotationIndex(personType);
+      FSIndex<AnnotationFS> cas2orgIndex = cas2preexistingView.getAnnotationIndex(orgType);
+      FSIndex<AnnotationFS> cas2ownerIndex = cas2preexistingView.getAnnotationIndex(ownerType);
       
       // create an annotation and add to index
       AnnotationFS cas2anAnnot5 = cas2.createAnnotation(cas2.getAnnotationType(), 6, 8);
@@ -822,14 +822,14 @@
       //create an annotation in View1
       AnnotationFS cas2view1Annot = cas2view1.createAnnotation(cas2.getAnnotationType(), 1, 5);
       cas2view1.getIndexRepository().addFS(cas2view1Annot);
-      FSIndex cas2view1Index = cas2view1.getAnnotationIndex();
+      FSIndex<AnnotationFS> cas2view1Index = cas2view1.getAnnotationIndex();
       assertTrue(cas2view1Index.size() == 2); //document annot and this annot
      
       //modify an existing annotation
-      Iterator tIndexIter = cas2tIndex.iterator();
-      AnnotationFS docAnnot = (AnnotationFS) tIndexIter.next(); //doc annot
-      AnnotationFS modAnnot1 = (AnnotationFS) tIndexIter.next();
-      AnnotationFS delAnnot = (AnnotationFS)  tIndexIter.next();
+      Iterator<AnnotationFS> tIndexIter = cas2tIndex.iterator();
+      AnnotationFS docAnnot = tIndexIter.next(); //doc annot
+      AnnotationFS modAnnot1 = tIndexIter.next();
+      AnnotationFS delAnnot = tIndexIter.next();
       
       //modify language feature
       Feature languageF = cas2.getDocumentAnnotation().getType().getFeatureByBaseName(CAS.FEATURE_BASE_NAME_LANGUAGE);
@@ -844,7 +844,7 @@
       cas2.getIndexRepository().removeFS(delAnnot);
   
       //modify FS - string feature and FS feature.
-      Iterator<FeatureStructure> personIter = cas2personIndex.iterator();     
+      Iterator<AnnotationFS> personIter = cas2personIndex.iterator();     
       AnnotationFS cas2person1 = (AnnotationFS) personIter.next();
       AnnotationFS cas2person2 = (AnnotationFS) personIter.next();
       
@@ -854,12 +854,12 @@
       cas2person2.setStringValue(componentIdFeat, "delataCas2");
       cas2person2.setStringValue(mentionTypeFeat, "FIRSTNAME");
       
-      Iterator<FeatureStructure> orgIter = cas2orgIndex.iterator();
+      Iterator<AnnotationFS> orgIter = cas2orgIndex.iterator();
       AnnotationFS cas2orgAnnot = (AnnotationFS) orgIter.next();
       cas2orgAnnot.setStringValue(mentionTypeFeat, "ORGNAME");
       
       //modify FS feature
-      Iterator<FeatureStructure> ownerIter = cas2ownerIndex.iterator();
+      Iterator<AnnotationFS> ownerIter = cas2ownerIndex.iterator();
       AnnotationFS cas2ownerAnnot = (AnnotationFS) ownerIter.next();
       FeatureStructure cas2relArgs = cas2ownerAnnot.getFeatureValue(argsFeat);
       cas2relArgs.setFeatureValue(rangeFeat, cas2orgAnnot);

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SofaTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SofaTest.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SofaTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SofaTest.java Fri Aug 14 15:07:36 2009
@@ -256,15 +256,15 @@
       // Sofas are indexed
       // FSIndex sofaIndex =
       // cas.getIndexRepository().getIndex(CAS.SOFA_INDEX_NAME);
-      FSIterator sofaIter =this.cas.getSofaIterator();
+      FSIterator<SofaFS> sofaIter =this.cas.getSofaIterator();
       int numSofas = 0;
       while (sofaIter.isValid()) {
         numSofas++;
         sofaIter.moveToNext();
       }
-      FSIndex engIndex = engTcas.getAnnotationIndex();
-      FSIndex gerIndex = gerTcas.getAnnotationIndex();
-      FSIndex frIndex = frTcas.getAnnotationIndex();
+      FSIndex<AnnotationFS> engIndex = engTcas.getAnnotationIndex();
+      FSIndex<AnnotationFS> gerIndex = gerTcas.getAnnotationIndex();
+      FSIndex<AnnotationFS> frIndex = frTcas.getAnnotationIndex();
       // assertTrue(sofaIndex.size() == 3); // 3 sofas
       assertTrue(numSofas == 3);
       assertTrue(engIndex.size() == 5); // 4 annots plus
@@ -275,12 +275,12 @@
       // documentAnnotation
 
       // Test that the annotations are of the correct types
-      FSIterator engIt = engIndex.iterator();
-      FSIterator gerIt = gerIndex.iterator();
-      FSIterator frIt = frIndex.iterator();
-      AnnotationFS engAnnot = (AnnotationFS) engIt.get();
-      AnnotationFS gerAnnot = (AnnotationFS) gerIt.get();
-      AnnotationFS frAnnot = (AnnotationFS) frIt.get();
+      FSIterator<AnnotationFS> engIt = engIndex.iterator();
+      FSIterator<AnnotationFS> gerIt = gerIndex.iterator();
+      FSIterator<AnnotationFS> frIt = frIndex.iterator();
+      AnnotationFS engAnnot = engIt.get();
+      AnnotationFS gerAnnot = gerIt.get();
+      AnnotationFS frAnnot = frIt.get();
       assertTrue(docAnnotationType.getName().equals(engAnnot.getType().getName()));
       assertTrue(docAnnotationType.getName().equals(gerAnnot.getType().getName()));
       assertTrue(docAnnotationType.getName().equals(frAnnot.getType().getName()));

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SubiteratorTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SubiteratorTest.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SubiteratorTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/SubiteratorTest.java Fri Aug 14 15:07:36 2009
@@ -102,10 +102,10 @@
       this.ae.process(jcas);
       AnnotationIndex tokenIndex = jcas.getAnnotationIndex(jcas.getCasType(Token.type));
       AnnotationFS sentence = (AnnotationFS) jcas.getAnnotationIndex(jcas.getCasType(Sentence.type)).iterator().next();
-      FSIterator tokenIterator = tokenIndex.subiterator(sentence);
-      AnnotationFS token = (AnnotationFS) tokenIndex.iterator().next();
+      FSIterator<AnnotationFS> tokenIterator = tokenIndex.subiterator(sentence);
+      AnnotationFS token = tokenIndex.iterator().next();
       tokenIterator.moveTo(token); //throws ClassCastException    
-      UnambiguousIteratorImpl it = new UnambiguousIteratorImpl(tokenIndex.iterator());
+      UnambiguousIteratorImpl<AnnotationFS> it = new UnambiguousIteratorImpl<AnnotationFS>(tokenIndex.iterator());
       it.moveTo(token);
     } catch (AnalysisEngineProcessException e) {
       e.printStackTrace();

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/TypeOrderTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/TypeOrderTest.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/TypeOrderTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/TypeOrderTest.java Fri Aug 14 15:07:36 2009
@@ -32,6 +32,7 @@
 import org.apache.uima.cas.CAS;
 import org.apache.uima.cas.CASException;
 import org.apache.uima.cas.FSIterator;
+import org.apache.uima.cas.FeatureStructure;
 import org.apache.uima.cas.Type;
 import org.apache.uima.cas.TypeSystem;
 import org.apache.uima.cas.admin.CASFactory;
@@ -210,7 +211,7 @@
       this.cas.getIndexRepository().addFS(this.cas.createAnnotation(this.tokenType, i * 2, (i * 2) + 1));
     }
 
-    FSIterator it = this.cas.getIndexRepository().getIndex(TYPE_ORDER_INDEX).iterator();
+    FSIterator<FeatureStructure> it = this.cas.getIndexRepository().getIndex(TYPE_ORDER_INDEX).iterator();
 
     // it = cas.getAnnotationIndex().iterator();
     AnnotationFS fs;

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/TypeSystemReinitTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/TypeSystemReinitTest.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/TypeSystemReinitTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/TypeSystemReinitTest.java Fri Aug 14 15:07:36 2009
@@ -20,6 +20,7 @@
 package org.apache.uima.cas.test;
 
 import java.util.ArrayList;
+import java.util.List;
 
 import junit.framework.TestCase;
 
@@ -29,13 +30,13 @@
 import org.apache.uima.cas.Feature;
 import org.apache.uima.cas.FeatureStructure;
 import org.apache.uima.cas.Type;
-import org.apache.uima.cas.TypeSystem;
 import org.apache.uima.cas.admin.CASMgr;
 import org.apache.uima.cas.impl.CASCompleteSerializer;
 import org.apache.uima.cas.impl.CASImpl;
 import org.apache.uima.cas.impl.Serialization;
 import org.apache.uima.cas.impl.TypeImpl;
 import org.apache.uima.cas.impl.TypeSystemImpl;
+import org.apache.uima.resource.metadata.MetaDataObject;
 import org.apache.uima.resource.metadata.TypeSystemDescription;
 import org.apache.uima.resource.metadata.impl.TypeSystemDescription_impl;
 import org.apache.uima.test.junit_extension.JUnitExtension;
@@ -52,7 +53,7 @@
       TypeSystemDescription tsd = UIMAFramework.getXMLParser().parseTypeSystemDescription(
               new XMLInputSource(getClass().getResource("/org/apache/uima/examples/SourceDocumentInformation.xml")));
 
-      ArrayList l = new ArrayList();
+      List<MetaDataObject> l = new ArrayList<MetaDataObject>();
       l.add(aed);
       l.add(tsd);
       CAS cas1 = CasCreationUtils.createCas(l);

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas_data/impl/CasComparer.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas_data/impl/CasComparer.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas_data/impl/CasComparer.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas_data/impl/CasComparer.java Fri Aug 14 15:07:36 2009
@@ -35,6 +35,7 @@
 import org.apache.uima.cas.SofaFS;
 import org.apache.uima.cas.StringArrayFS;
 import org.apache.uima.cas.Type;
+import org.apache.uima.cas.text.AnnotationFS;
 
 /**
  * A non-perfect CAS equality checker for JUnit.
@@ -42,7 +43,7 @@
  */
 public class CasComparer {
   public static void assertEquals(CAS c1, CAS c2) {
-    FSIterator sofaIter = c1.getSofaIterator();
+    FSIterator<SofaFS> sofaIter = c1.getSofaIterator();
     int c1Sofas = 0;
     while (sofaIter.hasNext()) {
       SofaFS sofa = (SofaFS) sofaIter.next();
@@ -62,8 +63,8 @@
 
   public static void assertEqualViews(CAS c1, CAS c2) {
     Map<FeatureStructure, FeatureStructure> visited = new HashMap<FeatureStructure, FeatureStructure>();
-    FSIterator it1 = c1.getAnnotationIndex().iterator();
-    FSIterator it2 = c2.getAnnotationIndex().iterator();
+    FSIterator<AnnotationFS> it1 = c1.getAnnotationIndex().iterator();
+    FSIterator<AnnotationFS> it2 = c2.getAnnotationIndex().iterator();
     while (it1.isValid()) {
       Assert.assertTrue(it2.isValid());
 

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/flow/impl/FixedFlowControllerTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/flow/impl/FixedFlowControllerTest.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/flow/impl/FixedFlowControllerTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/flow/impl/FixedFlowControllerTest.java Fri Aug 14 15:07:36 2009
@@ -73,8 +73,9 @@
     UimaContextAdmin rootContext = UIMAFramework.newUimaContext(
             UIMAFramework.getLogger(), UIMAFramework.newDefaultResourceManager(),
             UIMAFramework.newConfigurationManager());
+    Map<String, String> aSofaMappings = Collections.emptyMap();
     FlowControllerContext fcContext = new FlowControllerContext_impl(
-            rootContext, "_FlowController", Collections.EMPTY_MAP,
+            rootContext, "_FlowController", aSofaMappings,
             analysisEngineMetaDataMap, aggregateMd);
     fixedFlowController = new FixedFlowController();
     fixedFlowController.initialize(fcContext);    

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/impl/UimaContext_implTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/impl/UimaContext_implTest.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/impl/UimaContext_implTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/impl/UimaContext_implTest.java Fri Aug 14 15:07:36 2009
@@ -247,7 +247,7 @@
   public void testGetConfigurationGroupNames() {
     String[] names = mContext2.getConfigurationGroupNames();
     Assert.assertEquals(5, names.length);
-    ArrayList l = new ArrayList(Arrays.asList(names));
+    ArrayList<String> l = new ArrayList<String>(Arrays.asList(names));
     Assert.assertTrue(l.contains("en"));
     Assert.assertTrue(l.contains("en-US"));
     Assert.assertTrue(l.contains("de"));
@@ -257,7 +257,7 @@
     // try on something with both groups and groupless parameters
     names = mContext3.getConfigurationGroupNames();
     Assert.assertEquals(5, names.length);
-    l = new ArrayList(Arrays.asList(names));
+    l = new ArrayList<String>(Arrays.asList(names));
     Assert.assertTrue(l.contains("en"));
     Assert.assertTrue(l.contains("en-US"));
     Assert.assertTrue(l.contains("de"));
@@ -293,7 +293,7 @@
   public void testGetConfigParameterNamesString() {
     String[] names = mContext2.getConfigParameterNames("en");
     Assert.assertEquals(4, names.length);
-    ArrayList l = new ArrayList(Arrays.asList(names));
+    ArrayList<String> l = new ArrayList<String>(Arrays.asList(names));
     Assert.assertTrue(l.contains("StringParam"));
     Assert.assertTrue(l.contains("StringArrayParam"));
     Assert.assertTrue(l.contains("IntegerParam"));
@@ -310,7 +310,7 @@
     // try on something with both groups and groupless params
     names = mContext3.getConfigParameterNames("en");
     Assert.assertEquals(4, names.length);
-    l = new ArrayList(Arrays.asList(names));
+    l = new ArrayList<String>(Arrays.asList(names));
     Assert.assertTrue(l.contains("StringParam"));
     Assert.assertTrue(l.contains("StringArrayParam"));
     Assert.assertTrue(l.contains("IntegerParam"));

Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/util/CasCopierTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/util/CasCopierTest.java?rev=804253&r1=804252&r2=804253&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/util/CasCopierTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/util/CasCopierTest.java Fri Aug 14 15:07:36 2009
@@ -83,7 +83,7 @@
     TypeDescription fooType = additionalTypes.addType("test.Foo", "Test Type",
             "uima.tcas.Annotation");
     fooType.addFeature("bar", "Test Feature", "uima.cas.String");
-    ArrayList destTypeSystems = new ArrayList();
+    ArrayList<TypeSystemDescription> destTypeSystems = new ArrayList<TypeSystemDescription>();
     destTypeSystems.add(additionalTypes);
     destTypeSystems.add(typeSystem);
     CAS destCas2 = CasCreationUtils.createCas(destTypeSystems);
@@ -128,7 +128,7 @@
     TypeDescription fooType = additionalTypes.addType("test.Foo", "Test Type",
             "uima.tcas.Annotation");
     fooType.addFeature("bar", "Test Feature", "uima.cas.String");
-    ArrayList destTypeSystems = new ArrayList();
+    ArrayList<TypeSystemDescription> destTypeSystems = new ArrayList<TypeSystemDescription>();
     destTypeSystems.add(additionalTypes);
     destTypeSystems.add(typeSystem);
     CAS destCas2 = CasCreationUtils.createCas(destTypeSystems);
@@ -176,14 +176,14 @@
     destCas.setDocumentText(srcCas.getDocumentText());
 
     // copy an Annotation
-    Iterator annotIter = srcCas.getAnnotationIndex().iterator();
+    Iterator<AnnotationFS> annotIter = srcCas.getAnnotationIndex().iterator();
     FeatureStructure annot = (FeatureStructure) annotIter.next();
     FeatureStructure copy = copier.copyFs(annot);
     // verify copy
     CasComparer.assertEquals(annot, copy);
 
     // copy a Relation (which will have references)
-    Iterator relationIter = srcCas.getIndexRepository().getIndex("testRelationIndex").iterator();
+    Iterator<FeatureStructure> relationIter = srcCas.getIndexRepository().getIndex("testRelationIndex").iterator();
     FeatureStructure relFS = (FeatureStructure) relationIter.next();
     FeatureStructure relCopy = copier.copyFs(relFS);
     // verify copy
@@ -214,9 +214,9 @@
     srcCasView.addFsToIndexes(fs);
     CasCopier.copyCas(srcCas, destCas, true);
     CAS destCasView = destCas.getView("TestView");
-    Iterator annotIter = destCasView.getAnnotationIndex().iterator();
+    Iterator<AnnotationFS> annotIter = destCasView.getAnnotationIndex().iterator();
     annotIter.next(); // document annotation
-    AnnotationFS copiedFs = (AnnotationFS) annotIter.next();
+    AnnotationFS copiedFs = annotIter.next();
     assertEquals("This", copiedFs.getCoveredText());
   }
 }