Skip to content

Commit

Permalink
🎨 修复代码
Browse files Browse the repository at this point in the history
  • Loading branch information
binarywang committed Jun 20, 2023
1 parent b1015a3 commit cb7efb7
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ private void setFieldValue(UnmarshallingContext context, WxPayOrderNotifyResult
Object val = context.convertAnother(obj, field.getType());
try {
if (val != null) {
//这里加一个看似多余的(String)强转可解决高jdk版本下的编译报错问题,详情见讨论https://github.com/vaadin/framework/issues/10737
PropertyDescriptor pd = new PropertyDescriptor(field.getName(), obj.getClass());
/*
这里加一个看似多余的(String)强转可解决高jdk版本下的编译报错问题,
详情见讨论https://github.com/vaadin/framework/issues/10737
*/
PropertyDescriptor pd = new PropertyDescriptor((String) field.getName(), obj.getClass());
pd.getWriteMethod().invoke(obj, val);
}
} catch (Exception ignored) {
Expand All @@ -129,9 +132,7 @@ private Map<String, Field> getFieldMap(List<Field> fields) {

private WxPayOrderNotifyCoupon getElement(Map<Integer, WxPayOrderNotifyCoupon> coupons, String nodeName) {
Integer index = Integer.valueOf(StringUtils.substringAfterLast(nodeName, "_"));
if (coupons.get(index) == null) {
coupons.put(index, new WxPayOrderNotifyCoupon());
}
coupons.computeIfAbsent(index, k -> new WxPayOrderNotifyCoupon());

return coupons.get(index);
}
Expand Down

0 comments on commit cb7efb7

Please sign in to comment.