Skip to content

Migrate Commons Lang from 2 to 3 and StringEscapeUtils to Commons Text#118

Open
gounthar wants to merge 1 commit intojenkinsci:masterfrom
gounthar:plugin-modernizer/migratecommonslang2tolang3andcommontext
Open

Migrate Commons Lang from 2 to 3 and StringEscapeUtils to Commons Text#118
gounthar wants to merge 1 commit intojenkinsci:masterfrom
gounthar:plugin-modernizer/migratecommonslang2tolang3andcommontext

Conversation

@gounthar
Copy link
Contributor

@gounthar gounthar commented Sep 9, 2025

Hello command-launcher developers! 👋

This is an automated pull request created by the Jenkins Plugin Modernizer tool. The tool has applied the following recipes to modernize the plugin:

Migrate Commons Lang from 2 to 3 and StringEscapeUtils to Commons Text

io.jenkins.tools.pluginmodernizer.MigrateCommonsLang2ToLang3AndCommonText

Migrate Commons Lang from 2 to 3 and StringEscapeUtils to Commons Text.

This pull request upgrades Apache Commons Lang 2 to Apache Commons Lang 3 and migrates HTML escaping functionality from Apache Commons Lang to Apache Commons Text.
The Apache Commons community recommends using Apache Commons Text for string escaping operations, as it offers a more focused and feature-rich API for text processing.

What's Changed?

  • Migrated from deprecated/EOL Apache Commons Lang 2 to Commons Lang 3.
  • Transitioned from deprecated/EOL StringEscapeUtils in Apache Commons Lang to Commons Text.


import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
Copy link
Member

Choose a reason for hiding this comment

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

boolean approveIfAdmin = !StringUtils.equals(oldCommand, instance.command);
better replaced with Objects.equals

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

-0

import jenkins.model.Jenkins;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
Copy link
Member

Choose a reason for hiding this comment

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

pb.environment().put("WORKSPACE", StringUtils.defaultString(computer.getAbsoluteRemoteFs(), node.getRemoteFS())); //path for local agent log
etc. better replaced with simple Java Platform equivalents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants