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 2020/08/30 17:24:06 UTC

[maven-project-info-reports-plugin] branch master updated: [MPIR-398] Non-sense links created for mailing lists when mailto is empty

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

michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-project-info-reports-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 8abd4d0  [MPIR-398] Non-sense links created for mailing lists when mailto is empty
8abd4d0 is described below

commit 8abd4d06405241c2f7b01d25d570c72ed67ebe4b
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sun Aug 30 19:21:06 2020 +0200

    [MPIR-398] Non-sense links created for mailing lists when mailto is empty
---
 .../report/projectinfo/MailingListsReport.java     | 39 ++++++++++++++++++----
 1 file changed, 33 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java b/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java
index 5c3336e..33518e7 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java
@@ -157,16 +157,43 @@ public class MailingListsReport
             {
                 List<String> textRow = new ArrayList<>();
 
-                // Validate here subsribe/unsubsribe lists and archives?
-                textRow.add( mailingList.getName() );
+                if ( StringUtils.isNotEmpty( mailingList.getName() ) )
+                {
+                    textRow.add( mailingList.getName() );
+                }
+                else
+                {
+                    textRow.add( "-" );
+                }
 
-                textRow.add( createEmailLinkPatternedText( subscribe, mailingList.getSubscribe(), null ) );
+                if ( StringUtils.isNotEmpty( mailingList.getSubscribe() ) )
+                {
+                    textRow.add( createEmailLinkPatternedText( subscribe, mailingList.getSubscribe(), null ) );
+                }
+                else
+                {
+                    textRow.add( "-" );
+                }
 
-                textRow.add( createEmailLinkPatternedText( unsubscribe, mailingList.getUnsubscribe(), null ) );
+                if ( StringUtils.isNotEmpty( mailingList.getUnsubscribe() ) )
+                {
+                    textRow.add( createEmailLinkPatternedText( unsubscribe, mailingList.getUnsubscribe(), null ) );
+                }
+                else
+                {
+                    textRow.add( "-" );
+                }
 
-                textRow.add( createEmailLinkPatternedText( post, mailingList.getPost(), "-" ) );
+                if ( StringUtils.isNotEmpty( mailingList.getPost() ) )
+                {
+                    textRow.add( createEmailLinkPatternedText( post, mailingList.getPost(), null ) );
+                }
+                else
+                {
+                    textRow.add( "-" );
+                }
 
-                if ( mailingList.getArchive() != null && mailingList.getArchive().length() > 0 )
+                if ( mailingList.getArchive() != null && !mailingList.getArchive().isEmpty() )
                 {
                     textRow.add( createLinkPatternedText(
                             ProjectInfoReportUtils.getArchiveServer( mailingList.getArchive() ),