gnodet commented on code in PR #481:
URL: https://github.com/apache/maven-jar-plugin/pull/481#discussion_r2438364831
##########
src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java:
##########
@@ -344,10 +331,11 @@ private boolean projectHasAlreadySetAnArtifact() {
/**
* Return {@code true} in case where the classifier is not {@code null}
and contains something else than white spaces.
*
- * @return {@code true} if the classifier is set.
+ * @param classifier the classifier to verify
+ * @return {@code true} if the classifier is set
*/
- protected boolean hasClassifier() {
- return getClassifier() != null && !getClassifier().trim().isEmpty();
+ private static boolean hasClassifier(String classifier) {
+ return classifier != null && !classifier.isBlank();
Review Comment:
Keep isEmpty, as blank classifiers are not rejected by maven yet.
##########
src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java:
##########
@@ -344,10 +331,11 @@ private boolean projectHasAlreadySetAnArtifact() {
/**
* Return {@code true} in case where the classifier is not {@code null}
and contains something else than white spaces.
*
- * @return {@code true} if the classifier is set.
+ * @param classifier the classifier to verify
+ * @return {@code true} if the classifier is set
*/
- protected boolean hasClassifier() {
- return getClassifier() != null && !getClassifier().trim().isEmpty();
+ private static boolean hasClassifier(String classifier) {
+ return classifier != null && !classifier.isBlank();
Review Comment:
Mmh, I missed the trim.
So fine...
--
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]