11package org .json ;
22
3- import static java .lang .String .format ;
4-
53import java .io .UnsupportedEncodingException ;
64import java .net .URLDecoder ;
75import java .net .URLEncoder ;
@@ -213,7 +211,7 @@ public Object queryFrom(Object document) throws JSONPointerException {
213211 } else if (current instanceof JSONArray ) {
214212 current = readByIndexToken (current , token );
215213 } else {
216- throw new JSONPointerException (format (
214+ throw new JSONPointerException (String . format (
217215 "value [%s] is not an array or object therefore its key %s cannot be resolved" , current ,
218216 token ));
219217 }
@@ -233,7 +231,7 @@ private Object readByIndexToken(Object current, String indexToken) throws JSONPo
233231 int index = Integer .parseInt (indexToken );
234232 JSONArray currentArr = (JSONArray ) current ;
235233 if (index >= currentArr .length ()) {
236- throw new JSONPointerException (format ("index %d is out of bounds - the array has %d elements" , index ,
234+ throw new JSONPointerException (String . format ("index %d is out of bounds - the array has %d elements" , index ,
237235 currentArr .length ()));
238236 }
239237 try {
@@ -242,7 +240,7 @@ private Object readByIndexToken(Object current, String indexToken) throws JSONPo
242240 throw new JSONPointerException ("Error reading value at index position " + index , e );
243241 }
244242 } catch (NumberFormatException e ) {
245- throw new JSONPointerException (format ("%s is not an array index" , indexToken ), e );
243+ throw new JSONPointerException (String . format ("%s is not an array index" , indexToken ), e );
246244 }
247245 }
248246
0 commit comments