You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by as...@apache.org on 2017/07/14 19:21:47 UTC

[4/6] portals-pluto git commit: PLUTO-663 Migrate Portlet 3.0 TCK from java.util.logging to SLF4J (code review)

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8cb2fa55/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/servlets/IncluderForwarderServlet.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/servlets/IncluderForwarderServlet.java b/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/servlets/IncluderForwarderServlet.java
index 808e711..c8de4c2 100644
--- a/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/servlets/IncluderForwarderServlet.java
+++ b/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/servlets/IncluderForwarderServlet.java
@@ -50,9 +50,7 @@ import org.slf4j.LoggerFactory;
  */
 public class IncluderForwarderServlet extends HttpServlet {
    private static final long serialVersionUID = -4104376549644600993L;
-   private static final String LOG_CLASS = 
-         IncluderForwarderServlet.class.getName();
-   private final Logger LOGGER = LoggerFactory.getLogger(LOG_CLASS);
+   private final Logger LOGGER = LoggerFactory.getLogger(IncluderForwarderServlet.class);
 
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
@@ -72,14 +70,14 @@ public class IncluderForwarderServlet extends HttpServlet {
 
       String action = (String) request.getAttribute(ATTR_DISPATCH_ACTION);
       if (action == null || !action.matches("(include|forward)")) {
-         String msg = LOG_CLASS + ": Bad action attribute. action = " + action;
+         String msg = "Bad action attribute. action = " + action;
          LOGGER.error(msg);
          throw new ServletException(msg);
       }
 
       String target = (String) request.getAttribute(ATTR_DISPATCH_TARGET);
       if (target == null) {
-         String msg = LOG_CLASS + ": Bad target attribute. target = " + action;
+         String msg = "Bad target attribute. target = " + action;
          LOGGER.error(msg);
          throw new ServletException(msg);
       }
@@ -101,7 +99,7 @@ public class IncluderForwarderServlet extends HttpServlet {
       
       RequestDispatcher rd = request.getRequestDispatcher(target);
       if (rd == null) {
-         String msg = LOG_CLASS + ": Could not get request dispatcher.";
+         String msg = "Could not get request dispatcher.";
          LOGGER.error(msg);
          throw new ServletException(msg);
       }

http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/8cb2fa55/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/servlets/MultipleIncludeServlet.java
----------------------------------------------------------------------
diff --git a/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/servlets/MultipleIncludeServlet.java b/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/servlets/MultipleIncludeServlet.java
index e805970..a61bb65 100644
--- a/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/servlets/MultipleIncludeServlet.java
+++ b/portlet-tck_3.0/common/src/main/java/javax/portlet/tck/servlets/MultipleIncludeServlet.java
@@ -43,10 +43,9 @@ import org.slf4j.LoggerFactory;
  *
  */
 public class MultipleIncludeServlet extends HttpServlet {
+
    private static final long serialVersionUID = -4104376549644600993L;
-   private static final String LOG_CLASS = 
-         MultipleIncludeServlet.class.getName();
-   private final Logger LOGGER = LoggerFactory.getLogger(LOG_CLASS);
+   private final Logger LOGGER = LoggerFactory.getLogger(MultipleIncludeServlet.class);
 
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
@@ -63,7 +62,7 @@ public class MultipleIncludeServlet extends HttpServlet {
    // The tck uses only get & post requests
    protected void processTCKReq(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
-      LOGGER.info(LOG_CLASS + "processTCKReq: servlet entry");
+      LOGGER.trace("processTCKReq: servlet entry");
 
       String str = (String) request.getAttribute(MULTIPLE_INCLUDE_ATTR);
       int num = 1;