The Apache Commons team is pleased to announce Apache Commons Lang Version 3.15.0.
Commons Lang is a set of utility functions and reusable components that should be of use in any Java environment.
Starting with Commons Lang 3.9, we target Java 8, making use of those features.
For advice on upgrading from 2.x to 3.x, see:
https://commons.apache.org/lang/article3_0.html
Apache Commons Lang, a package of Java utility classes for the
classes that are in java.lang's hierarchy, or are considered to be so
standard as to justify existence in java.lang.
The code is tested using the latest revision of the JDK for supported
LTS releases: 8, 11, 17 and 21 currently.
See https://github.com/apache/commons-lang/blob/master/.github/workflows/maven.yml
Please ensure your build environment is up-to-date and kindly report any build issues.
New features and bug fixes (Java 8 or above).
Changes in this version include:
New features:
o LANG-1724: Customize text pattern in DiffResult#toString(). Thanks to Gary Gregory, Dennis Baerten.
o Add DiffBuilder.Builder. Thanks to Gary Gregory.
o Add DiffBuilder.builder(). Thanks to Gary Gregory.
o Add ReflectionDiffBuilder.Builder. Thanks to Gary Gregory.
o Add ReflectionDiffBuilder.builder(). Thanks to Gary Gregory.
o Add test in TypeUtilsTest #1151. Thanks to Elliotte Rusty Harold.
o Add Streams.failableStream(T), non-varargs variant. Thanks to Gary Gregory.
o Add Streams.nonNull(T), non-varargs variant. Thanks to Gary Gregory.
o Add ArrayUtils.nullTo(T[], T[]). Thanks to Gary Gregory.
o Add T ArrayUtils.arraycopy(T, int, T, int, int) fluent style. Thanks to Gary Gregory.
o Add T ArrayUtils.arraycopy(T, int, int, int, Function) fluent style. Thanks to Gary Gregory.
o Add SystemUtils.IS_JAVA_22. Thanks to Gary Gregory.
o Add JavaVersion.JAVA_22. Thanks to Gary Gregory.
o Add SystemProperties.getUserName(Supplier<String>). Thanks to Gary Gregory.
o Add SystemProperties.getLineSeparator(Supplier<String>). Thanks to Gary Gregory.
o Add SystemProperties.getJavaSpecificationVersion(Supplier<String>). Thanks to Gary Gregory.
o Add SystemProperties constants and methods for system properties as of Java 22. Thanks to Gary Gregory.
o Add MethodUtils.getMethodObject(Class, String, Class...). Thanks to Gary Gregory.
o LANG-1733: Add null-safe Consumers.accept() and Functions.apply() #1215. Thanks to Jongjin Bae, Gary Gregory.
o Add SystemUtils.IS_OS_ANDROID. Thanks to Gary Gregory.
o Add SystemUtils.IS_OS_MAC_OSX_SONOMA. Thanks to Gary Gregory.
o Add RuntimeEnvironment.inContainer() #1241. Thanks to Gary Gregory.
o Add AppendableJoiner and refactor string joining #1244. Thanks to Gary Gregory.
Fixed Bugs:
o Improve Javadoc in ExceptionUtils #1136. Thanks to Mikl<6B>s Karak<61>, Gary Gregory.
o Fixed two non-deterministic tests in EnumUtilsTest.java #1131. Thanks to Saiharshith Karuneegar Ramesh, Gary Gregory.
o LANG-1721: Fix wrong number check that cause StringIndexOutOfBoundsException #1140. Thanks to Arthur Chan, Gary Gregory.
o LANG-1722: Rethrow NegativeArraySizeException as SerializationException in SerializationUtils.deserialize(InputStream) #1141. Thanks to Arthur Chan.
o LANG-1723: Throw NumberFormatException instead of IndexOutOfBoundsException in NumberUtils.getMantissa(String, int) #1145. Thanks to Arthur Chan, Gary Gregory.
o Minor grammar fixes #1143. Thanks to Parano<6E>d User.
o LANG-1713: ArrayUtils will return null when adding two null arrays, but undocumented. Thanks to John Hendrikx, Gary Gregory.
o Let parent POM figure out commons.spdx.version. Thanks to Gary Gregory.
o LANG-1726: Undeprecate ExceptionUtils.rethrow(Throwable). Thanks to V<>clav Haisman, Gary Gregory.
o LANG-1702: Test the Conversion class #1155. Thanks to Elliotte Rusty Harold.
o Address minor redundancies after code inspection #1148. Thanks to ParanoidUser, Elliotte Rusty Harold, Gary Gregory.
o Allow EventListenerSupport to handle (and ignore) exception from listeners allowing invocation of all listeners #1167. Thanks to Gary Gregory.
o Deprecate AnnotationUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate ArchUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate ArrayUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate BooleanUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate CharSequenceUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate CharSetUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate CharUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate ClassLoaderUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate ClassPathUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate ClassUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate ConstructorUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate DateFormatUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate DateUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate Diff.getType(). Thanks to Gary Gregory.
o Deprecate DiffBuilder.DiffBuilder(T, T, ToStringStyle). Thanks to Gary Gregory.
o Deprecate DiffBuilder.DiffBuilder(T, T, ToStringStyle, boolean). Thanks to Gary Gregory.
o Deprecate DurationFormatUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate DurationUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate EnumUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate EventUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate FieldUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate IEEE754rUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate InheritanceUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate IntStreams 0-argument constructor. Thanks to Gary Gregory.
o Deprecate LocaleUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate LockingVisitors 0-argument constructor. Thanks to Gary Gregory.
o Deprecate MemberUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate MethodUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate NumberUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate ObjectUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate RandomStringUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate RandomUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate ReflectionDiffBuilder.ReflectionDiffBuilder(T, T, ToStringStyle). Thanks to Gary Gregory.
o Deprecate RegExUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate SerializationUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate Streams 0-argument constructor. Thanks to Gary Gregory.
o Deprecate StringEscapeUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate StringUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate Suppliers 0-argument constructor. Thanks to Gary Gregory.
o Deprecate SystemProperties 0-argument constructor. Thanks to Gary Gregory.
o Deprecate ThreadUtils 0-argument constructor. Thanks to Gary Gregory.
o Deprecate TypeUtils 0-argument constructor. Thanks to Gary Gregory.
o Make ArrayFill null-safe. Thanks to Gary Gregory.
o Make ArraySorter null-safe. Thanks to Gary Gregory.
o Make ArrayUtils.removeAll() null-safe. Thanks to Gary Gregory.
o Fix Java version in README.md #1170. Thanks to Philipp Trulson, Gary Gregory.
o StringUtils.stripAccents() should handle ligatures, UTF32 math blocks, etc. #1201. Thanks to Stephan Peters, Gary Gregory, Bernd.
o LANG-1524: TypeUtils.toString(Type) StackOverflowError for an inner class in the inner class parameterized enclosing class #657. Thanks to kijong.youn, Aakash Gupta, Gary Gregory.
o Deprecate SystemUtils.getUserName(String) in favor of SystemProperties.getUserName(Supplier). Thanks to Gary Gregory.
o Make LockVisitor.acceptReadLocked(FailableConsumer) null-safe. Thanks to Gary Gregory.
o Make LockVisitor.applyWriteLocked(FailableConsumer) null-safe. Thanks to Gary Gregory.
o Make ObjectUtils.getFirstNonNull(Supplier...) null-safe. Thanks to Gary Gregory.
o Make SystemProperties.getLineSeparator(Supplier). Thanks to Gary Gregory.
o StringUtils.stripAccents(String) doesn't handle "\u0111" and "\u0110" (Vietnamese) #1216. Thanks to hunghhdev.
o StringUtils.stripAccents(String) doesn't handle I with bar. Thanks to Gary Gregory.
o StringUtils.stripAccents(String) doesn't handle U with bar. Thanks to Gary Gregory.
o StringUtils.stripAccents(String) doesn't handle T with stroke. Thanks to Gary Gregory.
o LANG-1735: Fix Javadoc for FluentBitSet.setInclusive(int, int) #1222. Thanks to Tobias Kiecker.
o Same Javadoc changes as [TEXT-234] #1223. Thanks to Tobias Kiecker.
o Remove duplicate static data in SerializationUtils.ClassLoaderAwareObjectInputStream. Thanks to Gary Gregory.
o Reimplement RandomUtils and RandomStringUtils on top of SecureRandom#getInstanceStrong() #1235. Thanks to Gary Gregory, Henri Yandell, Fabrice Benhamouda.
This document contains the release notes for the 3.14.0 version of Apache Commons Lang.
Commons Lang is a set of utility functions and reusable components that should be of use in any
Java environment.
Lang 3.9 and onwards now targets Java 8, making use of features that arrived with Java 8.
For the advice on upgrading from 2.x to 3.x, see the following page:
https://commons.apache.org/lang/article3_0.html
Apache Commons Lang, a package of Java utility classes for the
classes that are in java.lang's hierarchy, or are considered to be so
standard as to justify existence in java.lang.
New features and bug fixes (Java 8 or above).
Changes in this version include:
New features:
o Add Functions#function(Function). Thanks to Rob Spoor, Gary Gregory.
o Add FailableFunction#function(FailableFunction). Thanks to Rob Spoor, Gary Gregory.
o Add CalendarUtils.getInstance(). Thanks to Gary Gregory.
o Add syntax for optional tokens to DurationFormatUtils #1062. Thanks to Dan Watson.
o Add ArrayFill. Thanks to Gary Gregory.
o Add FastDateParser.TimeZoneStrategy.TzInfo.toString(). Thanks to Gary Gregory.
o Add LocaleUtils.isLanguageUndetermined(Locale). Thanks to Gary Gregory.
o Add ObjectUtils.toString(Supplier<Object>, Supplier<String>). Thanks to Gary Gregory.
o Add LazyInitializer.isInitialized(). Thanks to Gary Gregory.
o Add ConcurrentInitializer#isInitialized() #1120. Thanks to Benjamin Confino, Gary Gregory.
o Add Streams.failableStream(T...). Thanks to Gary Gregory.
o Add FailableSupplier.nul(). Thanks to Gary Gregory.
o Add Suppliers.nul(). Thanks to Gary Gregory.
o Add ExceptionUtils.throwUnchecked(T) where T extends Throwable, and deprecate Object version. Thanks to Gary Gregory.
o Add ExceptionUtils.rethrowRuntimeException(T), and deprecate rethrow(T). Thanks to Gary Gregory.
o LANG-1716: ConcurrentInitializer implementations can now be instantiated and configured with allocation and release lambdas. Thanks to Benjamin Confino, Gary Gregory.
o LANG-1717: Add support for RISC-V in ArchUtils #1128. Thanks to Levi Zim, Gary Gregory.
Fixed Bugs:
o Rename variable names from 'clss' to 'clazz' #1087. Thanks to remeio.
o [Javadoc] ComparableUtils'c1' to 'comparable1', 'c2' to ' Thanks to remeio.
o [Javadoc] Remove 2.1 specific comment #1091. Thanks to Elliotte Rusty Harold.
o LANG-1704: ImmutablePair and ImmutableTriple implementation don't match final in Javadoc. Thanks to Dan Ziemba, Gilles Sadowski, Alex Herbert, Gary Gregory.
o [Javadoc] Fix Incorrect Description in Processor isAarch64() #1093. Thanks to Sung Ho Yoon.
o [Javadoc] Point to right getShortClassName flavor in Javadoc for relevant notes #1097. Thanks to ljacqu.
o Improve performance of StringUtils.isMixedCase() #1096. Thanks to hduelme.
o LANG-1706: ThreadUtils find methods should not return null items #1098. Thanks to Alberto Fern<72>ndez.
o LANG-1710: ReflectionToStringBuilder changes in version 3.13.0 has broken the logic for overriding classes. Thanks to Shashank Sharma, Gary Gregory, Oksana.
o Return "null" instead of NPE in ClassLoaderUtils.toString(ClassLoader). Thanks to Gary Gregory.
o Return "null" instead of NPE in ClassLoaderUtils.toString(URLClassLoader). Thanks to Gary Gregory.
o Return ToStringStyle.nullText instead of NPE for ReflectionToStringBuilder.toString(). Thanks to Gary Gregory.
o Fix ThresholdCircuitBreaker#checkState() #1100. Thanks to yichinzhu, Gary Gregory.
o Use ConcurrentInitializer implementations without subclassing. #1123. Thanks to Benjamin Confino, Gary Gregory.
o Update critical value for chi-square test #1125. Thanks to Alex Herbert.
o Fix Javadoc syntax errors #1129. Thanks to Sung Ho Yoon.
Changes:
o Bump commons-parent from 58 to 64. Thanks to Gary Gregory.
o Bump org.easymock:easymock from 5.1.0 to 5.2.0 #1104. Thanks to Gary Gregory.
o Bump commons-text from 1.10.0 to 1.11.0. Thanks to Gary Gregory.
o Bump org.codehaus.mojo:exec-maven-plugin from 3.1.0 to 3.1.1 #1135. Thanks to Gary Gregory.
Historical list of changes: https://commons.apache.org/proper/commons-lang/changes-report.html
For complete information on Apache Commons Lang, including instructions on how to submit bug reports,
patches, or suggestions for improvement, see the Apache Commons Lang website:
o Add GitHub coverage.yml. Thanks to Gary Gregory.
o Add EnumUtils.getEnumSystemProperty(...). Thanks to Gary Gregory.
o Add TriConsumer. Thanks to Gary Gregory.
o Add and use EnumUtils.getFirstEnumIgnoreCase(Class, String, Function, E). Thanks to Gary Gregory.
o Add and use Suppliers. Thanks to Gary Gregory.
o Add and use ArrayUtils.getComponentType(T[]). Thanks to Gary Gregory.
o Add and use ClassUtils.getComponentType(Class>T[]>). Thanks to Gary Gregory.
o Add and use ObjectUtils.getClass(T). Thanks to Gary Gregory.
o Add and use ArrayUtils.newInstance(Class>T>, int). Thanks to Gary Gregory.
o Add and use null-safe Streams.of(T...). Thanks to Gary Gregory.
o Add ClassUtils.comparator(). Thanks to Gary Gregory.
o Add and use ThreadUtils.sleepQuietly(Duration). Thanks to Gary Gregory.
o Add and use ArrayUtils.setAll(T[], IntFunction). Thanks to Gary Gregory.
o Add and use ArrayUtils.setAll(T[], Supplier). Thanks to Gary Gregory.
o Add BooleanConsumer. Thanks to Gary Gregory.
o Add IntToCharFunction. Thanks to Gary Gregory.
o Add IntStreams. Thanks to Gary Gregory.
o Add UncheckedFuture. Thanks to Gary Gregory.
o Add UncheckedException. Thanks to Gary Gregory.
o Add UncheckedExecutionException. Thanks to Gary Gregory.
o Add UncheckedTimeoutException. Thanks to Gary Gregory.
o Add UncheckedInterruptedException. Thanks to Gary Gregory.
o Add TimeZones.GMT. Thanks to Gary Gregory.
o Add ObjectUtils.identityHashCodeHex(Object). Thanks to Gary Gregory.
o Add ObjectUtils.hashCodeHex(Object). Thanks to Gary Gregory.
o Add StringUtils.removeStart(String, char). Thanks to Gary Gregory.
o LANG-1659: Add null-safe ObjectUtils.isArray() #754. Thanks to Arturo Bernal, Gary Gregory.
o Add ComparableUtils.max(A, A) and ComparableUtils.min(A, A). Thanks to Gary Gregory.
o Add UncheckedReflectiveOperationException. Thanks to Gary Gregory.
o Add and use ClassUtils.isPublic(Class). Thanks to Gary Gregory.
o Add UncheckedIllegalAccessException. Thanks to Gary Gregory.
o Add MethodInvokers. Thanks to Gary Gregory.
o Add Streams.nullSafeStream(Collection). Thanks to Gary Gregory.
o Add Streams.toStream(Collection). Thanks to Gary Gregory.
o Add Streams.failableStream(Collection) and deprecate misnamed stream(Collection). Thanks to Gary Gregory.
o Add Streams.failableStream(Stream) and deprecate misnamed stream(Stream). Thanks to Gary Gregory.
o Add EnumUtils.getEnumMap(Class, Function). #730 Thanks to Maxwell Cody, Gary Gregory.
o Add FluentBitSet. Thanks to Gary Gregory.
o Add Streams.instancesOf(Class, Collection). Thanks to Gary Gregory.
o Add ImmutablePair.ofNonNull(L, R). Thanks to Gary Gregory.
o Add ImmutableTriple.ofNonNull(L, M, R). Thanks to Gary Gregory.
o Add MutablePair.ofNonNull(L, R). Thanks to Gary Gregory.
o Add MutableTriple.ofNonNull(L, M, R). Thanks to Gary Gregory.
o Add Pair.ofNonNull(L, R). Thanks to Gary Gregory.
o Add Triple.ofNonNull(L, M, R). Thanks to Gary Gregory.
o Add ArrayUtils.containsAny(Object[], Object...). Thanks to Gary Gregory.
o Add Processor.Type.AARCH_64. Thanks to Gary Gregory.
o Add Processor.isAarch64(). Thanks to Gary Gregory.
o Update ArchUtils.getProcessor(String) for "aarch64". Thanks to Gary Gregory.
o Add JavaVersion.JAVA_18. Thanks to Gary Gregory.
o Add JavaVersion.JAVA_19. Thanks to Emmanuel Bourg.
o Add JavaVersion.JAVA_20. Thanks to Emmanuel Bourg.
o Add JavaVersion.JAVA_21. Thanks to Emmanuel Bourg.
o Add TimeZones.toTimeZone(TimeZone). Thanks to Gary Gregory.
o Add FutureTasks. Thanks to Gary Gregory.
o Add Memoizer(Function) and Memoizer(Function, boolean). Thanks to Gary Gregory.
o Add Consumers. Thanks to Gary Gregory.
o Add github/codeql-action. Thanks to Gary Gregory.
o Add coverage.yml. Thanks to Gary Gregory.
o Add DurationUtils.since(Temporal). Thanks to Gary Gregory.
o Add DurationUtils.of(FailableConsumer|FailableRunnbale). Thanks to Gary Gregory.
o Add ExceptionUtils.forEach(Throwable, Consumer<Throwable>). Thanks to Gary Gregory.
o Add ExceptionUtils.stream(Throwable). Thanks to Gary Gregory.
o Add ExceptionUtils.getRootCauseStackTraceList(Throwable). Thanks to Gary Gregory.
o Add SystemUtils.IS_OS_WINDOWS_11. Thanks to Will Herrmann, Gary Gregory, Roland Kreuzer.
o Add SystemUtils.IS_JAVA_16. Thanks to Gary Gregory.
o Add SystemUtils.IS_JAVA_17. Thanks to Gary Gregory.
o Add SystemUtils.IS_JAVA_18. Thanks to Gary Gregory.
o Add SystemUtils.IS_JAVA_19. Thanks to Gary Gregory.
o Add SystemUtils.IS_JAVA_20. Thanks to Gary Gregory.
o Add SystemUtils.IS_JAVA_21. Thanks to Emmanuel Bourg.
o LANG-1627: Add ArrayUtils.oneHot(). Thanks to Alberto Scotto, Avijit Chakraborty, Steve Bosman, Bruno P. Kinoshita, Gary Gregory.
o LANG-1662: Let ReflectionToStringBuilder only reflect given field names #849. Thanks to Daniel Augusto Veronezi Salvador, Gary Gregory, Bruno P. Kinoshita.
o Add Streams.of(Enumeration<E>). Thanks to Gary Gregory.
o Add Streams.of(Iterable<E>). Thanks to Gary Gregory.
o Add Streams.of(Iterator<E>). Thanks to Gary Gregory.
o LANG-1689: Simple support for Optional in ObjectUtils#isEmpty() #933. Thanks to Joseph Hendrix, Gary Gregory.
o Add Processor.Type.getLabel(). Thanks to Gary Gregory.
o Add Processor.toString(). Thanks to Gary Gregory.
o Add HashCodeBuilder.equals(Object). Thanks to Gary Gregory.
o Add BooleanUtils.values() and forEach(). Thanks to Gary Gregory.
o Add ClassPathUtils.packageToPath(String) and pathToPackage(String) Thanks to Gary Gregory.
o Add CalendarUtils#getDayOfYear() #968 Thanks to Arturo Bernal.
o Add NumberRange, DoubleRange, IntegerRange, LongRange. Thanks to Gary Gregory.
o Add missing exception javadoc/tests for some null arguments #869. Thanks to Diego Marcilio, Bruno P. Kinoshita, Gary Gregory.
o Add ClassLoaderUtils.getSystemURLs() and getThreadURLs(). Thanks to Gary Gregory.
o Add RegExUtils.dotAll() and dotAllMatcher(). Thanks to Gary Gregory.
o Add Pair.accept(FailableBiConsumer). Thanks to Gary Gregory.
o Add Pair.apply(FailableBiFunction). Thanks to Gary Gregory.
o LANG-1677: Add ReflectionDiffBuilder.setExcludeFieldNames(...) and DiffExclude a? #838. Thanks to Dennis Baerten, Gary Gregory.
o LANG-1647: Add and ExceptionUtils.isChecked() and isUnchecked() #1069 Thanks to Arturo Bernal, Dimitrios Efthymiou, Gary Gregory.
o Add and use ExceptionUtils.throwUnchecked(throwable). Thanks to Gary Gregory.
o Add LockingVisitors.create(O, ReadWriteLock). Thanks to Gary Gregory.
Fixed Bugs:
o LANG-1645: NumberUtils.createNumber() to recognize hex integers prefixed with +. Thanks to Alex Herbert.
o LANG-1646: NumberUtils.createNumber() to return requested floating point type for zero. Thanks to Alex Herbert.
o DMI: Random object created and used only once (DMI_RANDOM_USED_ONLY_ONCE); Better multi-threaded behavior. Thanks to SpotBugs, Gary Gregory.
o LANG-1646: Redundant Collection operation. Use Collections.emptyIterator() #738. Thanks to Arturo Bernal.
o Make Streams.stream(Collection) null-safe. Thanks to Gary Gregory.
o LANG-1667: Allow tests to access java.util classes such as ArrayList in Java 16 #788. Thanks to Andrew Thomas.
o LANG-1669: OpenJDK 16 Day Period Parsing #791. Thanks to Andrew Thomas.
o LANG-1663: Update documentation to list correct exception for null array parameters #785. Thanks to Andrew Thomas.
o Fixing reversed Javadoc descriptions in StopWatch #781. Thanks to Thunderforge.
o LANG-1670: Fix typos in JavaDoc #795. Thanks to Igor Shuvalov.
o Simplify assertions with equivalent but more simple. #792. Thanks to Arturo Bernal.
o Avoid multiple equivalent occurrences of the same expression. #797. Thanks to Arturo Bernal.
o Remove redundant initializers #800. Thanks to Arturo Bernal.
o Fix ObjectUtils Javadocs #755. Thanks to Arturo Bernal.
o Add test idea for RangeTest from PR #815 by Rushi98, but with a new comment. Thanks to Rushi98, Gary Gregory.
o LANG-1674: Make Range constructors more generic #810. Thanks to singhbaljit, Gary Gregory.
o Use final and Remove redundant String. #813, #816. Thanks to Arturo Bernal.
o Use Set instead of List for checking the contains() method #734. Thanks to CiprianBodnarescu.
o Javadoc for StringUtils.substringBefore(String str, int separator) doesn't mention that the separator is an int. Thanks to Roland Kreuzer.
o Fix NullPointerException in ThreadUtils.getSystemThreadGroup() when the current thread is stopped. Thanks to Gary Gregory.
o ArrayUtils.toPrimitive(Boolean...) null array elements map to false, like Boolean.parseBoolean(null) and its callers return false. Thanks to Gary Gregory.
o StrBuilder.StrBuilderReader.skip(long): Throw an exception when an implicit narrowing conversion in a compound assignment would result in information loss or a numeric error such as an overflows. Thanks to CodeQL, Gary Gregory.
o Deprecate Validate#notNull(Object) in favor of using Objects#requireNonNull(Object, String). Thanks to Gary Gregory.
o LANG-1462: Use TimeZone from calendar in DateFormatUtils. Thanks to Lijun Liang, Arun Avanathan, Tai Dupree, Maria Buiakova, Gary Gregory.
o Updating javadoc for NullPointerException when Validate.notNull() is called #870. Thanks to Diego Marcilio.
o Fixing and adding DateUtils exception Javadocs #871. Thanks to Diego Marcilio.
o LANG-1679: Improve performance of StringUtils.unwrap(String, String) #844. Thanks to clover.
o LANG-1675: Improve performance of StringUtils.join for primitives #812. Thanks to clover.
o LANG-1675: Fixed NPE getting Stack Trace if Throwable is null #733. Thanks to Arturo Bernal.
o Make Validate.isAssignableFrom() check null inputs. Thanks to Gary Gregory, Arturo Bernal.
o Fix Javadoc for Validate.isAssignableFrom(). Thanks to Arturo Bernal.
o Make final mappingFunction variable #876. Thanks to Arturo Bernal.
o Remove unnecessary variable creations #882. Thanks to Arturo Bernal.
o Minor changes #769. Thanks to Arturo Bernal.
o LANG-1680: FastDateFormat does not support the 'L'-Pattern from SimpleDateFormat. Thanks to Michael Krause, Steve Bosman, Gary Gregory.
o Increase test coverage of ComparableUtils from 71% to 100% #898. Thanks to Steve Bosman, Gary Gregory.
o Increase method test coverage of MultilineRecursiveToStringStyle #899. Thanks to Steve Bosman.
o Fix unstable coverage of CharSequenceUtils tests noticed during merge of PRs 898 and 899 #901. Thanks to Steve Bosman.
o Rewrite Conversion.binaryBeMsb0ToHexDigit to invert logic of binaryToHexDigit. Thanks to Arturo Bernal.
o Allow extension of previously final classes ImmutablePair and ImmutableTriple. Thanks to Gary Gregory.
o Update ClassUtils Javadoc with some missing throws NPE #912. Thanks to shalk, Bruno P. Kinoshita, Gary Gregory.
o Javadoc: StringUtils.repeat("", "x", 3) = "xx"; #918. Thanks to guicaiyue.
o Fix typos #920, #923. Thanks to Marc Wrobel.
o Simplify condition #925. Thanks to Bhimantoro Suryo Admodjo.
o StringUtils.join(Iterable, String) should only return null when the Iterable is null. Thanks to Gary Gregory.
o StringUtils.join(Iterator, String) should only return null when the Iterator is null. Thanks to Gary Gregory.
o Add tests to increase coverage #904. Thanks to Arturo Bernal.
o Extends Object clauses are redundant #937. Thanks to Arturo Bernal.
o Simplify conditional expression. #941. Thanks to Arturo Bernal.
o Fix some Javadoc comments #938. Thanks to Arturo Bernal.
o Deprecate getNanosOfMiili() method with typo and create proper getNanosOfMilli() #940. Thanks to Arturo Bernal, Gary Gregory.
o Deprecate ThreadUtils code that defines custom function interfaces in favor of stock java.util.function.Predicate usage. Thanks to Gary Gregory.
o Fix links in Javadoc and documentation #926. Thanks to Marc Wrobel.
o LANG-1604: Deprecate RandomUtils in favor of Apache Commons RNG UniformRandomProvider #942. Thanks to Gilles Sadowski, Maksym Bohachov, Gary Gregory.
o LANG-1638: Added docs regarding week year support #924. Thanks to Shailendra Soni, Michael Osipov, Arun Avanathan, Andrew Thomas, Bruno P. Kinoshita, Gary Gregory.
o LANG-1691: ClassUtils.getShortCanonicalName doesn't use the canonicalName #949. Thanks to Thiyagarajan, Gary Gregory.
o Validate: Get error messages without using String.format when varargs is empty. Thanks to Piotr Stawirej.
o Simplify expression (length is never < 0) #962. Thanks to Arturo Bernal.
o Fix simple broken javadoc. #981. Thanks to Arturo Bernal.
o Fix typo #1001. Thanks to LeeJuHyun.
o Use Objects.requireNonNull() directly #1022. Thanks to Arturo Bernal.
o LANG-1694: MethodUtils.getMatchingMethod() fails with "Found multiple candidates" #1033. Thanks to SeasonPan.
o LANG-1643: Construct ArrayList with better default size #1041. Thanks to laurentschoelens.
o ThreadUtilsTest#testThreadGroups will test failed when using Junit5 parallel test #1051. Thanks to remeio.
o Swap the order of assertion args (first excepted then actual) #1054. Thanks to remeio.
o Fix the comment of Failable, redundant "-" #1056. Thanks to remeio.
o Fix the comment of ComparableUtils, using "smallest", not "largest" #1058. Thanks to remeio.
o AnnotationUtilsTest and FormattableUtilsTest Only use static imports to import assert methods in tests #1052. Thanks to remeio.
o [LANG-1681] Fix some FieldUtils Javadocs #1047. Thanks to laurentschoelens, Bruno P. Kinoshita, Diego Marcilio.
o Remove unnecessary statement in DurationFormatUtils #965. Thanks to Arturo Bernal.
o LANG-1699: Corrected value of SystemUtils.JAVA_VENDOR #1066. Thanks to Darren Coleman.
o [StepSecurity] ci: Harden GitHub Actions #1067. Thanks to step-security-bot, Gary Gregory.
o Update Javadoc for the insert methods in ArrayUtils #1078. Thanks to Dimitrios Efthymiou.
o Deprecate ExceptionUtils.ExceptionUtils(). Thanks to Gary Gregory.
o LANG-1697: TypeUtils.getRawType() throws a NullPointerException on Wildcard GenericArrayType. Thanks to Jan Arne Sparka, Gary Gregory.
o Throw IllegalArgumentException instead of InternalError in the builder package. Thanks to Gary Gregory.
o Avoid NPE in MutableObject#equals() for null content. Thanks to Gary Gregory.
o SystemUtils fix and updates related to macOS #1085. Thanks to Ali Khaleqi Yekta, Gary Gregory.
Changes:
o Bump actions/cache from 2.1.4 to 3.0.10 #742, #752, #764, #833, #867, #959, #964. Thanks to Dependabot, XenoAmess, Gary Gregory.
o Bump actions/checkout from 2 to 3.1.0 #819, #825, #859, #963. Thanks to Dependabot, Gary Gregory.
o Bump actions/setup-java from v1.4.3 to 3.5.1 #879. Thanks to Gary Gregory.
o Bump spotbugs-maven-plugin from 4.2.0 to 4.7.3.0 #735, #808, #822, #834, #868, #895, #919, #927, #946, #989. Thanks to Dependabot, Gary Gregory.
o Bump spotbugs from 4.2.2 to 4.7.3 #744, #917, #947, #973. Thanks to Dependabot, Gary Gregory.
o Bump maven-checkstyle-plugin from 3.1.2 to 3.2.0 #943. Thanks to Dependabot, Gary Gregory.
o Bump checkstyle from 8.41 to 9.3 #739, #768, #787, #811, #824, #843. Thanks to Dependabot, Gary Gregory.
o Bump easymock from 4.2 to 5.1.0 #746, #972, #986, #1012. Thanks to Dependabot.
o Bump commons.jacoco.version from 0.8.6 to 0.8.8. Thanks to Gary Gregory.
o Bump commons.japicmp.version from 0.15.2 to 0.16.0. Thanks to Gary Gregory.
o Bump junit-pioneer from 1.3.8 to 1.9.1 #749, #767, #832, #883, #988, #991, #995. Thanks to Dependabot, Gary Gregory.
o Bump junit-bom from 5.7.1 to 5.9.1 #761, #805, #807, #836, #928, #955. Thanks to Dependabot.
o Bump maven-javadoc-plugin from 3.2.0 to 3.4.1. Thanks to Dependabot, Gary Gregory.
o Bump jmh.version from 1.27 to 1.36 #794, #842, #872, #990. Thanks to Dependabot.
o Bump maven-pmd-plugin from 3.14.0 to 3.19.0 #802, #858, #909, #948. Thanks to Dependabot.
o Bump pmd from 6.40.0 to 6.52.0 #837, #861, #873, #905, #915, #932, #944. Thanks to Dependabot.
o Bump biz.aQute.bndlib from 5.3.0 to 6.3.1 #814, #835. Thanks to Dependabot, Gary Gregory.
o Bump maven-bundle-plugin from 5.1.1 to 5.1.2. Thanks to Dependabot.
o Bump animal-sniffer-maven-plugin from 1.19 to 1.21. Thanks to Dependabot.
o Bump exec-maven-plugin from 1.6.0 to 3.1.0 #590, #922. Thanks to Dependabot.
o Bump maven-surefire-plugin from 3.0.0-M5 to 3.0.0-M7 #880, #910. Thanks to Dependabot.
o Bump apache-rat from 0.13 to 0.14. Thanks to Gary Gregory.
o Bump commons-parent from 53 to 58 #954, #1000, #1011, #1061. Thanks to Dependabot, Gary Gregory.
o Bump commons-text from 1.9 to 1.10.0 #957. Thanks to Dependabot.
o Bump commons.pmd-impl.version from 6.49.0 to 6.51.0 #961. Thanks to Dependabot, Gary Gregory.
Historical list of changes: https://commons.apache.org/proper/commons-lang/changes-report.html
For complete information on Apache Commons Lang, including instructions on how to submit bug reports,
patches, or suggestions for improvement, see the Apache Commons Lang website:
Commons Lang is a set of utility functions and reusable components that should be of use in any
Java environment.
Lang 3.9 and onwards now targets Java 8, making use of features that arrived with Java 8.
For the advice on upgrading from 2.x to 3.x, see the following page:
https://commons.apache.org/lang/article3_0.html
Apache Commons Lang, a package of Java utility classes for the
classes that are in java.lang's hierarchy, or are considered to be so
standard as to justify existence in java.lang.
New features and bug fixes.
Changes in this version include:
New features:
o Add BooleanUtils.booleanValues(). Thanks to Gary Gregory.
o Add BooleanUtils.primitiveValues(). Thanks to Gary Gregory.
o LANG-1535: Add StringUtils.containsAnyIgnoreCase(CharSequence, CharSequence...). Thanks to Gary Gregory, Isira Seneviratne.
o LANG-1359: Add StopWatch.getStopTime(). Thanks to Gary Gregory, Keegan Witt.
o More test coverage for CharSequenceUtils. #631. Thanks to Edgar Asatryan.
o Add fluent-style ArraySorter. Thanks to Gary Gregory.
o Add and use LocaleUtils.toLocale(Locale) to avoid NPEs. Thanks to Gary Gregory.
o Add FailableShortSupplier, handy for JDBC APIs. Thanks to Gary Gregory.
o Add JavaVersion.JAVA_17. Thanks to Gary Gregory.
o LANG-1636: Add missing boolean[] join method #686. Thanks to .
o Add StringUtils.substringBefore(String, int). Thanks to Gary Gregory.
o Add Range.INTEGER. Thanks to Gary Gregory.
o Add DurationUtils. Thanks to Gary Gregory.
o Introduce the use of @Nonnull, and @Nullable, and the Objects class as a helper tool.
o Add and use true and false String constants #714. Thanks to Arturo Bernal, Gary Gregory.
o Add and use ObjectUtils.requireNonEmpty() #716. Thanks to Arturo Bernal, Gary Gregory.
Fixed Bugs:
o LANG-1592: Correct implementation of RandomUtils.nextLong(long, long) Thanks to Huang Pingcai, Alex Herbert.
o LANG-1600: Restore handling of collections for non-JSON ToStringStyle #610. Thanks to Michael F.
o ContextedException Javadoc add missing semicolon #581. Thanks to iamchao1129.
o LANG-1608: Resolve JUnit pioneer transitive dependencies using JUnit BOM. Thanks to Edgar Asatryan.
o NumberUtilsTest - incorrect types in min/max tests #634. Thanks to HubertWo, Gary Gregory.
o LANG-1579: Improve StringUtils.stripAccents conversion of remaining accents. Thanks to XenoAmess.
o LANG-1606: StringUtils.countMatches - clarify Javadoc. Thanks to Rustem Galiev.
o LANG-1591: Remove redundant argument from substring call. Thanks to bhawna94.
o LANG-1613: BigDecimal is created when you pass it the min and max values, #642. Thanks to Arturo Bernal, Gary Gregory.
o LANG-1541: ArrayUtils.contains() and indexOf() fail to handle Double.NaN #647. Thanks to Arturo Bernal, Gary Gregory.
o LANG-1615: ArrayUtils contains() and indexOf() fail to handle Float.NaN # #561. Thanks to Arturo Bernal, Gary Gregory.
o Fix potential NPE in TypeUtils.isAssignable(Type, ParameterizedType, Map, Type>). Thanks to Gary Gregory.
o LANG-1420: TypeUtils.isAssignable returns wrong result for GenericArrayType and ParameterizedType, #643. Thanks to Gordon Fraser, Rostislav Krasny, Arturo Bernal, Gary Gregory.
o LANG-1612: testGetAllFields and testGetFieldsWithAnnotation sometimes fail. Thanks to XinT, Gary Gregory.
o Fix Javadoc for SystemUtils.isJavaVersionAtMost() #638. Thanks to John R. D'Orazio.
o LANG-1610: Fix StringUtils.unwrap throws StringIndexOutOfBoundsException #636. Thanks to Tony Liang.
o Fix formatting of isAnyBlank() and isAnyEmpty(). #513. Thanks to Isira Seneviratne.
o LANG-1618: TypeUtils. containsTypeVariables does not support GenericArrayType #661. Thanks to Arturo Bernal.
o LANG-1622: Javadoc of some methods incorrectly refers to another method, #667, #668. #670. Thanks to Kanak Sony, anomen-s.
o LANG-1620: Refine StringUtils.lastIndexOfIgnoreCase #664. Thanks to Arturo Bernal.
o LANG-1619: Refine StringUtils.abbreviate #663. Thanks to Arturo Bernal.
o LANG-1584: Refine StringUtils.isNumericSpace #573. Thanks to Arturo Bernal.
o LANG-1580: Refine StringUtils.deleteWhitespace #569. Thanks to Arturo Bernal.
o LANG-1626: Correction in Javadoc of some methods. #673 Thanks to Kanak Sony.
o LANG-1628: Javadoc for RandomStringUtils.random() letters, numbers parameters is wrong. Thanks to Jarkko Rantavuori.
o Correct markup in Javadoc for unbalanced braces #679. Thanks to Felix Schumacher.
o LANG-1544: MethodUtils.invokeMethod NullPointerException in case of null in args list #680. Thanks to Peter Nagy, Michael Buck, Gary Gregory.
o LANG-1637: Fix 2 digit week year formatting #688. Thanks to Uri Gonen, Gary Gregory, Michael Osipov.
o Fix broken Javadoc links to commons-text #712. Thanks to Chris Smowton.
o Add and use ThreadUtils.sleep(Duration). Thanks to Gary Gregory.
o Add and use ThreadUtils.join(Thread, Duration). Thanks to Gary Gregory.
o Add ObjectUtils.wait(Duration). Thanks to Gary Gregory.
Changes:
o LANG-1596: ArrayUtils.toPrimitive(Object) does not support boolean and other types #607. Thanks to Richard Eckart de Castilho.
o Enable Dependabot #587. Thanks to Gary Gregory.
o Bump junit-jupiter from 5.6.2 to 5.7.0.
o Bump spotbugs from 4.1.2 to 4.2.1, #627, #671, #708. Thanks to chtompki, Dependabot.
o Bump spotbugs-maven-plugin from 4.0.0 to 4.2.0, #593, #596, #609, #623, #632, #692. Thanks to Dependabot.
o Bump biz.aQute.bndlib from 5.1.1 to 5.3.0 #592, #628, #715. Thanks to Dependabot.
o Bump junit-pioneer from 0.6.0 to 1.1.0, #589, #597, #600, #624, #625, #662. Thanks to Dependabot.
o Bump checkstyle from 8.34 to 8.40, #594, #614, #637, #665, #706. Thanks to Dependabot.
o Bump actions/checkout from v2.3.1 to v2.3.4 #601, #639. Thanks to Dependabot.
o Bump actions/setup-java from v1.4.0 to v1.4.2 #612. Thanks to Dependabot.
o Update commons.jacoco.version 0.8.5 to 0.8.6 (Fixes Java 15 builds). Thanks to Gary Gregory.
o Update maven-surefire-plugin 2.22.2 -> 3.0.0-M5. Thanks to Gary Gregory.
o Bump maven-pmd-plugin from 3.13.0 to 3.14.0 #660. Thanks to Dependabot.
o Bump jmh.version from 1.21 to 1.27 #674. Thanks to Dependabot.
o Update commons.japicmp.version 0.14.3 -> 0.15.2. Thanks to Gary Gregory.
o Processor.java: check enum equality with == instead of .equals() method #690. Thanks to Ali K. Nouri.
o Bump junit-pioneer from 1.1.0 to 1.3.0 #702. Thanks to Dependabot.
o Bump maven-checkstyle-plugin from 3.1.1 to 3.1.2 #705. Thanks to Dependabot.
o Bump actions/cache from v2 to v2.1.4 #710. Thanks to Dependabot.
o Bump junit-bom from 5.7.0 to 5.7.1 #707. Thanks to Dependabot.
o Minor Improvements #701. Thanks to Arturo Bernal.
o Minor Improvement: Add final variable.try to make the code read-only #700. Thanks to Arturo Bernal.
o Minor Improvement: Remove redundant initializer #699. Thanks to Arturo Bernal.
o Use own validator ObjectUtils.anyNull to check null String input #718. Thanks to Arturo Bernal.
Historical list of changes: https://commons.apache.org/proper/commons-lang/changes-report.html
For complete information on Apache Commons Lang, including instructions on how to submit bug reports,
This document contains the release notes for the 3.11 version of Apache Commons Lang.
Commons Lang is a set of utility functions and reusable components that should be of use in any
Java environment.
Lang 3.9 and onwards now targets Java 8, making use of features that arrived with Java 8.
For the advice on upgrading from 2.x to 3.x, see the following page:
https://commons.apache.org/lang/article3_0.html
Apache Commons Lang, a package of Java utility classes for the
classes that are in java.lang's hierarchy, or are considered to be so
standard as to justify existence in java.lang.
New features and bug fixes.
Changes in this version include:
New features:
o Add ArrayUtils.isSameLength() to compare more array types #430. Thanks to XenoAmess, Gary Gregory.
o Added the Locks class as a convenient possibility to deal with locked objects.
o LANG-1568: Add to Functions: FailableBooleanSupplier, FailableIntSupplier, FailableLongSupplier, FailableDoubleSupplier, and so on.
o LANG-1569: Add ArrayUtils.get(T[], index, T) to provide an out-of-bounds default value.
o LANG-1570: Add JavaVersion enum constants for Java 14 and 15. #553. Thanks to Edgar Asatryan.
o Add JavaVersion enum constants for Java 16. Thanks to Gary Gregory.
o LANG-1556: Use Java 8 lambdas and Map operations. Thanks to XenoAmess.
o LANG-1565: Change removeLastFieldSeparator to use endsWith #550. Thanks to XenoAmess.
o LANG-1557: Change a Pattern to a static final field, for not letting it compile each time the function invoked. #542. Thanks to XenoAmess, Gary Gregory.
o Add ImmutablePair factory methods left() and right().
o Add ObjectUtils.toString(Object, Supplier<String>).
o Add org.apache.commons.lang3.StringUtils.substringAfter(String, int).
o Add org.apache.commons.lang3.StringUtils.substringAfterLast(String, int).
Fixed Bugs:
o Fix Javadoc for StringUtils.appendIfMissingIgnoreCase() #507. Thanks to contextshuffling.
o LANG-1560: Refine Javadoc #545. Thanks to XenoAmess.
o LANG-1554: Fix typos #539. Thanks to XenoAmess.
o LANG-1555: Ignored exception `ignored`, should not be called so #540. Thanks to XenoAmess.
o LANG-1528: StringUtils.replaceEachRepeatedly gives IllegalStateException #505. Thanks to Edwin Delgado H.
o LANG-1543: [JSON string for maps] ToStringBuilder.reflectionToString doesnt render nested maps correctly. Thanks to Swaraj Pal, Wander Costa, Gary Gregory.
o Correct Javadocs of methods that use Validate.notNull() and replace some uses of Validate.isTrue() with Validate.notNull(). #525. Thanks to Isira Seneviratne.
o LANG-1539: Add allNull() and anyNull() methods to ObjectUtils. #522. Thanks to Isira Seneviratne.
Changes:
o Refine test output for FastDateParserTest Thanks to Jin Xu.
o LANG-1549: CharSequenceUtils.lastIndexOf : remake it Thanks to Jin Xu.
o remove encoding and docEncoding and use inherited values from commons-parent Thanks to XenoAmess.
o Simplify null checks in Pair.hashCode() using Objects.hashCode(). #517. Thanks to Isira Seneviratne, Bruno P. Kinoshita.
o Simplify null checks in Triple.hashCode() using Objects.hashCode(). #516. Thanks to Isira Seneviratne, Bruno P. Kinoshita.
o Simplify some if statements in StringUtils. #521. Thanks to Isira Seneviratne, Bruno P. Kinoshita.
o LANG-1537: Simplify a null check in the private replaceEach() method of StringUtils. #514. Thanks to Isira Seneviratne, Bruno P. Kinoshita.
o LANG-1534: Replace some usages of the ternary operator with calls to Math.max() and Math.min() #512. Thanks to Isira Seneviratne, Bruno P. Kinoshita.
o (Javadoc) Fix return tag for throwableOf*() methods #518. Thanks to Arend v. Reinersdorff, Bruno P. Kinoshita.
o LANG-1545: CharSequenceUtils.regionMatches is wrong dealing with Georgian. Thanks to XenoAmess, Gary Gregory.
o LANG-1550: Optimize ArrayUtils::isArrayIndexValid method. #551. Thanks to Edgar Asatryan.
o LANG-1561: Use List.sort instead of Collection.sort #546. Thanks to XenoAmess.
o LANG-1563: Use StandardCharsets.UTF_8 #548. Thanks to XenoAmess.
o LANG-1564: Use Collections.singletonList insteadof Arrays.asList when there be only one element. #549. Thanks to XenoAmess.
o LANG-1553: Change array style from `int a[]` to `int[] a` #537. Thanks to XenoAmess.
o LANG-1552: Change from addAll to constructors for some List #536. Thanks to XenoAmess.
o LANG-1558: Simplify if as some conditions are covered by others #543. Thanks to XenoAmess.
o LANG-1567: Fixed Javadocs for setTestRecursive() #556. Thanks to Miguel Mu<4D>oz, Bruno P. Kinoshita, Gary Gregory.
o LANG-1542: ToStringBuilder.reflectionToString - Wrong JSON format when object has a List of Enum. Thanks to Tr?n Ng?c Khoa, Gary Gregory.
o Make org.apache.commons.lang3.CharSequenceUtils.toCharArray(CharSequence) public.
o org.apache.commons:commons-parent 50 -> 51.
o org.junit-pioneer:junit-pioneer 0.5.4 -> 0.6.0.
o org.junit.jupiter:junit-jupiter 5.6.0 -> 5.6.2.
o com.github.spotbugs:spotbugs 4.0.0 -> 4.0.6.
o com.puppycrawl.tools:checkstyle 8.29 -> 8.34.
o commons.surefire.version 3.0.0-M4 -> 3.0.0-M5..
Historical list of changes: https://commons.apache.org/proper/commons-lang/changes-report.html
For complete information on Apache Commons Lang, including instructions on how to submit bug reports,
This document contains the release notes for the 3.10 version of Apache Commons Lang.
Commons Lang is a set of utility functions and reusable components that should be of use in any
Java environment.
Lang 3.9 and onwards now targets Java 8, making use of features that arrived with Java 8.
For the advice on upgrading from 2.x to 3.x, see the following page:
https://commons.apache.org/lang/article3_0.html
Apache Commons Lang, a package of Java utility classes for the
classes that are in java.lang's hierarchy, or are considered to be so
standard as to justify existence in java.lang.
New features and bug fixes. Requires Java 8, supports Java 9, 10, 11.
Changes in this version include:
New features:
o LANG-1457: Add ExceptionUtils.throwableOfType(Throwable, Class) and friends.
o LANG-1458: Add EMPTY_ARRAY constants to classes in org.apache.commons.lang3.tuple.
o LANG-1461: Add null-safe StringUtils APIs to wrap String#getBytes([Charset|String]).
o LANG-1467: Add zero arg constructor for org.apache.commons.lang3.NotImplementedException.
o LANG-1470: Add ArrayUtils.addFirst() methods.
o LANG-1479: Add Range.fit(T) to fit a value into a range.
o LANG-1477: Added Functions.as*, and tests thereof, as suggested by Peter Verhas
o LANG-1485: Add getters for lhs and rhs objects in DiffResult #451. Thanks to nicolasbd.
o LANG-1486: Generify builder classes Diffable, DiffBuilder, and DiffResult #452. Thanks to Gary Gregory.
o LANG-1487: Add ClassLoaderUtils with toString() implementations #453. Thanks to Gary Gregory.
o LANG-1489: Add null-safe APIs as StringUtils.toRootLowerCase(String) and StringUtils.toRootUpperCase(String) #456. Thanks to Gary Gregory.
o LANG-1494: Add org.apache.commons.lang3.time.Calendars. Thanks to Gary Gregory.
o LANG-1495: Add EnumUtils getEnum() methods with default values #475. Thanks to Cheong Voon Leong.
o LANG-1177: Added indexesOf methods and simplified removeAllOccurences #471. Thanks to Liel Fridman.
o LANG-1498: Add support of lambda value evaluation for defaulting methods #416. Thanks to Lysergid, Gary Gregory.
o LANG-1503: Add factory methods to Pair classes with Map.Entry input. #454. Thanks to XenoAmess, Gary Gregory.
o LANG-1505: Add StopWatch convenience APIs to format times and create a simple instance. Thanks to Gary Gregory.
o LANG-1506: Allow a StopWatch to carry an optional message. Thanks to Gary Gregory.
o LANG-1507: Add ComparableUtils #398. Thanks to Sam Kruglov, Mark Dacek, Marc Magon, Pascal Schumacher, Rob Tompkins, Bruno P. Kinoshita, Amey Jadiye, Gary Gregory.
o LANG-1508: Add org.apache.commons.lang3.SystemUtils.getUserName(). Thanks to Gary Gregory.
o LANG-1509: Add ObjectToStringComparator. #483. Thanks to Gary Gregory.
o LANG-1510: Add org.apache.commons.lang3.arch.Processor.Arch.getLabel(). Thanks to Gary Gregory.
o LANG-1512: Add IS_JAVA_14 and IS_JAVA_15 to org.apache.commons.lang3.SystemUtils. Thanks to Gary Gregory.
o LANG-1513: ObjectUtils: Get first non-null supplier value. Thanks to Bernhard Bonigl, Gary Gregory.
o Added the Streams class, and Functions.stream() as an accessor thereof.
Fixed Bugs:
o LANG-1514: Make test more stable by wrapping assertions in hashset. Thanks to contextshuffling.
o LANG-1450: Generate Javadoc jar on build.
o LANG-1460: Trivial: year of release for 3.9 says 2018, should be 2019 Thanks to Larry West.
o LANG-1476: Use synchronize on a set created with Collections.synchronizedSet before iterating Thanks to emopers.
o LANG-1475: StringUtils.unwrap incorrect throw StringIndexOutOfBoundsException. Thanks to stzx.
o LANG-1406: StringIndexOutOfBoundsException in StringUtils.replaceIgnoreCase #423. Thanks to geratorres.
o LANG-1453: StringUtils.removeIgnoreCase("?a", "a") throws IndexOutOfBoundsException #423. Thanks to geratorres.
o LANG-1426: Corrected usage examples in Javadocs #458. Thanks to Brower, Mikko Maunu, Suraj Gautam.
o LANG-1463: StringUtils abbreviate returns String of length greater than maxWidth #477. Thanks to bbeckercscc, Gary Gregory.
o LANG-1500: Test may fail due to a different order of fields returned by reflection api #480. Thanks to contextshuffling.
o LANG-1501: Sort fields in ReflectionToStringBuilder for deterministic order #481. Thanks to contextshuffling.
o LANG-1433: MethodUtils will throw a NPE if invokeMethod() is called for a var-args method #407. Thanks to Christian Franzen.
o LANG-1518: MethodUtils.getAnnotation() with searchSupers = true does not work if super is generic #494. Thanks to Michele Preti, Bruno P. Kinoshita, Gary Gregory.
Changes:
o LANG-1437: Remove redundant if statements in join methods #411. Thanks to Andrei Troie.
o commons.japicmp.version 0.13.1 -> 0.14.1.
o junit-jupiter 5.5.0 -> 5.5.1.
o junit-jupiter 5.5.1 -> 5.5.2.
o Improve Javadoc based on the discussion of the GitHub PR #459. Thanks to Jonathan Leitschuh, Bruno P. Kinoshita, Rob Tompkins, Gary Gregory.
o maven-checkstyle-plugin 3.0.0 -> 3.1.0.
o LANG-696: Update documentation related to the issue LANG-696 #449. Thanks to Peter Verhas.
o AnnotationUtils little cleanup #467. Thanks to Peter Verhas.
o Update test dependency: org.easymock:easymock 4.0.2 -> 4.1. Thanks to Gary Gregory.
o Update test dependency: org.hamcrest:hamcrest 2.1 -> 2.2. Thanks to Gary Gregory.
o Update test dependency: org.junit-pioneer:junit-pioneer 0.3.0 -> 0.4.2. Thanks to Gary Gregory.
o Update build dependency: com.puppycrawl.tools:checkstyle 8.18 -> 8.27. Thanks to Gary Gregory.
o Update POM parent: org.apache.commons:commons-parent 48 -> 50. Thanks to Gary Gregory.
o BooleanUtils Javadoc #469. Thanks to Peter Verhas.
o Functions Javadoc #466. Thanks to Peter Verhas.
o org.easymock:easymock 4.1 -> 4.2. Thanks to Gary Gregory.
o org.junit-pioneer:junit-pioneer 0.4.2 -> 0.5.4. Thanks to Gary Gregory.
o org.junit.jupiter:junit-jupiter 5.5.2 -> 5.6.0. Thanks to Gary Gregory.
o Use Javadoc {@code} instead of pre tags. #490. Thanks to Peter Verhas.
o ExceptionUtilsTest to 100% #486. Thanks to Peter Verhas.
o Reuse own code in Functions.java #493. Thanks to Peter Verhas.
o LANG-1523: Avoid unnecessary allocation in StringUtils.wrapIfMissing. #496. Thanks to Edgar Asatryan, Bruno P. Kinoshita, Gary Gregory.
o LANG-1525: Internally use Validate.notNull(foo, ...) instead of Validate.isTrue(foo != null, ...). Thanks to Edgar Asatryan, Bruno P. Kinoshita, Gary Gregory.
o LANG-1526: Add 1 and 0 in toBooleanObject(final String str) #502. Thanks to Dominik Schramm.
o LANG-1527: Remove an redundant argument check in NumberUtils #504. Thanks to Pengyu Nie.
o LANG-1529: Deprecate org.apache.commons.lang3.ArrayUtils.removeAllOccurences(*) for org.apache.commons.lang3.ArrayUtils.removeAllOccurrences(*). Thanks to Gary Gregory, BillCindy, Bruno P. Kinoshita.
Historical list of changes: https://commons.apache.org/proper/commons-lang/changes-report.html
For complete information on Apache Commons Lang, including instructions on how to submit bug reports,
o LANG-1352: EnumUtils.getEnumIgnoreCase and isValidEnumIgnoreCase methods added Thanks to Ruslan Sibgatullin.
o LANG-1372: Add ToStringSummary annotation Thanks to S<>rgio Ozaki.
o LANG-1356: Add bypass option for classes to recursive and reflective EqualsBuilder Thanks to Yathos UG.
o LANG-1391: Improve Javadoc for StringUtils.isAnyEmpty(null) Thanks to Sauro Matulli, Oleg Chubaryov.
o LANG-1393: Add API SystemUtils.String getEnvironmentVariable(final String name, final String defaultValue) Thanks to Gary Gregory.
o LANG-1394: org.apache.commons.lang3.SystemUtils should not write to System.err. Thanks to Sebb, Gary Gregory.
o LANG-1238: Add RegexUtils class instead of overloading methods in StringUtils that take a regex to take precompiled Pattern. Thanks to Christopher Cordeiro, Gary Gregory, Bruno P. Kinoshita, Oleg Chubaryov.