Buggy code:
public static synchronized Object getCache ( Context c , String cacheEntry ) { } public static synchronized void putCache ( Context c , String cacheEntry , Object o ) { } public static Object getThreadCache ( String cacheName ) { } public static void putThreadCache ( String cacheName , Object obj ) { } protected static String encodeValue ( String value ) throws UnsupportedEncodingException { } public static String decodeValue ( String value ) { } protected static boolean isId ( String key ) { } protected static boolean isSetting ( String key ) { } protected static String getSettingKey ( String key ) { } protected static void removeAllSettings ( EwJsonObject object ) throws JSONException { } protected static void stripSettings ( Document d ) throws JSONException { } public static Object tryParseJson ( Object object ) throws JSONException { } public boolean debugAllowed = true ; protected void debug ( String debug , Map < String , String [ ] > parameters ) { } @ Override public Object remove ( String key ) { } protected void removeAll ( ) { } public void removeAllSettings ( ) throws JSONException { } @ Override public Object clone ( ) throws CloneNotSupportedException { } @ SuppressWarnings ( "unchecked" ) protected EwList < Object > values ( ) throws JSONException { } protected boolean hasParam ( String key ) { } public Object get ( String key , Map < String , String [ ] > parameters ) throws JSONException { } public Object opt ( String key , Map < String , String [ ] > parameters ) throws JSONException { } public static Object getParameter ( String key , Map < String , String [ ] > parameters ) { } @ SuppressWarnings ( "rawtypes" ) public JSONArray optAsArray ( String key , Map < String , String [ ] > parameters ) throws JSONException { } @ SuppressWarnings ( "unchecked" ) protected List < String > getAsListOfStrings ( String key , Map < String , String [ ] > parameters ) throws JSONException { } public String getAsString ( String key , Map < String , String [ ] > parameters ) throws JSONException { } public String optAsString ( String key , Map < String , String [ ] > parameters ) throws JSONException { } protected String listAsString ( List < String > results ) throws JSONException { } public boolean getAsBoolean ( String key , Map < String , String [ ] > parameters ) throws JSONException { } public boolean optAsBoolean ( String key , boolean defaultx , Map < String , String [ ] > parameters ) throws JSONException { } @ SuppressWarnings ( "rawtypes" ) public Double getAsDouble ( String key , Map < String , String [ ] > parameters ) throws JSONException { } public Double optAsDouble ( String key , Double defaultx , Map < String , String [ ] > parameters ) throws JSONException { } public Integer getAsInteger ( String key , Map < String , String [ ] > parameters ) throws JSONException { } public Integer optAsInteger ( String key , Integer defaultx , Map < String , String [ ] > parameters ) throws JSONException { } public EwList < String > getAsStrings ( String key , Map < String , String [ ] > parameters ) throws JSONException { } public EwList < String > optAsStrings ( String key , Map < String , String [ ] > parameters ) throws JSONException { } @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) protected EwList < String > objectAsStrings ( Object o ) throws JSONException { } public Object getComplex ( String path , JSONObject object ) throws JSONException { } protected boolean has ( Map < String , String [ ] > parameters , String key ) { } protected boolean has ( Map < String , String [ ] > parameters , String key , String value ) { } public void resolveAllChildren ( Context c , Map < String , String [ ] > parameters , Map < String , InputStream > dataStreams ) throws JSONException { } public static void resolveAllChildren ( Context c , JSONObject settings , Map < String , String [ ] > parameters , Map < String , InputStream > dataStreams ) throws JSONException { @ SuppressWarnings ( "unchecked" ) <START_BUG> final Iterator < String > keys = settings . sortedKeys ( ) ; <END_BUG> while ( keys . hasNext ( ) ) Resolver . resolveAChild ( c , settings , parameters , dataStreams , keys . next ( ) ) ; } protected static void resolveAChild ( Context c , JSONObject settings , Map < String , String [ ] > parameters , Map < String , InputStream > dataStreams , String key ) throws JSONException { } protected void resolveAChild ( Context c , Map < String , String [ ] > parameters , Map < String , InputStream > dataStreams , String key ) throws JSONException { } protected static Object resolveAChild ( Context c , Map < String , String [ ] > parameters , Map < String , InputStream > dataStreams , String key , Resolvable thing ) throws JSONException { } protected static Object resolveAChildR ( Context c , Map < String , String [ ] > parameters , Map < String , InputStream > dataStreams , String key , Resolver resolver ) throws JSONException { } protected static Object resolveAChildC ( Context c , Map < String , String [ ] > parameters , Map < String , InputStream > dataStreams , String key , Cruncher resolver ) throws JSONException { } protected static Object resolveAChildS ( Context c , Map < String , String [ ] > parameters , Map < String , InputStream > dataStreams , String key , Scripter resolver ) throws JSONException { } }

Fix:
final Iterator < String > keys = EwJsonObject . sortedKeys ( settings ) ;