Unchecked conversion

android, iterator, java, json

Solution

You can find your answere here: Type Safety warning with JSON Iterator

Iterator<?> it = schemaJSON.getJSONObject("body").keys();

while(it.hasNext())
{
     String next = (String) it.next();
     ...

Problem

I don't want to supress warnings. Is there another way to handle this warning? "The expression of type Iterator needs unchecked conversion to conform to Iterator" ``` Iterator<String> it = schemaJSON.getJSONObject("body").keys(); ```

Original source

Related problems