From 7a68fa6853aaa301de2b34ccf8cd082e0af49aac Mon Sep 17 00:00:00 2001 From: BinaryWang Date: Mon, 20 Jun 2016 11:03:22 +0800 Subject: [PATCH] remove redundant specification of type arguments --- .../chanjar/weixin/mp/api/WxMpServiceImpl.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpServiceImpl.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpServiceImpl.java index c560c970..c03a1dff 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpServiceImpl.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpServiceImpl.java @@ -825,7 +825,7 @@ public class WxMpServiceImpl implements WxMpService { @Override public WxMpPrepayIdResult getPrepayId(String openId, String outTradeNo, double amt, String body, String tradeType, String ip, String callbackUrl) { - Map packageParams = new HashMap(); + Map packageParams = new HashMap<>(); packageParams.put("appid", this.wxMpConfigStorage.getAppId()); packageParams.put("mch_id", this.wxMpConfigStorage.getPartnerId()); packageParams.put("body", body); @@ -843,7 +843,7 @@ public class WxMpServiceImpl implements WxMpService { public WxMpPrepayIdResult getPrepayId(final Map parameters) { String nonce_str = System.currentTimeMillis() + ""; - final SortedMap packageParams = new TreeMap(parameters); + final SortedMap packageParams = new TreeMap<>(parameters); packageParams.put("appid", this.wxMpConfigStorage.getAppId()); packageParams.put("mch_id", this.wxMpConfigStorage.getPartnerId()); packageParams.put("nonce_str", nonce_str); @@ -895,7 +895,7 @@ public class WxMpServiceImpl implements WxMpService { @Override public Map getJsapiPayInfo(String openId,String outTradeNo, double amt, String body,String ip, String callbackUrl) throws WxErrorException{ - Map packageParams = new HashMap(); + Map packageParams = new HashMap<>(); packageParams.put("appid", this.wxMpConfigStorage.getAppId()); packageParams.put("mch_id", this.wxMpConfigStorage.getPartnerId()); packageParams.put("body", body); @@ -911,7 +911,7 @@ public class WxMpServiceImpl implements WxMpService { @Override public Map getNativePayInfo(String productId,String outTradeNo, double amt, String body,String ip, String callbackUrl) throws WxErrorException{ - Map packageParams = new HashMap(); + Map packageParams = new HashMap<>(); packageParams.put("appid", this.wxMpConfigStorage.getAppId()); packageParams.put("mch_id", this.wxMpConfigStorage.getPartnerId()); packageParams.put("body", body); @@ -946,7 +946,7 @@ public class WxMpServiceImpl implements WxMpService { throw new RuntimeException(String.format("Failed to get prepay id due to error code '%s'(%s).", wxMpPrepayIdResult.getErr_code(), wxMpPrepayIdResult.getErr_code_des())); } - Map payInfo = new HashMap(); + Map payInfo = new HashMap<>(); payInfo.put("appId", this.wxMpConfigStorage.getAppId()); // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符 payInfo.put("timeStamp", String.valueOf(System.currentTimeMillis() / 1000)); @@ -954,7 +954,7 @@ public class WxMpServiceImpl implements WxMpService { payInfo.put("package", "prepay_id=" + prepayId); payInfo.put("signType", "MD5"); if("NATIVE".equals(parameters.get("trade_type"))){ - payInfo.put("codeUrl", wxMpPrepayIdResult.getCode_url()); + payInfo.put("codeUrl", wxMpPrepayIdResult.getCode_url()); } String finalSign = WxCryptUtil.createSign(payInfo, this.wxMpConfigStorage.getPartnerKey()); @@ -966,7 +966,7 @@ public class WxMpServiceImpl implements WxMpService { public WxMpPayResult getJSSDKPayResult(String transactionId, String outTradeNo) { String nonce_str = System.currentTimeMillis() + ""; - SortedMap packageParams = new TreeMap(); + SortedMap packageParams = new TreeMap<>(); packageParams.put("appid", this.wxMpConfigStorage.getAppId()); packageParams.put("mch_id", this.wxMpConfigStorage.getPartnerId()); if (transactionId != null && !"".equals(transactionId.trim())) @@ -1018,7 +1018,7 @@ public class WxMpServiceImpl implements WxMpService { @Override public WxMpPayRefundResult refundPay(Map parameters) throws WxErrorException { - SortedMap refundParams = new TreeMap(parameters); + SortedMap refundParams = new TreeMap<>(parameters); refundParams.put("appid", this.wxMpConfigStorage.getAppId()); refundParams.put("mch_id", this.wxMpConfigStorage.getPartnerId()); refundParams.put("nonce_str", System.currentTimeMillis() + ""); @@ -1080,7 +1080,7 @@ public class WxMpServiceImpl implements WxMpService { public WxRedpackResult sendRedpack(Map parameters) throws WxErrorException { String nonce_str = System.currentTimeMillis() + ""; - SortedMap packageParams = new TreeMap(parameters); + SortedMap packageParams = new TreeMap<>(parameters); packageParams.put("wxappid", this.wxMpConfigStorage.getAppId()); packageParams.put("mch_id", this.wxMpConfigStorage.getPartnerId()); packageParams.put("nonce_str", nonce_str);