The class was moved from package

org.apache.commons.lang3

to

org.apache.commons.text

You can replace the deprecated library easily:

In your build.gradle:

implementation 'org.apache.commons:commons-text:1.11.0'

And in your class using StringEscapeUtils make sure you import the correct class:

import org.apache.commons.text.StringEscapeUtils;

1.11.0 is currently the newest version (last checked February 20th 2024) but you can check the versions at maven: https://mvnrepository.com/artifact/org.apache.commons/commons-text

Answer from Björn Kechel on Stack Overflow
🌐
Spring
docs.spring.io › spring-framework › docs › current › javadoc-api › org › springframework › util › StringUtils.html
StringUtils (Spring Framework 7.0.5 API)
public StringUtils() @Deprecated(since="5.3") @Contract("null -> true") public static boolean isEmpty · (@Nullable Object str) Deprecated. in favor of hasLength(String) and hasText(String) (or ObjectUtils.isEmpty(Object)) Check whether the given object (possibly a String) is empty.
🌐
GitHub
github.com › DSpace › DSpace › issues › 11162
org.apache.commons.lang3.StringUtils has some deprecated methods · Issue #11162 · DSpace/DSpace
August 15, 2025 - [WARNING] dspace-api/src/main/java/org/dspace/eperson/Group.java:[202,24] [deprecation] equals(CharSequence,CharSequence) in StringUtils has been deprecated [WARNING] dspace-api/src/main/java/org/dspace/access/status/AccessStatusServiceImpl.java:[95,24] [deprecation] equalsIgnoreCase(CharSequence,CharSequence) in StringUtils has been deprecated [WARNING] dspace-api/src/main/java/org/dspace/app/bulkaccesscontrol/BulkAccessControl.java:[238,32] [deprecation] equalsAny(CharSequence,CharSequence...) in StringUtils has been deprecated [WARNING] dspace-api/src/main/java/org/dspace/app/bulkedit/DSpac
Published   Aug 15, 2025
🌐
GitHub
github.com › spring-cloud › spring-cloud-zookeeper › issues › 274
Replace usage of deprecated StringUtils.isEmpty with !StringUtils.hasLength · Issue #274 · spring-cloud/spring-cloud-zookeeper
December 4, 2020 - As of Spring 5.3 StringUtils.isEmpty is deprecated. The official migration hint is to either use one of the following: !StringUtils.hasLength !StringUtils.hasText To keep behaviour exactly the way it is, !StringUtils.hasLength can be use...
Published   Dec 04, 2020
🌐
Apache Commons
commons.apache.org › proper › commons-lang › apidocs › deprecated-list.html
Deprecated List (Apache Commons Lang 3.20.0 API)
Use StringUtils.toEncodedString(byte[], Charset) instead of String constants in your code. org.apache.commons.lang3.SystemProperties.getAwtToolkit() Deprecated without replacement. org.apache.commons.lang3.SystemProperties.getJavaAwtFonts() Deprecated without replacement.
🌐
Reddit
reddit.com › r/java › look how they massacred my boy (apache commons lang)
r/java on Reddit: Look how they massacred my boy (Apache Commons Lang)
August 21, 2025 -

Seriously, what madness drove the commons lang contributors to deprecate StringUtils.equals()?

I'm gonna rant for a bit here. It's been a long day.

I spend all morning in an incident call, finally get time to do some coding in the afternoon.

I make progress on a bug fix, clean up some dead code like a good boy scout, and I’m feeling like I actually accomplished something today.

Oh, this service is getting flagged for CVE-2025-48924? Let me take care of that.

And then, confusion. Anger.

Deprecated method? StringUtils.equals()? That can't be.

Sure as shit, they deprecated it. Let's see what has been replaced with.

Strings.CS.equals()? Is that character sequence? No, it's case sensitive. Fucking hell. I harp on juniors for their silly acronyms. Did not expect to see them in a library like this. Just unnecessary. If Java developers had a problem with verbosity, well, they wouldn't be Java developers.

I'll admit I've been an open-source leech, contributing nothing to the community, but this one has lit a fire in me.

If this issue isn't resolved, are there any volunteers to help with a fork? I feel like common-sense-lang3 would be an appropriate name for an alternative.

https://issues.apache.org/jira/projects/LANG/issues/LANG-1777?filter=allopenissues

Find elsewhere
🌐
Apache Commons
commons.apache.org › proper › commons-lang › javadocs › api-release › org › apache › commons › lang3 › StringUtils.html
StringUtils (Apache Commons Lang 3.11 API)
Deprecated. as of 3.6, use commons-text FuzzyScore instead · Find the Fuzzy Distance which indicates the similarity score between two Strings. This string matching algorithm is similar to the algorithms of editors such as Sublime Text, TextMate, Atom and others. One point is given for every matched character. Subsequent matches yield two bonus points. A higher score indicates a higher similarity. StringUtils...
🌐
GitHub
github.com › terasolunaorg › terasoluna-gfw › issues › 1015
[Spring 5.3.0] StringUtils#isEmpty has bean deprecated · Issue #1015 · terasolunaorg/terasoluna-gfw
November 2, 2020 - Description Part of #989 Starting with Spring 5.3.0, StringUtils#isEmpty has been deprecated. Issues: spring-projects/spring-framework#25945 Commit: spring-projects/spring-framework@621295d Possible Solution Replace. from org.springframe...
Published   Nov 02, 2020
🌐
GitHub
github.com › eclipse-che4z › che-che4z-lsp-for-cobol › issues › 112
Replace Usage of Deprecated Method StringUtils.getLevenshteinDistance · Issue #112 · eclipse-che4z/che-che4z-lsp-for-cobol
December 16, 2019 - Description There is a usage of a deprecated method StringUtils#getLevenshteinDistance() in CobolVisitor. It is recommended to replace it with LevensteinDistance of Apache commons-text. Technical details TPSR verification is required.
Published   Dec 16, 2019
🌐
XWiki
forum.xwiki.org › development
How to deal with commons-lang3 recent upgrade? - Development - XWiki Forum
July 15, 2025 - Quite a few StringUtils APIs have been deprecated in favor of using a new Strings.CI or Strings.CS (CI for Case Insensitive and respectively CS for Case Sensitive) singleton instance with those methods.
🌐
BytePlus
byteplus.com › en › topic › 513224
Stringutils.isempty deprecated
Build better products, deliver richer experiences, and accelerate growth through our wide range of intelligent solutions. Core content of this page: Stringutils.isempty deprecated
🌐
Apache Commons
commons.apache.org › proper › commons-lang › javadocs › api-2.6 › org › apache › commons › lang › StringUtils.html
StringUtils (Commons Lang 2.6 API)
StringUtils.isNotBlank(null) = false StringUtils.isNotBlank("") = false StringUtils.isNotBlank(" ") = false StringUtils.isNotBlank("bob") = true StringUtils.isNotBlank(" bob ") = true ... Deprecated. Use the clearer named trimToEmpty(String).
🌐
SAP
help.sap.com › doc › javadocs_nw73_sps07 › 7.3.7 › en-US › EP › com › sapportals › portal › prt › util › StringUtils.html
StringUtils
Deprecated. Use the class XSSEncoder instead ... StringUtils is a collection of String utilities in the web environment.
🌐
Apache Commons
commons.apache.org › proper › commons-lang › javadocs › api-3.9 › deprecated-list.html
Deprecated List (Apache Commons Lang 3.9 API)
Deprecated · Index · Help · Prev · Next · Frames · No Frames · All Classes · Deprecated Packages · Deprecated Interfaces · Deprecated Classes · Deprecated Fields · Deprecated Methods · Deprecated Enum Constants · Skip navigation links · Overview · Package ·