This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch section-paritioning
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git

commit 2c1b3b8f96944c34b144e4a212cc82c115af215f
Author: Michael Osipov <micha...@apache.org>
AuthorDate: Mon Dec 25 18:37:42 2023 +0100

    [MPLUGIN-498] Move section rendering to separate methods
    
    This closes #248
---
 .../plugin/report/PluginOverviewRenderer.java      | 27 ++++++++++++++--------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git 
a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java
 
b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java
index 5189357e..478fa6e3 100644
--- 
a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java
+++ 
b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java
@@ -87,15 +87,28 @@ class PluginOverviewRenderer extends 
AbstractPluginReportRenderer {
             return;
         }
 
-        paragraph(getI18nString("goals.intro"));
-
         boolean hasMavenReport = false;
         for (MojoDescriptor mojo : pluginDescriptor.getMojos()) {
             if (PluginUtils.isMavenReport(mojo.getImplementation(), project)) {
                 hasMavenReport = true;
+                break;
             }
         }
 
+        renderGoalsSection(hasMavenReport);
+
+        renderSystemRequirementsSection();
+
+        renderRequirementsHistoriesSection();
+
+        renderUsageSection(hasMavenReport);
+
+        endSection();
+    }
+
+    private void renderGoalsSection(boolean hasMavenReport) {
+        paragraph(getI18nString("goals.intro"));
+
         startTable();
 
         String goalColumnName = getI18nString("goals.column.goal");
@@ -144,7 +157,9 @@ class PluginOverviewRenderer extends 
AbstractPluginReportRenderer {
         }
 
         endTable();
+    }
 
+    private void renderSystemRequirementsSection() {
         startSection(getI18nString("systemrequirements"));
 
         paragraph(getI18nString("systemrequirements.intro"));
@@ -166,15 +181,9 @@ class PluginOverviewRenderer extends 
AbstractPluginReportRenderer {
         endTable();
 
         endSection();
-
-        renderRequirementsHistories();
-
-        renderUsageSection(hasMavenReport);
-
-        endSection();
     }
 
-    private void renderRequirementsHistories() {
+    private void renderRequirementsHistoriesSection() {
         if (requirementsHistories.isEmpty()) {
             return;
         }

Reply via email to