[MNG-6829] Replace StringUtils#isEmpty(String) & #isNotEmpty(String) by timtebeek · Pull Request #58 · apache/maven-install-plugin (original) (raw)

@timtebeek

@timtebeek @TeamModerne

@timtebeek

@elharo I notice that my commit message didn't make it into the created pull request message, so you might not be aware of some of these last open pull requests. Would you mind going through this last batch?

Last batch of is(Not)Empty for https://issues.apache.org/jira/browse/MNG-6829
These are the smallest change sets, hence why I opened more at the same time.
After this we can target the next most often used method from the StringUtils classes.

elharo

if (artifactType != null
&& StringUtils.isEmpty(classifier)
&& (classifier == null |
&& !StringUtils.isEmpty(artifactType.getClassifier())) {

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

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.

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.

@timtebeek timtebeek deleted the refactor/replace-any-string-utils-is-empty-string-and-is-not-empty-string branch

June 1, 2023 10:59

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})