# Deprecated API

## Contents

- Deprecated Packages
- Deprecated Interfaces
- Deprecated Classes
- Deprecated Fields
- Deprecated Methods
- Deprecated Constructors
- Deprecated Enum Constants

- Deprecated Packages
  Package and Description
  org.apache.commons.lang3.text As of 3.6, use the Apache Commons Text text package.
  org.apache.commons.lang3.text.translate As of 3.6, use the Apache Commons Text translate package.

- Deprecated Interfaces
  Interface and Description
  org.apache.commons.lang3.text.FormatFactory As of 3.6, use Apache Commons Text FormatFactory instead
  org.apache.commons.lang3.Functions.FailableBiConsumer Use `FailableBiConsumer`.
  org.apache.commons.lang3.Functions.FailableBiFunction Use `FailableBiFunction`.
  org.apache.commons.lang3.Functions.FailableBiPredicate Use `FailableBiPredicate`.
  org.apache.commons.lang3.Functions.FailableCallable Use `FailableCallable`.
  org.apache.commons.lang3.Functions.FailableConsumer Use `FailableConsumer`.
  org.apache.commons.lang3.Functions.FailableFunction Use `FailableFunction`.
  org.apache.commons.lang3.Functions.FailablePredicate Use `FailablePredicate`.
  org.apache.commons.lang3.Functions.FailableRunnable Use `FailableRunnable`.
  org.apache.commons.lang3.Functions.FailableSupplier Use `FailableSupplier`.
  org.apache.commons.lang3.ThreadUtils.ThreadGroupPredicate Use a `Predicate`.
  org.apache.commons.lang3.ThreadUtils.ThreadPredicate Use a `Predicate`.

- Deprecated Classes
  Class and Description
  org.apache.commons.lang3.text.translate.AggregateTranslator As of 3.6, use Apache Commons Text AggregateTranslator instead
  org.apache.commons.lang3.CharEncoding Java 7 introduced `StandardCharsets`, which defines these constants as `Charset` objects. Use `Charset.name()` to get the string values provided in this class. This class will be removed in a future release.
  org.apache.commons.lang3.text.translate.CharSequenceTranslator As of 3.6, use Apache Commons Text CharSequenceTranslator instead
  org.apache.commons.lang3.text.translate.CodePointTranslator As of 3.6, use Apache Commons Text CharSequenceTranslator instead
  org.apache.commons.lang3.text.CompositeFormat As of 3.6, use Apache Commons Text CompositeFormat instead
  org.apache.commons.lang3.text.translate.EntityArrays As of 3.6, use Apache Commons Text EntityArrays instead
  org.apache.commons.lang3.text.ExtendedMessageFormat As of 3.6, use Apache Commons Text ExtendedMessageFormat instead
  org.apache.commons.lang3.text.FormattableUtils As of 3.6, use Apache Commons Text FormattableUtils instead
  org.apache.commons.lang3.Functions Use `Failable`.
  org.apache.commons.lang3.text.translate.JavaUnicodeEscaper As of 3.6, use Apache Commons Text UnicodeEscaper instead
  org.apache.commons.lang3.text.translate.LookupTranslator As of 3.6, use Apache Commons Text LookupTranslator instead
  org.apache.commons.lang3.text.translate.NumericEntityEscaper As of 3.6, use Apache Commons Text NumericEntityEscaper instead
  org.apache.commons.lang3.text.translate.NumericEntityUnescaper As of 3.6, use Apache Commons Text NumericEntityUnescaper instead
  org.apache.commons.lang3.text.translate.OctalUnescaper As of 3.6, use Apache Commons Text OctalUnescaper instead
  org.apache.commons.lang3.RandomUtils Use Apache Commons RNG's optimized UniformRandomProvider
  org.apache.commons.lang3.text.StrBuilder As of 3.6, use Apache Commons Text TextStringBuilder instead
  org.apache.commons.lang3.Streams Use `Streams`.
  org.apache.commons.lang3.Streams.ArrayCollector Use `Streams.ArrayCollector`.
  org.apache.commons.lang3.Streams.FailableStream Use `Streams.FailableStream`.
  org.apache.commons.lang3.StringEscapeUtils As of 3.6, use Apache Commons Text StringEscapeUtils instead
  org.apache.commons.lang3.text.StrLookup As of 3.6, use Apache Commons Text StringLookupFactory instead
  org.apache.commons.lang3.text.StrMatcher As of 3.6, use Apache Commons Text StringMatcherFactory instead
  org.apache.commons.lang3.text.StrSubstitutor As of 3.6, use Apache Commons Text StringSubstitutor instead
  org.apache.commons.lang3.text.StrTokenizer As of 3.6, use Apache Commons Text StringTokenizer instead
  org.apache.commons.lang3.ThreadUtils.NamePredicate Use a `Predicate`.
  org.apache.commons.lang3.ThreadUtils.ThreadIdPredicate Use a `Predicate`.
  org.apache.commons.lang3.text.translate.UnicodeEscaper As of 3.6, use Apache Commons Text UnicodeEscaper instead
  org.apache.commons.lang3.text.translate.UnicodeUnescaper As of 3.6, use Apache Commons Text UnicodeUnescaper instead
  org.apache.commons.lang3.text.translate.UnicodeUnpairedSurrogateRemover As of 3.6, use Apache Commons Text UnicodeUnpairedSurrogateRemover instead
  org.apache.commons.lang3.text.WordUtils As of 3.6, use Apache Commons Text WordUtils instead

- Deprecated Fields
  Field and Description
  org.apache.commons.lang3.ThreadUtils.ALWAYS_TRUE_PREDICATE Use a `Predicate`.
  org.apache.commons.lang3.StringEscapeUtils.ESCAPE_XML use `StringEscapeUtils.ESCAPE_XML10` or `StringEscapeUtils.ESCAPE_XML11` instead.
  org.apache.commons.lang3.SystemUtils.FILE_SEPARATOR Use `File.separator`, since it is guaranteed to be a string containing a single character and it does not require a privilege check.
  org.apache.commons.lang3.SystemUtils.IS_JAVA_1_9 As of release 3.5, replaced by `SystemUtils.IS_JAVA_9`
  org.apache.commons.lang3.time.DateFormatUtils.ISO_DATE_FORMAT - as of 4.0, ISO_DATE_FORMAT will be replaced by ISO_8601_EXTENDED_DATE_FORMAT.
  org.apache.commons.lang3.time.DateFormatUtils.ISO_DATE_TIME_ZONE_FORMAT - as of 4.0, ISO_DATE_TIME_ZONE_FORMAT will be removed.
  org.apache.commons.lang3.time.DateFormatUtils.ISO_DATETIME_FORMAT - as of 4.0, ISO_DATETIME_FORMAT will be replaced by ISO_8601_EXTENDED_DATETIME_FORMAT.
  org.apache.commons.lang3.time.DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT - as of 4.0, ISO_DATETIME_TIME_ZONE_FORMAT will be replaced by ISO_8601_EXTENDED_DATETIME_TIME_ZONE_FORMAT.
  org.apache.commons.lang3.time.DateFormatUtils.ISO_TIME_FORMAT - as of 4.0, ISO_TIME_FORMAT will be removed.
  org.apache.commons.lang3.time.DateFormatUtils.ISO_TIME_NO_T_FORMAT - as of 4.0, ISO_TIME_NO_T_FORMAT will be replaced by ISO_8601_EXTENDED_TIME_FORMAT.
  org.apache.commons.lang3.time.DateFormatUtils.ISO_TIME_NO_T_TIME_ZONE_FORMAT - as of 4.0, ISO_TIME_NO_T_TIME_ZONE_FORMAT will be replaced by ISO_8601_EXTENDED_TIME_TIME_ZONE_FORMAT.
  org.apache.commons.lang3.time.DateFormatUtils.ISO_TIME_TIME_ZONE_FORMAT - as of 4.0, ISO_TIME_TIME_ZONE_FORMAT will be removed.
  org.apache.commons.lang3.SystemUtils.JAVA_HOME_KEY Use `SystemProperties.JAVA_HOME`.
  org.apache.commons.lang3.SystemUtils.JAVA_IO_TMPDIR_KEY Use `SystemProperties.JAVA_IO_TMPDIR`.
  org.apache.commons.lang3.SystemUtils.LINE_SEPARATOR Use `System.lineSeparator()` instead, since it does not require a privilege check.
  org.apache.commons.lang3.SystemUtils.PATH_SEPARATOR Use `File.pathSeparator`, since it is guaranteed to be a string containing a single character and it does not require a privilege check.
  org.apache.commons.lang3.SystemUtils.USER_DIR_KEY Use `SystemProperties.USER_DIR`.
  org.apache.commons.lang3.SystemUtils.USER_NAME_KEY Use `SystemProperties.USER_NAME`.

- Deprecated Methods
  Method and Description
  org.apache.commons.lang3.ArrayUtils.add(boolean[], int, boolean) this method has been superseded by `ArrayUtils.insert(int, boolean[], boolean...)` and may be removed in a future release. Please note the handling of `null` input arrays differs in the new method: inserting `X` into a `null` array results in `null` not `X`.
  org.apache.commons.lang3.ArrayUtils.add(byte[], int, byte) this method has been superseded by `ArrayUtils.insert(int, byte[], byte...)` and may be removed in a future release. Please note the handling of `null` input arrays differs in the new method: inserting `X` into a `null` array results in `null` not `X`.
  org.apache.commons.lang3.ArrayUtils.add(char[], int, char) this method has been superseded by `ArrayUtils.insert(int, char[], char...)` and may be removed in a future release. Please note the handling of `null` input arrays differs in the new method: inserting `X` into a `null` array results in `null` not `X`.
  org.apache.commons.lang3.ArrayUtils.add(double[], int, double) this method has been superseded by `ArrayUtils.insert(int, double[], double...)` and may be removed in a future release. Please note the handling of `null` input arrays differs in the new method: inserting `X` into a `null` array results in `null` not `X`.
  org.apache.commons.lang3.ArrayUtils.add(float[], int, float) this method has been superseded by `ArrayUtils.insert(int, float[], float...)` and may be removed in a future release. Please note the handling of `null` input arrays differs in the new method: inserting `X` into a `null` array results in `null` not `X`.
  org.apache.commons.lang3.ArrayUtils.add(int[], int, int) this method has been superseded by `ArrayUtils.insert(int, int[], int...)` and may be removed in a future release. Please note the handling of `null` input arrays differs in the new method: inserting `X` into a `null` array results in `null` not `X`.
  org.apache.commons.lang3.ArrayUtils.add(long[], int, long) this method has been superseded by `ArrayUtils.insert(int, long[], long...)` and may be removed in a future release. Please note the handling of `null` input arrays differs in the new method: inserting `X` into a `null` array results in `null` not `X`.
  org.apache.commons.lang3.ArrayUtils.add(short[], int, short) this method has been superseded by `ArrayUtils.insert(int, short[], short...)` and may be removed in a future release. Please note the handling of `null` input arrays differs in the new method: inserting `X` into a `null` array results in `null` not `X`.
  org.apache.commons.lang3.ArrayUtils.add(T[], int, T) this method has been superseded by `insert(int, T[], T...)` and may be removed in a future release. Please note the handling of `null` input arrays differs in the new method: inserting `X` into a `null` array results in `null` not `X`.
  org.apache.commons.lang3.time.FastDatePrinter.applyRules(Calendar, StringBuffer) use `FastDatePrinter.format(Calendar)` or `FastDatePrinter.format(Calendar, Appendable)`
  org.apache.commons.lang3.time.FastDateFormat.applyRules(Calendar, StringBuffer) Use `FastDateFormat.format(Calendar, Appendable)`
  org.apache.commons.lang3.Range.between(T, T) Use `Range.of(Comparable, Comparable)`.
  org.apache.commons.lang3.Range.between(T, T, Comparator<T>) Use `Range.of(Object, Object, Comparator)`.
  org.apache.commons.lang3.StringUtils.chomp(String, String) This feature will be removed in Lang 4, use `StringUtils.removeEnd(String, String)` instead
  org.apache.commons.lang3.StringUtils.defaultString(String, String) Use `Objects.toString(Object, String)`
  org.apache.commons.lang3.ObjectUtils.equals(Object, Object) this method has been replaced by `java.util.Objects.equals(Object, Object)` in Java 7 and will be removed from future releases.
  org.apache.commons.lang3.StringEscapeUtils.escapeXml(String) use `StringEscapeUtils.escapeXml10(java.lang.String)` or `StringEscapeUtils.escapeXml11(java.lang.String)` instead.
  org.apache.commons.lang3.ThreadUtils.findThreadGroups(ThreadGroup, boolean, ThreadUtils.ThreadGroupPredicate) Use `ThreadUtils.findThreadGroups(ThreadGroup, boolean, Predicate)`.
  org.apache.commons.lang3.ThreadUtils.findThreadGroups(ThreadUtils.ThreadGroupPredicate) Use `ThreadUtils.findThreadGroups(Predicate)`.
  org.apache.commons.lang3.ThreadUtils.findThreads(ThreadGroup, boolean, ThreadUtils.ThreadPredicate) Use `ThreadUtils.findThreads(ThreadGroup, boolean, Predicate)`.
  org.apache.commons.lang3.ThreadUtils.findThreads(ThreadUtils.ThreadPredicate) Use `ThreadUtils.findThreads(Predicate)`.
  org.apache.commons.lang3.time.FastDateFormat.format(Calendar, StringBuffer) Use {`FastDateFormat.format(Calendar, Appendable)`.
  org.apache.commons.lang3.time.DatePrinter.format(Calendar, StringBuffer) Use {`DatePrinter.format(Calendar, Appendable)`.
  org.apache.commons.lang3.time.FastDateFormat.format(Date, StringBuffer) Use {`FastDateFormat.format(Date, Appendable)`.
  org.apache.commons.lang3.time.DatePrinter.format(Date, StringBuffer) Use {`DatePrinter.format(Date, Appendable)`.
  org.apache.commons.lang3.time.FastDateFormat.format(long, StringBuffer) Use {`FastDateFormat.format(long, Appendable)`.
  org.apache.commons.lang3.time.DatePrinter.format(long, StringBuffer) Use {`DatePrinter.format(long, Appendable)`.
  org.apache.commons.lang3.time.FastDatePrinter.format(Object, StringBuffer, FieldPosition) Use {`FastDatePrinter.format(Date)`, {`FastDatePrinter.format(Calendar)`, {`FastDatePrinter.format(long)`.
  org.apache.commons.lang3.exception.ExceptionUtils.getCause(Throwable) This feature will be removed in Lang 4, use `Throwable.getCause()` instead
  org.apache.commons.lang3.exception.ExceptionUtils.getCause(Throwable, String[]) This feature will be removed in Lang 4, use `Throwable.getCause()` instead
  org.apache.commons.lang3.exception.ExceptionUtils.getDefaultCauseMethodNames() This feature will be removed in Lang 4
  org.apache.commons.lang3.StringUtils.getFuzzyDistance(CharSequence, CharSequence, Locale) As of 3.6, use Apache Commons Text FuzzyScore instead
  org.apache.commons.lang3.StringUtils.getJaroWinklerDistance(CharSequence, CharSequence) As of 3.6, use Apache Commons Text JaroWinklerDistance instead
  org.apache.commons.lang3.StringUtils.getLevenshteinDistance(CharSequence, CharSequence) As of 3.6, use Apache Commons Text LevenshteinDistance instead
  org.apache.commons.lang3.StringUtils.getLevenshteinDistance(CharSequence, CharSequence, int) As of 3.6, use Apache Commons Text LevenshteinDistance instead
  org.apache.commons.lang3.time.DurationUtils.getNanosOfMiili(Duration) Use `DurationUtils.getNanosOfMilli(Duration)`.
  org.apache.commons.lang3.SystemUtils.getUserName() Use `SystemProperties.getUserName()`.
  org.apache.commons.lang3.ObjectUtils.hashCode(Object) this method has been replaced by `java.util.Objects.hashCode(Object)` in Java 7 and will be removed in future releases
  org.apache.commons.lang3.ObjectUtils.hashCodeMulti(Object...) this method has been replaced by `java.util.Objects.hash(Object...)` in Java 7 and will be removed in future releases.
  org.apache.commons.lang3.ObjectUtils.identityToString(StrBuilder, Object) as of 3.6, because StrBuilder was moved to commons-text, use one of the other `identityToString` methods instead
  org.apache.commons.lang3.ArrayUtils.isEquals(Object, Object) this method has been replaced by `java.util.Objects.deepEquals(Object, Object)` and will be removed from future releases.
  org.apache.commons.lang3.math.NumberUtils.isNumber(String) This feature will be removed in Lang 4, use `NumberUtils.isCreatable(String)` instead
  org.apache.commons.lang3.CharEncoding.isSupported(String) Please use `Charset.isSupported(String)` instead, although be aware that `null` values are not accepted by that method and an `IllegalCharsetNameException` may be thrown.
  org.apache.commons.lang3.Validate.notNull(T) Use `Objects.requireNonNull(Object)`.
  org.apache.commons.lang3.StringUtils.removeAll(String, String) Moved to RegExUtils.
  org.apache.commons.lang3.ArrayUtils.removeAllOccurences(boolean[], boolean) Use `ArrayUtils.removeAllOccurrences(boolean[], boolean)`
  org.apache.commons.lang3.ArrayUtils.removeAllOccurences(byte[], byte) Use `ArrayUtils.removeAllOccurrences(byte[], byte)`
  org.apache.commons.lang3.ArrayUtils.removeAllOccurences(char[], char) Use `ArrayUtils.removeAllOccurrences(char[], char)`
  org.apache.commons.lang3.ArrayUtils.removeAllOccurences(double[], double) Use `ArrayUtils.removeAllOccurrences(double[], double)`
  org.apache.commons.lang3.ArrayUtils.removeAllOccurences(float[], float) Use `ArrayUtils.removeAllOccurrences(float[], float)`
  org.apache.commons.lang3.ArrayUtils.removeAllOccurences(int[], int) Use `ArrayUtils.removeAllOccurrences(int[], int)`
  org.apache.commons.lang3.ArrayUtils.removeAllOccurences(long[], long) Use `ArrayUtils.removeAllOccurrences(long[], long)`
  org.apache.commons.lang3.ArrayUtils.removeAllOccurences(short[], short) Use `ArrayUtils.removeAllOccurrences(short[], short)`
  org.apache.commons.lang3.ArrayUtils.removeAllOccurences(T[], T) Use `ArrayUtils.removeAllOccurrences(Object[], Object)`
  org.apache.commons.lang3.reflect.FieldUtils.removeFinalModifier(Field, boolean) As of Java 12, we can no longer drop the `final` modifier, thus rendering this method obsolete. The JDK discussion about this change can be found here: https://mail.openjdk.java.net/pipermail/core-libs-dev/2018-November/056486.html
  org.apache.commons.lang3.StringUtils.removeFirst(String, String) Moved to RegExUtils.
  org.apache.commons.lang3.StringUtils.removePattern(String, String) Moved to RegExUtils.
  org.apache.commons.lang3.StringUtils.replaceAll(String, String, String) Moved to RegExUtils.
  org.apache.commons.lang3.StringUtils.replaceFirst(String, String, String) Moved to RegExUtils.
  org.apache.commons.lang3.StringUtils.replacePattern(String, String, String) Moved to RegExUtils.
  org.apache.commons.lang3.stream.Streams.stream(Collection<E>) Use `Streams.failableStream(Collection)`.
  org.apache.commons.lang3.stream.Streams.stream(Stream<T>) Use `Streams.failableStream(Stream)`.
  org.apache.commons.lang3.CharUtils.toCharacterObject(char) Java 5 introduced `Character.valueOf(char)` which caches chars 0 through 127.
  org.apache.commons.lang3.StringUtils.toString(byte[], String) use `StringUtils.toEncodedString(byte[], Charset)` instead of String constants in your code
  org.apache.commons.lang3.ObjectUtils.toString(Object) this method has been replaced by `java.util.Objects.toString(Object)` in Java 7 and will be removed in future releases. Note however that said method will return "null" for null references, while this method returns an empty String. To preserve behavior use `java.util.Objects.toString(myObject, "")`
  org.apache.commons.lang3.ObjectUtils.toString(Object, String) this method has been replaced by `java.util.Objects.toString(Object, String)` in Java 7 and will be removed in future releases.

- Deprecated Constructors
  Constructor and Description
  org.apache.commons.lang3.exception.ExceptionUtils() Will be private in 3.0.

- Deprecated Enum Constants
  Enum Constant and Description
  org.apache.commons.lang3.JavaVersion.JAVA_1_9 As of release 3.5, replaced by `JavaVersion.JAVA_9`

Copyright © 2001–2023 The Apache Software Foundation. All rights reserved.