mirror of
				https://gitee.com/dromara/hutool.git
				synced 2025-10-31 16:36:56 +08:00 
			
		
		
		
	修复JSONUtil.toBean()中将JSON数组字符串转Map对象返回错误问题(issue#3795@Github)
This commit is contained in:
		| @@ -74,6 +74,11 @@ public class MapConverter extends AbstractConverter<Map<?, ?>> { | ||||
| 			} | ||||
| 			convertMapToMap((Map) value, map); | ||||
| 		} else if (BeanUtil.isBean(value.getClass())) { | ||||
| 			if(value.getClass().getName().equals("cn.hutool.json.JSONArray")){ | ||||
| 				// issue#3795 增加JSONArray转Map错误检查 | ||||
| 				throw new UnsupportedOperationException(StrUtil.format("Unsupported {} to Map.", value.getClass().getName())); | ||||
| 			} | ||||
|  | ||||
| 			map = BeanUtil.beanToMap(value); | ||||
| 			// 二次转换,转换键值类型 | ||||
| 			map = convertInternal(map); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Looly
					Looly