You can have both Lang2 and Lang3 in your classpath. Due to incompatibility of Lang2 and Lang3, the package is intentionally changed from org.apache.commons.lang to org.apache.commons.lang3 so that you can have both version in classpath without conflict
Well, the text method states
This code has been adapted from Apache Commons Lang 3.5.
Looks like they simply plan on moving the method from one library to the other. You'd have to get the authors of that code to explain why.
However, worth pointing out that lang3 is a compile dependency of text, therefore if you included text, you would have lang3 anyway
https://github.com/apache/commons-text/blob/master/pom.xml#L61-L65
Text utils in commons-lang3 are marked with deprecation and the Javadoc points to commons-text
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
As of time of this answer, 3.4 is the latest stable version. Version 3.5 is actually 3.5-SNAPSHOT. You can see that indicated in top right of the website, and the javadoc is generated off the source tree. You can see that master branch is currently set to 3.5-SNAPSHOT here:
- https://github.com/apache/commons-lang/blob/master/pom.xml
3.5 Should be the latest now, last published back in October 2016.
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.5</version>
</dependency>