Java cleanup fix: ensure an Iterator<String> is passed

This commit fixes a rather subtle error introduced with the recent Java generics cleanup.

In this case we have an Iterator without generic type information that gets passed to a method that expects Iterator<String>, this results in a runtime type error at runtime.

Independently from the solution of this specific issue, the following broader questions arise:

- do you guys periodically run the testsuite against master? I ask because I have been fixing quite some bugs lately just by running it.
- is there any specific requirement (eg. packaging) for updating commons-collections and other very basic libraries? It seems that many generics warnings can't really be fixed otherwise, and bugs like this slip in.

Thanks