This is an automated email from the ASF dual-hosted git repository.
jamesyong pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git The following commit(s) were added to refs/heads/trunk by this push: new f64a56c Fix some checkstyle issues f64a56c is described below commit f64a56cae3bee4028fb7c5067b7c9027eb9c4ad5 Author: James Yong <[hidden email]> AuthorDate: Tue Aug 25 21:19:02 2020 +0800 Fix some checkstyle issues --- .../org/apache/ofbiz/product/category/SeoCatalogUrlServlet.java | 9 ++++++--- .../java/org/apache/ofbiz/product/category/SeoConfigUtil.java | 4 +++- .../org/apache/ofbiz/product/category/SeoControlServlet.java | 5 +++-- build.gradle | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoCatalogUrlServlet.java b/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoCatalogUrlServlet.java index 922dfd2..60fe57d 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoCatalogUrlServlet.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoCatalogUrlServlet.java @@ -72,7 +72,8 @@ public class SeoCatalogUrlServlet extends HttpServlet { String productId = null; try { String lastPathElement = pathElements.get(pathElements.size() - 1); - if (lastPathElement.startsWith("p_") || EntityQuery.use(delegator).from("Product").where("productId", lastPathElement).cache().queryOne() != null) { + if (lastPathElement.startsWith("p_") + || EntityQuery.use(delegator).from("Product").where("productId", lastPathElement).cache().queryOne() != null) { if (lastPathElement.startsWith("p_")) { productId = lastPathElement.substring(2); } else { @@ -130,7 +131,8 @@ public class SeoCatalogUrlServlet extends HttpServlet { request.setAttribute("productId", productId); } - RequestDispatcher rd = request.getRequestDispatcher("/" + (UtilValidate.isEmpty(SeoControlServlet.getControlServlet()) ? "" : (SeoControlServlet.getControlServlet() + "/")) + RequestDispatcher rd = request.getRequestDispatcher("/" + + (UtilValidate.isEmpty(SeoControlServlet.getControlServlet()) ? "" : (SeoControlServlet.getControlServlet() + "/")) + (productId != null ? PRODUCT_REQUEST : CATEGORY_REQUEST)); rd.forward(request, response); } @@ -162,7 +164,8 @@ public class SeoCatalogUrlServlet extends HttpServlet { return urlBuilder.toString(); } - public static String makeCatalogUrl(String contextPath, List<String> crumb, String productId, String currentCategoryId, String previousCategoryId) { + public static String makeCatalogUrl(String contextPath, List<String> crumb, String productId, + String currentCategoryId, String previousCategoryId) { StringBuilder urlBuilder = new StringBuilder(); urlBuilder.append(contextPath); if (urlBuilder.charAt(urlBuilder.length() - 1) != '/') { diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoConfigUtil.java b/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoConfigUtil.java index 4973b0b..27c104f 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoConfigUtil.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoConfigUtil.java @@ -210,7 +210,9 @@ public final class SeoConfigUtil { userExceptionPatterns.add(pattern); Debug.logInfo(" " + ELEMENT_URLPATTERN + ": " + urlpattern, MODULE); } catch (MalformedPatternException e) { - Debug.logWarning("Can NOT parse " + urlpattern + " in element " + ELEMENT_URLPATTERN + " of " + ELEMENT_EXCEPTIONS + ". Error: " + e.getMessage(), MODULE); + Debug.logWarning("Can NOT parse " + urlpattern + " in element " + + ELEMENT_URLPATTERN + " of " + ELEMENT_EXCEPTIONS + ". Error: " + + e.getMessage(), MODULE); } } } diff --git a/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoControlServlet.java b/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoControlServlet.java index cf83fa2..3373d73 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoControlServlet.java +++ b/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoControlServlet.java @@ -71,9 +71,10 @@ public class SeoControlServlet extends ControlServlet { @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - String uri = URLEncoder.encode(request.getRequestURI(), "UTF-8"); + String uri = URLEncoder.encode(request.getRequestURI(), "UTF-8"); if (request.getAttribute(REQUEST_IN_ALLOW_LIST) != null || request.getAttribute("_jsp_" + uri) != null) { - if (request.getRequestURI().toLowerCase(Locale.getDefault()).endsWith(".jsp") || request.getRequestURI().toLowerCase(Locale.getDefault()).endsWith(".jspx") ) { + if (request.getRequestURI().toLowerCase(Locale.getDefault()).endsWith(".jsp") + || request.getRequestURI().toLowerCase(Locale.getDefault()).endsWith(".jspx")) { JspServlet jspServlet = new JspServlet(); jspServlet.init(this.getServletConfig()); jspServlet.service(request, response); diff --git a/build.gradle b/build.gradle index f65d7f0..dd24fb7 100644 --- a/build.gradle +++ b/build.gradle @@ -288,7 +288,7 @@ checkstyle { // the sum of errors found last time it was changed after using the // ‘checkstyle’ tool present in the framework and in the official // plugins. - tasks.checkstyleMain.maxErrors = 5420 + tasks.checkstyleMain.maxErrors = 5413 // Currently there are a lot of errors so we need to temporarily // hide them to avoid polluting the terminal output. showViolations = false |
Free forum by Nabble | Edit this page |