I am wondering what is the difference between Apache Commons Lang3 (org.apache.commons.lang3
) vs Apache Commons Text (org.apache.commons.text
)?
I saw many similarities between them.
For intance, they both have StringEscapeUtils
:
But I also saw many differences.
So which one should I use, Lang3 or Text?
Or what are the common use cases for each of these two?
Description. org.apache.commons.lang3. Provides highly reusable static utility methods, chiefly concerned with adding value to the java. lang classes.
Apache Commons Text is an open source Java library designed for working with strings. Alvaro Munoz, a researcher at GitHub's Security Lab, discovered in March that the library is affected by an arbitrary code execution vulnerability related to untrusted data processing and variable interpolation.
The Apache Commons is a project of the Apache Software Foundation, formerly under the Jakarta Project. The purpose of the Commons is to provide reusable, open source Java software. The Commons is composed of three parts: proper, sandbox, and dormant.
StringEscapeUtils is a utility class which escapes and unescapes String for Java, JavaScript, HTML, XML, and SQL. For example, @Test. public void test_StringEscapeUtils() { assertEquals("\\\\\\n\\t\\r", StringEscapeUtils.escapeJava("\\\n\t\r")); // escapes the Java String.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With