From 18ec20d7b5a1b5fb351fa22737aa6aeec0c148c0 Mon Sep 17 00:00:00 2001 From: Faisal Hameed Date: Fri, 1 Jul 2016 15:22:18 +0500 Subject: [PATCH] Fixing squid:S1312 - Loggers should be "private static final" and should share a naming convention. --- .../hao0/alipay/demo/controller/Notifies.java | 20 +++++++++---------- .../me/hao0/alipay/demo/controller/Pays.java | 6 +++--- .../hao0/alipay/demo/controller/Refunds.java | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/alipay-demo/src/main/java/me/hao0/alipay/demo/controller/Notifies.java b/alipay-demo/src/main/java/me/hao0/alipay/demo/controller/Notifies.java index 1baecf9..468514a 100644 --- a/alipay-demo/src/main/java/me/hao0/alipay/demo/controller/Notifies.java +++ b/alipay-demo/src/main/java/me/hao0/alipay/demo/controller/Notifies.java @@ -23,7 +23,7 @@ @RequestMapping("/notifies") public class Notifies { - private static final Logger logger = LoggerFactory.getLogger(Notifies.class); + private static final Logger LOGGER = LoggerFactory.getLogger(Notifies.class); @Autowired private AlipayService alipayService; @@ -39,9 +39,9 @@ public String backend(HttpServletRequest request){ for (AlipayField f : AlipayFields.WEB_PAY_NOTIFY){ notifyParams.put(f.field(), request.getParameter(f.field())); } - logger.info("backend notify params: {}", notifyParams); + LOGGER.info("backend notify params: {}", notifyParams); if (!alipayService.notifyVerifyMd5(notifyParams)){ - logger.error("backend sign verify failed"); + LOGGER.error("backend sign verify failed"); return "FAIL"; } @@ -52,7 +52,7 @@ public String backend(HttpServletRequest request){ // TODO business logic } - logger.info("backend notify success"); + LOGGER.info("backend notify success"); return "SUCCESS"; } @@ -76,8 +76,8 @@ public String webFrontend(HttpServletRequest request){ // TODO business logic } - logger.info("web frontend notify params: {}", receives); - logger.info("web frontend sign: {}", alipayService.notifyVerifyMd5(receives)); + LOGGER.info("web frontend notify params: {}", receives); + LOGGER.info("web frontend sign: {}", alipayService.notifyVerifyMd5(receives)); return receives.toString(); } @@ -102,8 +102,8 @@ public String wapFrontend(HttpServletRequest request){ // TODO business logic } - logger.info("wap frontend notify params: {}", receives); - logger.info("wap frontend sign: {}", alipayService.notifyVerifyMd5(receives)); + LOGGER.info("wap frontend notify params: {}", receives); + LOGGER.info("wap frontend sign: {}", alipayService.notifyVerifyMd5(receives)); return receives.toString(); } @@ -120,7 +120,7 @@ public String refund(HttpServletRequest request){ receives.put(f.field(), request.getParameter(f.field())); } - logger.info("refund notify params: {}", receives); + LOGGER.info("refund notify params: {}", receives); if (!alipayService.notifyVerifyMd5(receives)){ System.out.println("refund sign verify failed"); return "FAIL"; @@ -128,7 +128,7 @@ public String refund(HttpServletRequest request){ // TODO business logic - logger.info("refund notify success"); + LOGGER.info("refund notify success"); return "SUCCESS"; } } diff --git a/alipay-demo/src/main/java/me/hao0/alipay/demo/controller/Pays.java b/alipay-demo/src/main/java/me/hao0/alipay/demo/controller/Pays.java index bdfd095..c32796a 100644 --- a/alipay-demo/src/main/java/me/hao0/alipay/demo/controller/Pays.java +++ b/alipay-demo/src/main/java/me/hao0/alipay/demo/controller/Pays.java @@ -22,7 +22,7 @@ @RequestMapping("/pays") public class Pays { - private static final Logger logger = LoggerFactory.getLogger(Pays.class); + private static final Logger LOGGER = LoggerFactory.getLogger(Pays.class); @Autowired private AlipayService alipayService; @@ -35,7 +35,7 @@ public void webPay(@RequestParam("orderNumber") String orderNumber, HttpServletR WebPayDetail detail = new WebPayDetail(orderNumber, "测试订单-" + orderNumber, "0.01"); String form = alipayService.webPay(detail); - logger.info("web pay form: {}", form); + LOGGER.info("web pay form: {}", form); try { resp.setContentType("text/html;charset=UTF-8"); resp.setCharacterEncoding("UTF-8"); @@ -54,7 +54,7 @@ public void wapPay(@RequestParam("orderNumber") String orderNumber, HttpServletR WapPayDetail detail = new WapPayDetail(orderNumber, "测试订单-" + orderNumber, "0.01"); String form = alipayService.wapPay(detail); - logger.info("wap pay form: {}", form); + LOGGER.info("wap pay form: {}", form); try { resp.setContentType("text/html;charset=UTF-8"); resp.setCharacterEncoding("UTF-8"); diff --git a/alipay-demo/src/main/java/me/hao0/alipay/demo/controller/Refunds.java b/alipay-demo/src/main/java/me/hao0/alipay/demo/controller/Refunds.java index dbd611d..e47c410 100644 --- a/alipay-demo/src/main/java/me/hao0/alipay/demo/controller/Refunds.java +++ b/alipay-demo/src/main/java/me/hao0/alipay/demo/controller/Refunds.java @@ -23,7 +23,7 @@ @RequestMapping("/refunds") public class Refunds { - private static final Logger logger = LoggerFactory.getLogger(Refunds.class); + private static final Logger LOGGER = LoggerFactory.getLogger(Refunds.class); @Autowired private AlipayService alipayService; @@ -47,7 +47,7 @@ public Boolean submit( data.setFee("0.01"); data.setReason("订单取消"); detail.setDetailDatas(Arrays.asList(data)); - logger.info("refund submit: {}", detail); + LOGGER.info("refund submit: {}", detail); return alipayService.refund(detail); } }