Repository navigation
Finish plexus-utils StringUtils removal with JDK equivalents - #650
Merged
Merged
Conversation
Commit 3c63a85 migrated most StringUtils usage to JDK APIs but left a few stragglers. Use null/empty checks and String.join where the JDK provides the same behavior, and drop the now-unused imports so the plexus-utils dependency can be reduced over time.
gnodet-bot
approved these changes
Nov 18, 2026
gnodet-bot
left a comment
There was a problem hiding this comment.
LGTM. Clean, correct migration of the remaining StringUtils.isEmpty() and StringUtils.join() calls to JDK equivalents. All replacements are behaviorally equivalent — StringUtils.isEmpty() in plexus-utils resolves to (str == null) || str.isEmpty(), which is exactly what the new code does. The ModelClass.hashCode() change also improves readability by caching getPackageName() in a local variable, avoiding the double getter call.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The earlier plexus-utils migration (3c63a85) left a few
StringUtilscallsbehind. The JDK covers all of them, so finish the cleanup and drop the imports
that are now unused.
Area: production sources in modello-core, modello-maven-plugin and
modello-plugin-stax, plus one stax test helper. No behavior change.
Changes:
ModelloCli.validateNamedArguments(): replaced the twoStringUtils.isEmpty((String) parameters.get(...))checks with localvariables and null/empty checks, matching the rest of the file.
ModelClass.hashCode(): replaced!StringUtils.isEmpty(getPackageName())with an explicit null/empty check on a local variable; dropped the import.
AbstractModelloGeneratorMojo:StringUtils.join(iterator, ",")toString.join(",", packagedVersions). ThestripEndcall and its import stay.StaxSerializerGenerator:StringUtils.join(names.iterator(), ", ")toString.join(", ", names); dropped the import.AbstractStaxGeneratorTestCase:StringUtils.join(versions, ",")toString.join(",", versions); dropped the import.Verification (JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-21.jdk/Contents/Home):
mvn -B -o spotless:apply- BUILD SUCCESS, no reformatting neededmvn -B -o spotless:check- BUILD SUCCESSmvn -B -o test- BUILD SUCCESS, 178 tests run, 0 failures/errors/skipsacross all 15 reactor modules