You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2020/09/17 13:18:21 UTC

[ofbiz-framework] branch trunk updated: Improved: Remove formatBoundaryComment function in HtmlWidgetRenderer class (OFBIZ-12015)

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 d4713fa  Improved: Remove formatBoundaryComment function in HtmlWidgetRenderer class (OFBIZ-12015)
d4713fa is described below

commit d4713fa6473c36f1eaaf10a3ba1a876b4ed344de
Author: James Yong <ja...@apache.org>
AuthorDate: Thu Sep 17 21:11:07 2020 +0800

    Improved: Remove formatBoundaryComment function in HtmlWidgetRenderer class (OFBIZ-12015)
    
    Use buildBoundaryComment function instead of formatBoundaryComment function. Both functions do the same thing.
    
    Thanks: Jacques for review
---
 .../main/java/org/apache/ofbiz/widget/model/HtmlWidget.java    |  4 ++--
 .../apache/ofbiz/widget/renderer/html/HtmlWidgetRenderer.java  | 10 +++-------
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java
index 8225d4b..4bae38a 100644
--- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java
+++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/HtmlWidget.java
@@ -165,7 +165,7 @@ public class HtmlWidget extends ModelScreenWidget {
             try {
                 boolean insertWidgetBoundaryComments = ModelWidget.widgetBoundaryCommentsEnabled(context);
                 if (insertWidgetBoundaryComments) {
-                    writer.append(HtmlWidgetRenderer.formatBoundaryComment("Begin", "Template", location));
+                    writer.append(HtmlWidgetRenderer.buildBoundaryComment("Begin", "Template", location));
                 }
 
                 Template template = null;
@@ -177,7 +177,7 @@ public class HtmlWidget extends ModelScreenWidget {
                 FreeMarkerWorker.renderTemplate(template, context, writer);
 
                 if (insertWidgetBoundaryComments) {
-                    writer.append(HtmlWidgetRenderer.formatBoundaryComment("End", "Template", location));
+                    writer.append(HtmlWidgetRenderer.buildBoundaryComment("End", "Template", location));
                 }
             } catch (IllegalArgumentException | TemplateException | IOException e) {
                 String errMsg = "Error rendering included template at location [" + location + "]: " + e.toString();
diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlWidgetRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlWidgetRenderer.java
index caa1723..781e099 100644
--- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlWidgetRenderer.java
+++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlWidgetRenderer.java
@@ -72,11 +72,7 @@ public class HtmlWidgetRenderer {
      * @param widgetType The widget type: "Screen Widget", "Form Widget", etc.
      * @param widgetName The widget name
      */
-    public String buildBoundaryComment(String boundaryType, String widgetType, String widgetName) {
-        return formatBoundaryComment(boundaryType, widgetType, widgetName);
-    }
-
-    public static String formatBoundaryComment(String boundaryType, String widgetType, String widgetName) {
+    public static String buildBoundaryComment(String boundaryType, String widgetType, String widgetName) {
         String boundaryComment = "<!-- " + boundaryType + " " + widgetType + " " + widgetName + " -->" + WHITE_SPACE;
         if (!Debug.verboseOn()) {
             return boundaryComment;
@@ -110,7 +106,7 @@ public class HtmlWidgetRenderer {
      */
     public void renderBeginningBoundaryComment(Appendable writer, String widgetType, ModelWidget modelWidget) throws IOException {
         if (this.widgetCommentsEnabled) {
-            writer.append(this.buildBoundaryComment("Begin", widgetType, modelWidget.getBoundaryCommentName()));
+            writer.append(buildBoundaryComment("Begin", widgetType, modelWidget.getBoundaryCommentName()));
         }
     }
 
@@ -122,7 +118,7 @@ public class HtmlWidgetRenderer {
      */
     public void renderEndingBoundaryComment(Appendable writer, String widgetType, ModelWidget modelWidget) throws IOException {
         if (this.widgetCommentsEnabled) {
-            writer.append(this.buildBoundaryComment("End", widgetType, modelWidget.getBoundaryCommentName()));
+            writer.append(buildBoundaryComment("End", widgetType, modelWidget.getBoundaryCommentName()));
         }
     }