🎨 修复代码

This commit is contained in:
Binary Wang 2023-06-20 14:27:36 +08:00
parent b1015a35b8
commit cb7efb79cf

View File

@ -110,8 +110,11 @@ public class WxPayOrderNotifyResultConverter extends AbstractReflectionConverter
Object val = context.convertAnother(obj, field.getType()); Object val = context.convertAnother(obj, field.getType());
try { try {
if (val != null) { 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); pd.getWriteMethod().invoke(obj, val);
} }
} catch (Exception ignored) { } catch (Exception ignored) {
@ -129,9 +132,7 @@ public class WxPayOrderNotifyResultConverter extends AbstractReflectionConverter
private WxPayOrderNotifyCoupon getElement(Map<Integer, WxPayOrderNotifyCoupon> coupons, String nodeName) { private WxPayOrderNotifyCoupon getElement(Map<Integer, WxPayOrderNotifyCoupon> coupons, String nodeName) {
Integer index = Integer.valueOf(StringUtils.substringAfterLast(nodeName, "_")); Integer index = Integer.valueOf(StringUtils.substringAfterLast(nodeName, "_"));
if (coupons.get(index) == null) { coupons.computeIfAbsent(index, k -> new WxPayOrderNotifyCoupon());
coupons.put(index, new WxPayOrderNotifyCoupon());
}
return coupons.get(index); return coupons.get(index);
} }