@@ -3296,7 +3296,6 @@ public <T> T fromJson(Class<T> clazz) {
32963296 if (has (fieldName )) {
32973297 Object value = get (fieldName );
32983298 Type fieldType = field .getGenericType ();
3299- Class <?> rawType = getRawType (fieldType );
33003299 Object convertedValue = convertValue (value , fieldType );
33013300 field .set (obj , convertedValue );
33023301 }
@@ -3333,9 +3332,9 @@ private Object convertValue(Object value, Type targetType) throws JSONException
33333332 } else if (rawType == long .class || rawType == Long .class ) {
33343333 return ((Number ) value ).longValue ();
33353334 } else if (rawType == boolean .class || rawType == Boolean .class ) {
3336- return ( Boolean ) value ;
3335+ return value ;
33373336 } else if (rawType == String .class ) {
3338- return ( String ) value ;
3337+ return value ;
33393338 } else if (rawType == BigDecimal .class ) {
33403339 return new BigDecimal ((String ) value );
33413340 } else if (rawType == BigInteger .class ) {
@@ -3353,14 +3352,14 @@ private Object convertValue(Object value, Type targetType) throws JSONException
33533352 Type elementType = getElementType (targetType );
33543353 return fromJsonArray ((JSONArray ) value , rawType , elementType );
33553354 }
3356- }
3355+ }
33573356 // Map handling (e.g., Map<Integer, List<String>>)
33583357 else if (Map .class .isAssignableFrom (rawType ) && value instanceof JSONObject ) {
33593358 Type [] mapTypes = getMapTypes (targetType );
33603359 Type keyType = mapTypes [0 ];
33613360 Type valueType = mapTypes [1 ];
33623361 return convertToMap ((JSONObject ) value , keyType , valueType , rawType );
3363- }
3362+ }
33643363 // POJO handling (including custom classes like Tuple<Integer, String, Integer>)
33653364 else if (!rawType .isPrimitive () && !rawType .isEnum () && value instanceof JSONObject ) {
33663365 // Recurse with the raw class for POJO deserialization
0 commit comments