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-changes-plugin.git
commit e7de6901afac59756b1513a1c58884090c67898a Author: Sylwester Lachiewicz <[email protected]> AuthorDate: Tue Nov 17 05:38:57 2026 +0000 Replace remaining StringUtils and Commons calls with the JDK --- .../apache/maven/plugins/changes/ChangesCheckMojo.java | 7 +++---- .../maven/plugins/changes/ChangesReportRenderer.java | 18 +++++++++--------- .../maven/plugins/changes/jira/JiraChangesReport.java | 3 +-- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/changes/ChangesCheckMojo.java b/src/main/java/org/apache/maven/plugins/changes/ChangesCheckMojo.java index 8216317..c66aaee 100644 --- a/src/main/java/org/apache/maven/plugins/changes/ChangesCheckMojo.java +++ b/src/main/java/org/apache/maven/plugins/changes/ChangesCheckMojo.java @@ -23,7 +23,6 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Locale; -import org.apache.commons.lang3.StringUtils; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; @@ -120,18 +119,18 @@ public class ChangesCheckMojo extends AbstractChangesMojo { * @return <code>true</code> if the string can be parsed as a date using the pattern, otherwise <code>false</code> */ protected static boolean isValidDate(String string, String pattern, String locale) { - if (StringUtils.isEmpty(string)) { + if (string == null || string.isEmpty()) { return false; } - if (StringUtils.isEmpty(pattern)) { + if (pattern == null || pattern.isEmpty()) { return false; } try { Locale usedLocale = null; - if (StringUtils.isEmpty(locale)) { + if (locale == null || locale.isEmpty()) { // No locale specified, use the default locale as default value // The same behavior as before the locale parameter was added usedLocale = Locale.getDefault(); diff --git a/src/main/java/org/apache/maven/plugins/changes/ChangesReportRenderer.java b/src/main/java/org/apache/maven/plugins/changes/ChangesReportRenderer.java index ac5511f..39db033 100644 --- a/src/main/java/org/apache/maven/plugins/changes/ChangesReportRenderer.java +++ b/src/main/java/org/apache/maven/plugins/changes/ChangesReportRenderer.java @@ -165,14 +165,14 @@ public class ChangesReportRenderer extends AbstractIssuesReportRenderer { String actionDescription = action.getAction(); - if (escapeText || StringUtils.isEmpty(actionDescription)) { + if (escapeText || (actionDescription == null || actionDescription.isEmpty())) { text(actionDescription); } else { sink.rawText(actionDescription); } // no null check needed classes from modello return a new ArrayList - if (StringUtils.isNotEmpty(action.getIssue()) + if ((action.getIssue() != null && !action.getIssue().isEmpty()) || (!action.getFixedIssues().isEmpty())) { if (StringUtils.isNotBlank(actionDescription) && !actionDescription.endsWith(".")) { text("."); @@ -182,11 +182,11 @@ public class ChangesReportRenderer extends AbstractIssuesReportRenderer { // Try to get the issue management system specified in the changes.xml file String system = action.getSystem(); // Try to get the issue management system configured in the POM - if (StringUtils.isEmpty(system)) { + if (system == null || system.isEmpty()) { system = this.system; } // Use the default issue management system - if (StringUtils.isEmpty(system)) { + if (system == null || system.isEmpty()) { system = DEFAULT_ISSUE_SYSTEM_KEY; } if (!canGenerateIssueLinks(system)) { @@ -228,7 +228,7 @@ public class ChangesReportRenderer extends AbstractIssuesReportRenderer { for (DueTo dueTo : action.getDueTos()) { i++; - if (StringUtils.isNotEmpty(dueTo.getEmail())) { + if (dueTo.getEmail() != null && !dueTo.getEmail().isEmpty()) { String text = dueTo.getName(); link("mailto:" + dueTo.getEmail(), text); } else { @@ -251,7 +251,7 @@ public class ChangesReportRenderer extends AbstractIssuesReportRenderer { * @param fixes The List of issues specified as fixes elements */ private void constructIssueLink(String issue, String system, List<String> fixes) { - if (StringUtils.isNotEmpty(issue)) { + if (issue != null && !issue.isEmpty()) { link(parseIssueLink(issue, system), issue); if (!fixes.isEmpty()) { text(", "); @@ -260,7 +260,7 @@ public class ChangesReportRenderer extends AbstractIssuesReportRenderer { for (Iterator<String> iterator = fixes.iterator(); iterator.hasNext(); ) { String currentIssueId = iterator.next(); - if (StringUtils.isNotEmpty(currentIssueId)) { + if (currentIssueId != null && !currentIssueId.isEmpty()) { link(parseIssueLink(currentIssueId, system), currentIssueId); } @@ -277,7 +277,7 @@ public class ChangesReportRenderer extends AbstractIssuesReportRenderer { * @param fixes The List of issues specified as fixes elements */ private void constructIssueText(String issue, List<String> fixes) { - if (StringUtils.isNotEmpty(issue)) { + if (issue != null && !issue.isEmpty()) { text(issue); if (!fixes.isEmpty()) { @@ -287,7 +287,7 @@ public class ChangesReportRenderer extends AbstractIssuesReportRenderer { for (Iterator<String> iterator = fixes.iterator(); iterator.hasNext(); ) { String currentIssueId = iterator.next(); - if (StringUtils.isNotEmpty(currentIssueId)) { + if (currentIssueId != null && !currentIssueId.isEmpty()) { text(currentIssueId); } diff --git a/src/main/java/org/apache/maven/plugins/changes/jira/JiraChangesReport.java b/src/main/java/org/apache/maven/plugins/changes/jira/JiraChangesReport.java index 0fcb91b..2c02429 100644 --- a/src/main/java/org/apache/maven/plugins/changes/jira/JiraChangesReport.java +++ b/src/main/java/org/apache/maven/plugins/changes/jira/JiraChangesReport.java @@ -26,7 +26,6 @@ import java.util.Locale; import java.util.Map; import java.util.ResourceBundle; -import org.apache.commons.lang3.StringUtils; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.changes.AbstractChangesReport; @@ -340,7 +339,7 @@ public class JiraChangesReport extends AbstractChangesReport { List<Issue> issueList = issueDownloader.getIssueList(); - if (StringUtils.isNotEmpty(versionPrefix)) { + if (versionPrefix != null && !versionPrefix.isEmpty()) { int originalNumberOfIssues = issueList.size(); issueList = IssueUtils.filterIssuesWithVersionPrefix(issueList, versionPrefix); getLog().debug("Filtered out " + issueList.size() + " issues of " + originalNumberOfIssues
