Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Migrate from Apache commons lang2 to lang3 #6

Open
yeikel opened this issue May 9, 2022 · 4 comments
Open

Migrate from Apache commons lang2 to lang3 #6

yeikel opened this issue May 9, 2022 · 4 comments
Labels

Comments

@yeikel
Copy link

yeikel commented May 9, 2022

See https://commons.apache.org/proper/commons-lang/article3_0.html

I have seen this example in my projects :

import org.apache.commons.lang.StringUtils -> import org.apache.commons.lang3.StringUtils

But I am sure that there are many others

@pway99
Copy link
Contributor

pway99 commented Jun 17, 2022

from openrewrite/rewrite#1909

Teams often are using org.apache.commons.lang.StringUtils instead of org.apache.commons.lang3.StringUtils so I would like a recipe that migrates to commons-lang3.

I see the recipe as:

org.apache.commons.lang -> org.apache.commons.lang3
If commons-lang is present in the pom file, remove it.
If commons-lang3 is NOT present in the pom and/or dependency tree add it.

@rdifrango
Copy link

One note that StringEscapeUtils has been deprecated as of Lang 3.6 see:

https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringEscapeUtils.html

@rdifrango
Copy link

And a similar situation with org.apache.commons.lang3.text

https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/text/package-summary.html

@timtebeek
Copy link
Contributor

Weekend-Tim has been having some fun and progress with migrating other/older StringUtils classes to Commons-Lang3; that work is currently at https://github.com/timtebeek/maven-rewrite/blob/main/src/main/resources/META-INF/rewrite/string-utils.yml
Welcome to lift anything that you find valuable over to this project.

@timtebeek timtebeek transferred this issue from openrewrite/rewrite-migrate-java Mar 8, 2024
@timtebeek timtebeek moved this to Recipes Wanted in OpenRewrite Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Recipes Wanted
Development

No branches or pull requests

4 participants