getViewIterator in CASImpl is written with the signature:
  Iterator<CAS> getViewIterator()

If you are working with things needing CASImpl objects, you would write:

  Iterator<CAS> s = aCas.getViewIterator();
  while (s.hasNext()) {
    CASImpl ci = (CASImpl) s.next();
      ... code using ci...
  }

If we changed the signature to:
  Iterator<T extends CAS> getViewIterator()
then you would write:
  Iterator<CASImpl> s = aCas.getViewIterator(); // cast done inside the
support code, not here
  while (s.hasNext()) {
    CASImpl ci = s.next();  // works OK without casting
      ... code using ci...
  }

Would it be better to have that form of the signature? 
-Marshall

Reply via email to