You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2022/07/23 14:44:12 UTC

[maven-reporting-impl] branch MSHARED-1106 updated (317284f -> 0614724)

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

michaelo pushed a change to branch MSHARED-1106
in repository https://gitbox.apache.org/repos/asf/maven-reporting-impl.git


 discard 317284f  [MSHARED-1106] Improve and simplify section handling
     new 0614724  [MSHARED-1106] Improve and simplify section handling

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (317284f)
            \
             N -- N -- N   refs/heads/MSHARED-1106 (0614724)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/maven/reporting/AbstractMavenReportRenderer.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


[maven-reporting-impl] 01/01: [MSHARED-1106] Improve and simplify section handling

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MSHARED-1106
in repository https://gitbox.apache.org/repos/asf/maven-reporting-impl.git

commit 0614724c81de6746d716434112b337b59c50465a
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat Jul 23 16:41:49 2022 +0200

    [MSHARED-1106] Improve and simplify section handling
---
 .../reporting/AbstractMavenReportRenderer.java     | 129 +++------------------
 1 file changed, 14 insertions(+), 115 deletions(-)

diff --git a/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java b/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java
index c9f57a4..e83ab5e 100644
--- a/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java
+++ b/src/main/java/org/apache/maven/reporting/AbstractMavenReportRenderer.java
@@ -21,7 +21,6 @@ package org.apache.maven.reporting;
 
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
-import org.apache.maven.doxia.util.HtmlTools;
 
 import org.apache.maven.shared.utils.StringUtils;
 
@@ -97,21 +96,9 @@ public abstract class AbstractMavenReportRenderer
      *
      * @param name the name of this section, could be null.
      * @see #text(String)
-     * @see Sink#section1()
-     * @see Sink#sectionTitle1()
-     * @see Sink#sectionTitle1_()
-     * @see Sink#section2()
-     * @see Sink#sectionTitle2()
-     * @see Sink#sectionTitle2_()
-     * @see Sink#section3()
-     * @see Sink#sectionTitle3()
-     * @see Sink#sectionTitle3_()
-     * @see Sink#section4()
-     * @see Sink#sectionTitle4()
-     * @see Sink#sectionTitle4_()
-     * @see Sink#section5()
-     * @see Sink#sectionTitle5()
-     * @see Sink#sectionTitle5_()
+     * @see Sink#section(int, org.apache.maven.doxia.sink.SinkEventAttributes)
+     * @see Sink#sectionTitle(int, org.apache.maven.doxia.sink.SinkEventAttributes)
+     * @see Sink#sectionTitle_(int)
      */
     protected void startSection( String name )
     {
@@ -124,119 +111,31 @@ public abstract class AbstractMavenReportRenderer
      * @param name the name of this section, could be null.
      * @param anchor the anchor of this section, could be null.
      * @see #text(String)
-     * @see Sink#section1()
-     * @see Sink#sectionTitle1()
-     * @see Sink#sectionTitle1_()
-     * @see Sink#section2()
-     * @see Sink#sectionTitle2()
-     * @see Sink#sectionTitle2_()
-     * @see Sink#section3()
-     * @see Sink#sectionTitle3()
-     * @see Sink#sectionTitle3_()
-     * @see Sink#section4()
-     * @see Sink#sectionTitle4()
-     * @see Sink#sectionTitle4_()
-     * @see Sink#section5()
-     * @see Sink#sectionTitle5()
-     * @see Sink#sectionTitle5_()
+     * @see Sink#section(int, org.apache.maven.doxia.sink.SinkEventAttributes)
+     * @see Sink#sectionTitle(int, org.apache.maven.doxia.sink.SinkEventAttributes)
+     * @see Sink#sectionTitle_(int)
      */
     protected void startSection( String name, String anchor )
     {
-        section = section + 1;
-
-        switch ( section )
-        {
-            case 1:
-                sink.section1();
-                sink.sectionTitle1();
-                break;
-            case 2:
-                sink.section2();
-                sink.sectionTitle2();
-                break;
-            case 3:
-                sink.section3();
-                sink.sectionTitle3();
-                break;
-            case 4:
-                sink.section4();
-                sink.sectionTitle4();
-                break;
-            case 5:
-                sink.section5();
-                sink.sectionTitle5();
-                break;
-
-            default:
-                // TODO: warning - just don't start a section
-                break;
-        }
-
+        section++;
+        sink.section( section, null );
+        sink.sectionTitle( section, null );
+        sink.anchor( anchor );
         text( name );
-
-        switch ( section )
-        {
-            case 1:
-                sink.sectionTitle1_();
-                break;
-            case 2:
-                sink.sectionTitle2_();
-                break;
-            case 3:
-                sink.sectionTitle3_();
-                break;
-            case 4:
-                sink.sectionTitle4_();
-                break;
-            case 5:
-                sink.sectionTitle5_();
-                break;
-
-            default:
-                // TODO: warning - just don't start a section
-                break;
-        }
-
-        sink.anchor( HtmlTools.encodeId( anchor ) );
         sink.anchor_();
+        sink.sectionTitle_( section );
     }
 
     /**
      * Convenience method to wrap section ending in the current sink.
      *
-     * @see Sink#section1_()
-     * @see Sink#section2_()
-     * @see Sink#section3_()
-     * @see Sink#section4_()
-     * @see Sink#section5_()
+     * @see Sink#section_()
      * @throws IllegalStateException if too many closing sections.
      */
     protected void endSection()
     {
-        switch ( section )
-        {
-            case 1:
-                sink.section1_();
-                break;
-            case 2:
-                sink.section2_();
-                break;
-            case 3:
-                sink.section3_();
-                break;
-            case 4:
-                sink.section4_();
-                break;
-            case 5:
-                sink.section5_();
-                break;
-
-            default:
-                // TODO: warning - just don't start a section
-                break;
-        }
-
-        section = section - 1;
+        sink.section_( section );
+        section--;
 
         if ( section < 0 )
         {