优化代码

This commit is contained in:
thinkgem
2019-12-25 15:04:06 +08:00
parent 0895f1015a
commit 4ab0c2e453

View File

@@ -164,13 +164,13 @@ public class JsonMapper extends ObjectMapper {
/**
* 当JSON里只含有Bean的部分属性時更新一个已存在Bean只覆盖该部分的属性.
*/
@SuppressWarnings({ "unchecked", "hiding" })
@SuppressWarnings({ "unchecked" })
public <T> T update(String jsonString, T object) {
try {
return (T) this.readerForUpdating(object).readValue(jsonString);
} catch (JsonProcessingException e) {
logger.warn("update json string:" + jsonString + " to object:" + object + " error.", e);
} catch (IOException e) {
} catch (Exception e) {
logger.warn("update json string:" + jsonString + " to object:" + object + " error.", e);
}
return null;