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

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-changelog-plugin.git

commit 79c52649bc12d84d39dd28bedf226706f2bd2948
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Tue Nov 17 05:29:56 2026 +0000

    Simplify redundant code
---
 .../apache/maven/plugins/changelog/ChangeLogReport.java  | 16 +++++++++-------
 .../maven/plugins/changelog/FileActivityReport.java      |  2 +-
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git 
a/src/main/java/org/apache/maven/plugins/changelog/ChangeLogReport.java 
b/src/main/java/org/apache/maven/plugins/changelog/ChangeLogReport.java
index 3c8fec1..49c23e2 100644
--- a/src/main/java/org/apache/maven/plugins/changelog/ChangeLogReport.java
+++ b/src/main/java/org/apache/maven/plugins/changelog/ChangeLogReport.java
@@ -380,7 +380,9 @@ public class ChangeLogReport extends AbstractMavenReport {
     private Map<String, String> providerImplementations;
 
     // temporary field holder while generating the report
-    private String rptRepository, rptOneRepoParam, rptMultiRepoParam;
+    private String rptRepository;
+    private String rptOneRepoParam;
+    private String rptMultiRepoParam;
 
     // field for SCM Connection URL
     private String connection;
@@ -1273,7 +1275,7 @@ public class ChangeLogReport extends AbstractMavenReport {
 
             String link;
 
-            if (issueLinkUrl.indexOf(ISSUE_TOKEN) > 0) {
+            if (issueLinkUrl.indexOf(ISSUE_TOKEN) >= 1) {
                 link = issueLinkUrl.replaceAll(ISSUE_TOKEN, match);
             } else {
                 if (issueLinkUrl.endsWith("/")) {
@@ -1427,7 +1429,7 @@ public class ChangeLogReport extends AbstractMavenReport {
 
                 // Use the given URL to create links to the files
 
-                if (linkFile.indexOf(FILE_TOKEN) > 0) {
+                if (linkFile.indexOf(FILE_TOKEN) >= 1) {
                     linkFile = linkFile.replaceAll(FILE_TOKEN, linkName);
                 } else {
                     // This is here so that we are backwards compatible with 
the
@@ -1438,7 +1440,7 @@ public class ChangeLogReport extends AbstractMavenReport {
 
                 // Use the given URL to create links to the files
 
-                if (revision != null && linkFile.indexOf(REV_TOKEN) > 0) {
+                if (revision != null && linkFile.indexOf(REV_TOKEN) >= 1) {
                     linkFile = linkFile.replaceAll(REV_TOKEN, revision);
                 }
             } else if (connection.startsWith("scm:perforce")) {
@@ -1450,7 +1452,7 @@ public class ChangeLogReport extends AbstractMavenReport {
             } else if (connection.startsWith("scm:clearcase")) {
                 String path = getAbsolutePath(displayFileDetailUrl, name);
                 linkFile = path + rptOneRepoParam;
-            } else if (connection.indexOf("cvsmonitor.pl") > 0) {
+            } else if (connection.indexOf("cvsmonitor.pl") >= 1) {
                 Pattern cvsMonitorRegex = 
Pattern.compile("^.*(&amp;module=.*?(?:&amp;|$)).*$");
                 String module = 
cvsMonitorRegex.matcher(rptOneRepoParam).replaceAll("$1");
                 linkFile = displayFileDetailUrl + "?cmd=viewBrowseFile" + 
module + "&file=" + name;
@@ -1478,7 +1480,7 @@ public class ChangeLogReport extends AbstractMavenReport {
         sink.text(" ");
 
         if (linkRev == null && revision != null && displayChangeSetDetailUrl 
!= null) {
-            if (displayChangeSetDetailUrl.indexOf(REV_TOKEN) > 0) {
+            if (displayChangeSetDetailUrl.indexOf(REV_TOKEN) >= 1) {
                 linkRev = displayChangeSetDetailUrl.replaceAll(REV_TOKEN, 
revision);
             } else {
                 linkRev = displayChangeSetDetailUrl + revision;
@@ -1576,7 +1578,7 @@ public class ChangeLogReport extends AbstractMavenReport {
      * @return The effective reporting output file encoding, never 
<code>null</code>.
      */
     protected String getOutputEncoding() {
-        return (outputEncoding != null) ? outputEncoding : "UTF-8";
+        return outputEncoding != null ? outputEncoding : "UTF-8";
     }
 
     /**
diff --git 
a/src/main/java/org/apache/maven/plugins/changelog/FileActivityReport.java 
b/src/main/java/org/apache/maven/plugins/changelog/FileActivityReport.java
index f0c62f4..94c7834 100644
--- a/src/main/java/org/apache/maven/plugins/changelog/FileActivityReport.java
+++ b/src/main/java/org/apache/maven/plugins/changelog/FileActivityReport.java
@@ -196,7 +196,7 @@ public class FileActivityReport extends ChangeLogReport {
             sink.tableCell_();
 
             sink.tableCell();
-            sink.text("" + revision.size());
+            sink.text(String.valueOf(revision.size()));
 
             sink.tableCell_();
             sink.tableRow_();

Reply via email to