Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[MNG-6829] Replace StringUtils#isEmpty(String) & #isNotEmpty(String) #58

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
ArtifactType artifactType =
repositorySystemSession.getArtifactTypeRegistry().get(packaging);
if (artifactType != null
&& StringUtils.isEmpty(classifier)
&& (classifier == null || classifier.isEmpty())
&& !StringUtils.isEmpty(artifactType.getClassifier())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed it missed one in line 222

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's surprising! Usually when that happens there's some missing type attribution; I'll do a final sweep to see if it pops up again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this again: the line was not missed, but intentionally left out in the recipe, as we can't be certain that the argument method invocation is safe to call twice; once for the null check, and again for the isEmpty call. Hence why I don't convert those automatically yet, even though in this case it's probably safe to do.

classifier = artifactType.getClassifier();
}
Expand Down