You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2024/11/22 12:39:58 UTC
(maven-changes-plugin) branch MCHANGES-420 created (now ce9b0b1)
This is an automated email from the ASF dual-hosted git repository.
elharo pushed a change to branch MCHANGES-420
in repository https://gitbox.apache.org/repos/asf/maven-changes-plugin.git
at ce9b0b1 [MCHANGES-420] no issues is not exceptional
This branch includes the following new commits:
new ce9b0b1 [MCHANGES-420] no issues is not exceptional
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.
(maven-changes-plugin) 01/01: [MCHANGES-420] no issues is not exceptional
Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch MCHANGES-420
in repository https://gitbox.apache.org/repos/asf/maven-changes-plugin.git
commit ce9b0b128e4132775997d13fd6cfd36d36f2d55a
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Fri Nov 22 07:39:47 2024 -0500
[MCHANGES-420] no issues is not exceptional
---
.../apache/maven/plugins/issues/IssueUtils.java | 22 ++++++----------------
1 file changed, 6 insertions(+), 16 deletions(-)
diff --git a/src/main/java/org/apache/maven/plugins/issues/IssueUtils.java b/src/main/java/org/apache/maven/plugins/issues/IssueUtils.java
index 4c10366..f7396a5 100644
--- a/src/main/java/org/apache/maven/plugins/issues/IssueUtils.java
+++ b/src/main/java/org/apache/maven/plugins/issues/IssueUtils.java
@@ -69,19 +69,16 @@ public class IssueUtils {
}
/**
- * Find the issues for only the supplied version, by matching the "Fix for" version in the supplied list of issues
+ * Find the issues for the supplied version, by matching the "Fix for" version in the supplied list of issues
* with the supplied version. If the supplied version is a SNAPSHOT, then that part of the version will be removed
* prior to the matching.
*
- * @param issues A list of issues
- * @param version The version that issues should be returned for
- * @return A <code>List</code> of issues for the supplied version
- * @throws org.apache.maven.plugin.MojoExecutionException If no issues could be found for the supplied version
+ * @param issues a list of issues
+ * @param version the version that issues should be returned for
+ * @return a <code>List</code> of issues for the supplied version, possibly empty if there are no issues
*/
- public static List<Issue> getIssuesForVersion(List<Issue> issues, String version) throws MojoExecutionException {
+ public static List<Issue> getIssuesForVersion(List<Issue> issues, String version) {
List<Issue> issuesForVersion = new ArrayList<>();
- boolean isFound = false;
- Issue issue;
String releaseVersion = version;
// Remove "-SNAPSHOT" from the end of the version, if it's there
@@ -89,19 +86,12 @@ public class IssueUtils {
releaseVersion = version.substring(0, version.length() - SNAPSHOT_SUFFIX.length());
}
- for (Issue issue1 : issues) {
- issue = issue1;
-
+ for (Issue issue : issues) {
if (issue.getFixVersions() != null && issue.getFixVersions().contains(releaseVersion)) {
- isFound = true;
issuesForVersion.add(issue);
}
}
- if (!isFound) {
- throw new MojoExecutionException("Couldn't find any issues for the version '" + releaseVersion
- + "' among the supplied issues: " + toString(issues));
- }
return issuesForVersion;
}