@@ -288,7 +288,7 @@ public boolean getBoolean(int index) throws JSONException {
288288 .equalsIgnoreCase ("true" ))) {
289289 return true ;
290290 }
291- throw wrongValueFormatException (index , "boolean " , null );
291+ throw wrongValueFormatException (index , "Boolean " , null );
292292 }
293293
294294 /**
@@ -326,7 +326,7 @@ public double getDouble(int index) throws JSONException {
326326 public float getFloat (int index ) throws JSONException {
327327 final Object object = this .get (index );
328328 if (object instanceof Number ) {
329- return ((Float )object ).floatValue ();
329+ return ((Number )object ).floatValue ();
330330 }
331331 try {
332332 return Float .parseFloat (object .toString ());
@@ -377,8 +377,7 @@ public <E extends Enum<E>> E getEnum(Class<E> clazz, int index) throws JSONExcep
377377 // JSONException should really take a throwable argument.
378378 // If it did, I would re-implement this with the Enum.valueOf
379379 // method and place any thrown exception in the JSONException
380- throw wrongValueFormatException (index , "enum of type "
381- + JSONObject .quote (clazz .getSimpleName ()), null );
380+ throw wrongValueFormatException (index , "enum of type " + JSONObject .quote (clazz .getSimpleName ()), null );
382381 }
383382 return val ;
384383 }
@@ -396,13 +395,13 @@ public <E extends Enum<E>> E getEnum(Class<E> clazz, int index) throws JSONExcep
396395 * If the key is not found or if the value cannot be converted
397396 * to a BigDecimal.
398397 */
399- public BigDecimal getBigDecimal (int index ) throws JSONException {
398+ public BigDecimal getBigDecimal (int index ) throws JSONException {
400399 Object object = this .get (index );
401- BigDecimal val = JSONObject .objectToBigDecimal (object , null );
402- if ( val = = null ) {
403- throw wrongValueFormatException ( index , "BigDecimal" , object , null ) ;
400+ BigDecimal ret = JSONObject .objectToBigDecimal (object , null );
401+ if ( ret ! = null ) {
402+ return ret ;
404403 }
405- return val ;
404+ throw wrongValueFormatException ( index , "BigDecimal" , object , null ) ;
406405 }
407406
408407 /**
@@ -415,13 +414,13 @@ public BigDecimal getBigDecimal (int index) throws JSONException {
415414 * If the key is not found or if the value cannot be converted
416415 * to a BigInteger.
417416 */
418- public BigInteger getBigInteger (int index ) throws JSONException {
417+ public BigInteger getBigInteger (int index ) throws JSONException {
419418 Object object = this .get (index );
420- BigInteger val = JSONObject .objectToBigInteger (object , null );
421- if ( val = = null ) {
422- throw wrongValueFormatException ( index , "BigInteger" , object , null ) ;
419+ BigInteger ret = JSONObject .objectToBigInteger (object , null );
420+ if ( ret ! = null ) {
421+ return ret ;
423422 }
424- return val ;
423+ throw wrongValueFormatException ( index , "BigInteger" , object , null ) ;
425424 }
426425
427426 /**
0 commit comments