A way to get around this warning is to use an <?> iterator and to cast to String when reading values below. This is essentially how one would have done it in Java before generics. As to why org.json does not use generics, I have no idea (even their current source code does not have them, so it really is an Iterator<?> internally).