Migrate Commons Lang 2 to 3 using API plugins#174
Closed
alecharp wants to merge 2 commits intojenkinsci:masterfrom
Closed
Migrate Commons Lang 2 to 3 using API plugins#174alecharp wants to merge 2 commits intojenkinsci:masterfrom
alecharp wants to merge 2 commits intojenkinsci:masterfrom
Conversation
jtnord
approved these changes
Jan 15, 2026
Member
jtnord
left a comment
There was a problem hiding this comment.
StringUtils could be removed as it is a few uses that are trivial to do in Java 17
commons-text has a dependency on commons-lang3 in any case 🤷
src/test/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStepTest.java
Outdated
Show resolved
Hide resolved
Text blocks were added to Java in version 15
jtnord
approved these changes
Jan 15, 2026
jglick
reviewed
Jan 15, 2026
Member
jglick
left a comment
There was a problem hiding this comment.
-0 I guess. Let me see if I can fix this up properly.
| import java.util.HashSet; | ||
| import java.util.Set; | ||
| import org.apache.commons.lang.StringUtils; | ||
| import org.apache.commons.lang3.StringUtils; |
Member
There was a problem hiding this comment.
An example of a completely gratuitous use of StringUtils that would better be replaced with a simpler idiom using only types defined in the Java Platform.
| final String context = getContext(); | ||
| //Functions.jsStringEscape() is also an alternative though the one below escapes more stuff | ||
| return context != null ? StringEscapeUtils.escapeJavaScript(context) : null; | ||
| return context != null ? StringEscapeUtils.escapeEcmaScript(context) : null; |
Member
There was a problem hiding this comment.
data-* attributes idiomatically, in which case we should not need either of these lib deps.
jglick
requested changes
Jan 15, 2026
Comment on lines
+60
to
+67
| <dependency> | ||
| <groupId>io.jenkins.plugins</groupId> | ||
| <artifactId>commons-lang3-api</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.jenkins.plugins</groupId> | ||
| <artifactId>commons-text-api</artifactId> | ||
| </dependency> |
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 plugin is using Commons Lang 2.6 library, implied because packaged in Jenkins Core. This might not continue (jenkinsci/jenkins#26105).
This pull request migrate the code to use Commons Lang 3 and Commons Text libraries.
Testing done
I ran
mvn verifylocallySubmitter checklist