Copilot commented on code in PR #157:
URL:
https://github.com/apache/maven-jarsigner-plugin/pull/157#discussion_r3645463647
##########
src/main/java/org/apache/maven/plugins/jarsigner/AbstractJarsignerMojo.java:
##########
@@ -334,8 +334,8 @@ private List<File> findJarfiles() throws
MojoExecutionException {
}
if (archiveDirectory != null) {
- String includeList = (includes != null) ?
StringUtils.join(includes, ",") : null;
- String excludeList = (excludes != null) ?
StringUtils.join(excludes, ",") : null;
+ String includeList = (includes != null) ? String.join(",",
includes) : null;
+ String excludeList = (excludes != null) ? String.join(",",
excludes) : null;
Review Comment:
`String.join` throws a `NullPointerException` if any element inside
`includes`/`excludes` is `null`, whereas `StringUtils.join(Object[], String)`
would not (it effectively skips/omits null elements). This is a behavior change
that can surface as a runtime failure when users provide plugin configuration
with accidental null entries. Consider filtering out nulls before joining
(e.g., stream + `filter(Objects::nonNull)` + `Collectors.joining(\",\")`) or
normalizing null elements to an empty string prior to calling `String.join`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]