xref: /aosp_15_r20/external/apache-commons-lang/src/site/resources/release-notes/RELEASE-NOTES-3.2.txt (revision 455610af95f3bf5f4bc8a9eda520f57e389a4c42)
1Licensed to the Apache Software Foundation (ASF) under one or more
2contributor license agreements.  See the NOTICE file distributed with
3this work for additional information regarding copyright ownership.
4The ASF licenses this file to You under the Apache License, Version 2.0
5(the "License"); you may not use this file except in compliance with
6the License.  You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15
16=============================================================================
17
18                           Apache Commons Lang
19                               Version 3.2
20                              Release Notes
21
22
23INTRODUCTION:
24
25This document contains the release notes for the 3.2 version of
26Apache Commons Lang. Commons Lang is a set of utility functions and reusable
27components that should be of use in any Java environment. Commons Lang 3.2
28at least requires Java 6.0.
29
30For the advice on upgrading from 2.x to 3.x, see the following page:
31
32    https://commons.apache.org/lang/article3_0.html
33
34COMPATIBILITY WITH 3.1
35========================
36
37This release introduces backwards incompatible changes in
38org.apache.commons.lang3.time.FastDateFormat:
39o Method 'protected java.util.List parsePattern()' has been removed
40o Method 'protected java.lang.String parseToken(java.lang.String, int[])' has
41  been removed
42o Method 'protected org.apache.commons.lang3.time.FastDateFormat$NumberRule
43  selectNumberRule(int, int)' has been removed
44
45These changes were the result of [LANG-462]. It is assumed that this change
46will not break clients as Charles Honton pointed out on 25/Jan/12:
47"
48 1. Methods "FastDateFormat$NumberRule selectNumberRule(int, int)" and
49    "List<Rule> parsePattern()" couldn't have been overridden because
50    NumberRule and Rule were private to FastDateFormat.
51 2. Due to the factory pattern used, it's unlikely other two methods would have
52    been overridden.
53 3. The four methods are highly implementation specific. I consider it a
54    mistake that the methods were exposed.
55"
56For more information see https://issues.apache.org/jira/browse/LANG-462.
57
58NEW FEATURES
59==============
60
61o LANG-934:  Add removeFinalModifier to FieldUtils
62o LANG-863:  Method returns number of inheritance hops between parent and
63             subclass. Thanks to Daneel S. Yaitskov.
64o LANG-774:  Added isStarted, isSuspended and isStopped to StopWatch.
65             Thanks to Erhan Bagdemir.
66o LANG-848:  Added StringUtils.isBlank/isEmpty CharSequence... methods.
67             Thanks to Alexander Muthmann.
68o LANG-926:  Added ArrayUtils.reverse(array, from, to) methods.
69o LANG-795:  StringUtils.toString(byte[], String) deprecated in favour of a new
70             StringUtils.toString(byte[], CharSet). Thanks to Aaron Digulla.
71o LANG-893:  StrSubstitutor now supports default values for variables.
72             Thanks to Woonsan Ko.
73o LANG-913:  Adding .gitignore to commons-lang. Thanks to Allon Mureinik.
74o LANG-837:  Add ObjectUtils.toIdentityString methods that support
75             StringBuilder, StrBuilder, and Appendable.
76o LANG-886:  Added CharSetUtils.containsAny(String, String).
77o LANG-797:  Added escape/unescapeJson to StringEscapeUtils.
78o LANG-875:  Added appendIfMissing and prependIfMissing methods to StringUtils.
79o LANG-870:  Add StringUtils.LF and StringUtils.CR values.
80o LANG-873:  Add FieldUtils getAllFields() to return all the fields defined in
81             the given class and super classes.
82o LANG-835:  StrBuilder should support StringBuilder as an input parameter.
83o LANG-857:  StringIndexOutOfBoundsException in CharSequenceTranslator.
84o LANG-856:  Code refactoring in NumberUtils.
85o LANG-855:  NumberUtils#createBigInteger does not allow for hex and octal
86             numbers.
87o LANG-854:  NumberUtils#createNumber - does not allow for hex numbers to be
88             larger than Long.
89o LANG-853:  StringUtils join APIs for primitives.
90o LANG-841:  Add StringUtils API to call String.replaceAll in DOTALL a.k.a.
91             single-line mode.
92o LANG-825:  Create StrBuilder APIs similar to
93             String.format(String, Object...).
94o LANG-675:  Add Triple class (ternary version of Pair).
95o LANG-462:  FastDateFormat supports parse methods.
96
97BUG FIXES
98===========
99
100o LANG-932:  Spelling fixes. Thanks to Ville Skyttä.
101o LANG-929:  OctalUnescaper tried to parse all of \279.
102o LANG-928:  OctalUnescaper had bugs when parsing octals starting with a zero.
103o LANG-905:  EqualsBuilder returned true when comparing arrays, even when the
104             elements are different.
105o LANG-917:  Fixed exception when combining custom and choice format in
106             ExtendedMessageFormat. Thanks to Arne Burmeister.
107o LANG-902:  RandomStringUtils.random javadoc was incorrectly promising letters
108             and numbers would, as opposed to may, appear  Issue:. Thanks to
109             Andrzej Winnicki.
110o LANG-921:  BooleanUtils.xor(boolean...) produces wrong results.
111o LANG-896:  BooleanUtils.toBoolean(String str) javadoc is not updated. Thanks
112             to Mark Bryan Yu.
113o LANG-879:  LocaleUtils test fails with new Locale "ja_JP_JP_#u-ca-japanese"
114             of JDK7.
115o LANG-836:  StrSubstitutor does not support StringBuilder or CharSequence.
116             Thanks to Arnaud Brunet.
117o LANG-693:  Method createNumber from NumberUtils doesn't work for floating
118             point numbers other than Float  Issue: LANG-693. Thanks to
119             Calvin Echols.
120o LANG-887:  FastDateFormat does not use the locale specific cache correctly.
121o LANG-754:  ClassUtils.getShortName(String) will now only do a reverse lookup
122             for array types.
123o LANG-881:  NumberUtils.createNumber() Javadoc says it does not work for octal
124             numbers.
125o LANG-865:  LocaleUtils.toLocale does not parse strings starting with an
126             underscore.
127o LANG-858:  StringEscapeUtils.escapeJava() and escapeEcmaScript() do not
128             output the escaped surrogate pairs that are Java parsable.
129o LANG-849:  FastDateFormat and FastDatePrinter generates Date objects
130             wastefully.
131o LANG-845:  Spelling fixes.
132o LANG-844:  Fix examples contained in javadoc of StringUtils.center methods.
133o LANG-832:  FastDateParser does not handle unterminated quotes correctly.
134o LANG-831:  FastDateParser does not handle white-space properly.
135o LANG-830:  FastDateParser could use \Q \E to quote regexes.
136o LANG-828:  FastDateParser does not handle non-Gregorian calendars properly.
137o LANG-826:  FastDateParser does not handle non-ASCII digits correctly.
138o LANG-822:  NumberUtils#createNumber - bad behavior for leading "--".
139o LANG-818:  FastDateFormat's "z" pattern does not respect timezone of Calendar
140             instances passed to format().
141o LANG-817:  Add org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS_8.
142o LANG-813:  StringUtils.equalsIgnoreCase doesn't check string reference
143             equality.
144o LANG-810:  StringUtils.join() endIndex, bugged for loop.
145o LANG-807:  RandomStringUtils throws confusing IAE when end <= start.
146o LANG-805:  RandomStringUtils.random(count, 0, 0, false, false, universe,
147             random) always throws java.lang.ArrayIndexOutOfBoundsException.
148o LANG-802:  LocaleUtils - unnecessary recursive call in SyncAvoid class.
149o LANG-800:  Javadoc bug in DateUtils#ceiling for Calendar and Object versions.
150o LANG-788:  SerializationUtils throws ClassNotFoundException when cloning
151             primitive classes.
152o LANG-786:  StringUtils equals() relies on undefined behavior.
153o LANG-783:  Documentation bug: StringUtils.split.
154o LANG-777:  jar contains velocity template of release notes.
155o LANG-776:  TypeUtilsTest contains incorrect type assignability assertion.
156o LANG-775:  TypeUtils.getTypeArguments() misses type arguments for
157             partially-assigned classes.
158o LANG-773:  ImmutablePair doc contains nonsense text.
159o LANG-772:  ClassUtils.PACKAGE_SEPARATOR Javadoc contains garbage text.
160o LANG-765:  EventListenerSupport.ProxyInvocationHandler no longer defines
161             serialVersionUID.
162o LANG-764:  StrBuilder is now serializable.
163o LANG-761:  Fix Javadoc Ant warnings.
164o LANG-747:  NumberUtils does not handle Long Hex numbers.
165o LANG-743:  Javadoc bug in static inner class DateIterator.
166
167CHANGES
168=========
169
170o LANG-931:  Misleading Javadoc comment in StrBuilderReader class. Thanks
171             to Christoph Schneegans.
172o LANG-910:  StringUtils.normalizeSpace now handles non-breaking spaces
173             (Unicode 00A0). Thanks to Timur Yarosh.
174o LANG-804:  Redundant check for zero in HashCodeBuilder ctor. Thanks to
175             Allon Mureinik.
176o LANG-884:  Simplify FastDateFormat; eliminate boxing.
177o LANG-882:  LookupTranslator now works with implementations of CharSequence
178             other than String.
179o LANG-846:  Provide CharSequenceUtils.regionMatches with a proper green
180             implementation instead of inefficiently converting to Strings.
181o LANG-839:  ArrayUtils removeElements methods use unnecessary HashSet.
182o LANG-838:  ArrayUtils removeElements methods clone temporary index arrays
183             unnecessarily.
184o LANG-799:  DateUtils#parseDate uses default locale; add Locale support.
185o LANG-798:  Use generics in SerializationUtils.
186
187CHANGES WITHOUT TICKET
188========================
189
190o Fixed URLs in javadoc to point to new oracle.com pages
191
192
193                        Release Notes for version 3.1
194
195NEW FEATURES
196==============
197
198o LANG-801:  Add Conversion utility to convert between data types on byte level
199o LANG-760:  Add API StringUtils.toString(byte[] input, String charsetName)
200o LANG-756:  Add APIs ClassUtils.isPrimitiveWrapper(Class<?>) and
201             isPrimitiveOrWrapper(Class<?>)
202o LANG-695:  SystemUtils.IS_OS_UNIX doesn't recognize FreeBSD as a Unix system
203
204BUG FIXES
205===========
206
207o LANG-749:  Incorrect Bundle-SymbolicName in Manifest
208o LANG-746:  NumberUtils does not handle upper-case hex: 0X and -0X
209o LANG-744:  StringUtils throws java.security.AccessControlException on Google
210             App Engine
211o LANG-741:  Ant build has wrong component.name
212o LANG-698:  Document that the Mutable numbers don't work as expected with
213             String.format
214
215CHANGES
216=========
217
218o LANG-758:  Add an example with whitespace in StringUtils.defaultIfEmpty
219o LANG-752:  Fix createLong() so it behaves like createInteger()
220o LANG-751:  Include the actual type in the Validate.isInstance and
221             isAssignableFrom exception messages
222o LANG-748:  Deprecating chomp(String, String)
223o LANG-736:  CharUtils static final array CHAR_STRING is not needed to compute
224             CHAR_STRING_ARRAY
225
226
227                        Release Notes for version 3.0
228
229ADDITIONS
230===========
231
232o LANG-276:  MutableBigDecimal and MutableBigInteger.
233o LANG-285:  Wish : method unaccent.
234o LANG-358:  ObjectUtils.coalesce.
235o LANG-386:  LeftOf/RightOfNumber in Range convenience methods necessary.
236o LANG-435:  Add ClassUtils.isAssignable() variants with autoboxing.
237o LANG-444:  StringUtils.emptyToNull.
238o LANG-482:  Enhance StrSubstitutor to support nested ${var-${subvr}} expansion
239o LANG-482:  StrSubstitutor now supports substitution in variable names.
240o LANG-496:  A generic implementation of the Lazy initialization pattern.
241o LANG-497:  Addition of ContextedException and ContextedRuntimeException.
242o LANG-498:  Add StringEscapeUtils.escapeText() methods.
243o LANG-499:  Add support for the handling of ExecutionExceptions.
244o LANG-501:  Add support for background initialization.
245o LANG-529:  Add a concurrent package.
246o LANG-533:  Validate: support for validating blank strings.
247o LANG-537:  Add ArrayUtils.toArray to create generic arrays.
248o LANG-545:  Add ability to create a Future for a constant.
249o LANG-546:  Add methods to Validate to check whether the index is valid for
250             the array/list/string.
251o LANG-553:  Add TypeUtils class to provide utility code for working with generic
252             types.
253o LANG-559:  Added isAssignableFrom and isInstanceOf validation methods.
254o LANG-559:  Added validState validation method.
255o LANG-560:  New TimedSemaphore class.
256o LANG-582:  Provide an implementation of the ThreadFactory interface.
257o LANG-588:  Create a basic Pair<L, R> class.
258o LANG-594:  DateUtils equal & compare functions up to most significant field.
259o LANG-601:  Add Builder Interface / Update Builders to Implement It.
260o LANG-609:  Support lazy initialization using atomic variables
261o LANG-610:  Extend exception handling in ConcurrentUtils to runtime exceptions.
262o LANG-614:  StringUtils.endsWithAny method
263o LANG-640:  Add normalizeSpace to StringUtils
264o LANG-644:  Provide documentation about the new concurrent package
265o LANG-649:  BooleanUtils.toBooleanObject to support single character input
266o LANG-651:  Add AnnotationUtils
267o LANG-653:  Provide a very basic ConcurrentInitializer implementation
268o LANG-655:  Add StringUtils.defaultIfBlank()
269o LANG-667:  Add a Null-safe compare() method to ObjectUtils
270o LANG-676:  Documented potential NPE if auto-boxing occurs for some BooleanUtils
271             methods
272o LANG-678:  Add support for ConcurrentMap.putIfAbsent()
273o LANG-692:  Add hashCodeMulti varargs method
274o LANG-697:  Add FormattableUtils class
275o LANG-684:  Levenshtein Distance Within a Given Threshold
276
277REMOVALS
278==========
279
280o LANG-438:  Remove @deprecateds.
281o LANG-492:  Remove code handled now by the JDK.
282o LANG-493:  Remove code that does not hold enough value to remain.
283o LANG-590:  Remove JDK 1.2/1.3 bug handling in
284             StringUtils.indexOf(String, String, int).
285o LANG-673:  WordUtils.abbreviate() removed
286o LANG-691:  Removed DateUtils.UTC_TIME_ZONE
287
288IMPROVEMENTS
289==============
290
291o LANG-290:  EnumUtils for JDK 5.0.
292o LANG-336:  Finally start using generics.
293o LANG-355:  StrBuilder should implement CharSequence and Appendable.
294o LANG-396:  Investigate for vararg usages.
295o LANG-424:  Improve Javadoc for StringUtils class.
296o LANG-458:  Refactor Validate.java to eliminate code redundancy.
297o LANG-479:  Document where in SVN trunk is.
298o LANG-504:  bring ArrayUtils.isEmpty to the generics world.
299o LANG-505:  Rewrite StringEscapeUtils.
300o LANG-507:  StringEscapeUtils.unescapeJava should support \u+ notation.
301o LANG-510:  Convert StringUtils API to take CharSequence.
302o LANG-513:  Better EnumUtils.
303o LANG-528:  Mutable classes should implement an appropriately typed Mutable
304             interface.
305o LANG-539:  Compile commons.lang for CDC 1.1/Foundation 1.1.
306o LANG-540:  Make NumericEntityEscaper immutable.
307o LANG-541:  Replace StringBuffer with StringBuilder.
308o LANG-548:  Use Iterable on API instead of Collection.
309o LANG-551:  Replace Range classes with generic version.
310o LANG-562:  Change Maven groupId.
311o LANG-563:  Change Java package name.
312o LANG-570:  Do the test cases really still require main() and suite() methods?
313o LANG-579:  Add new Validate methods.
314o LANG-599:  ClassUtils.getClass(): Allow Dots as Inner Class Separators.
315o LANG-605:  DefaultExceptionContext overwrites values in recursive situations.
316o LANG-668:  Change ObjectUtils min() & max() functions to use varargs rather
317             than just two parameters
318o LANG-681:  Push down WordUtils to "text" sub-package.
319o LANG-711:  Add includeantruntime=false to javac targets to quell warnings in
320             ant 1.8.1 and better (and modest performance gain).
321o LANG-713:  Increase test coverage of FieldUtils read methods and tweak
322             javadoc.
323o LANG-718:  build.xml Java 1.5+ updates.
324
325BUG FIXES
326===========
327
328o LANG-11:   Depend on JDK 1.5+.
329o LANG-302:  StrBuilder does not implement clone().
330o LANG-339:  StringEscapeUtils.escapeHtml() escapes multibyte characters like
331             Chinese, Japanese, etc.
332o LANG-369:  ExceptionUtils not thread-safe.
333o LANG-418:  Javadoc incorrect for StringUtils.endsWithIgnoreCase.
334o LANG-428:  StringUtils.isAlpha, isAlphanumeric and isNumeric now return false
335             for ""
336o LANG-439:  StringEscapeUtils.escapeHTML() does not escape chars (0x00-0x20).
337o LANG-448:  Lower Ascii Characters don't get encoded by Entities.java.
338o LANG-468:  JDK 1.5 build/runtime failure on LANG-393 (EqualsBuilder).
339o LANG-474:  Fixes for thread safety.
340o LANG-478:  StopWatch does not resist to system time changes.
341o LANG-480:  StringEscapeUtils.escapeHtml incorrectly converts unicode
342             characters above U+00FFFF into 2 characters.
343o LANG-481:  Possible race-conditions in hashCode of the range classes.
344o LANG-564:  Improve StrLookup API documentation.
345o LANG-568:  @SuppressWarnings("unchecked") is used too generally.
346o LANG-571:  ArrayUtils.add(T[:  array, T element) can create unexpected
347             ClassCastException.
348o LANG-585:  exception.DefaultExceptionContext.getFormattedExceptionMessage
349             catches Throwable.
350o LANG-596:  StrSubstitutor should also handle the default properties of a
351             java.util.Properties class
352o LANG-600:  Javadoc is incorrect for public static int
353             lastIndexOf(String str, String searchStr).
354o LANG-602:  ContextedRuntimeException no longer an 'unchecked' exception.
355o LANG-606:  EqualsBuilder causes StackOverflowException.
356o LANG-608:  Some StringUtils methods should take an int character instead of
357             char to use String API features.
358o LANG-617:  StringEscapeUtils.escapeXML() can't process UTF-16 supplementary
359             characters
360o LANG-624:  SystemUtils.getJavaVersionAsFloat throws
361             StringIndexOutOfBoundsException on Android runtime/Dalvik VM
362o LANG-629:  Charset may not be threadsafe, because the HashSet is not synch.
363o LANG-638:  NumberUtils createNumber throws a StringIndexOutOfBoundsException
364             when argument containing "e" and "E" is passed in
365o LANG-643:  Javadoc StringUtils.left() claims to throw on negative len, but
366             doesn't
367o LANG-645:  FastDateFormat.format() outputs incorrect week of year because
368             locale isn't respected
369o LANG-646:  StringEscapeUtils.unescapeJava doesn't handle octal escapes and
370             Unicode with extra u
371o LANG-656:  Example StringUtils.indexOfAnyBut("zzabyycdxx", '') = 0 incorrect
372o LANG-658:  Some entities like &Ouml; are not matched properly against its
373             ISO8859-1 representation
374o LANG-659:  EntityArrays typo: {"\u2122", "&minus;"}, // minus sign, U+2212
375             ISOtech
376o LANG-66:   StringEscaper.escapeXml() escapes characters > 0x7f.
377o LANG-662:  org.apache.commons.lang3.math.Fraction does not reduce
378             (Integer.MIN_VALUE, 2^k)
379o LANG-663:  org.apache.commons.lang3.math.Fraction does not always succeed in
380             multiplyBy and divideBy
381o LANG-664:  NumberUtils.isNumber(String) is not right when the String is
382             "1.1L"
383o LANG-672:  Doc bug in DateUtils#ceiling
384o LANG-677:  DateUtils.isSameLocalTime compares using 12-hour clock and not
385             24-hour
386o LANG-685:  EqualsBuilder synchronizes on HashCodeBuilder.
387o LANG-703:  StringUtils.join throws NPE when toString returns null for one of
388             objects in collection
389o LANG-710:  StringIndexOutOfBoundsException when calling unescapeHtml4("&#03")
390o LANG-714:  StringUtils doc/comment spelling fixes.
391o LANG-715:  CharSetUtils.squeeze() speedup.
392o LANG-716:  swapCase and *capitalize speedups.
393
394
395Historical list of changes: https://commons.apache.org/lang/changes-report.html
396
397For complete information on Commons Lang, including instructions on how to
398submit bug reports, patches, or suggestions for improvement, see the
399Apache Commons Lang website:
400
401https://commons.apache.org/lang/
402
403Have fun!
404-Apache Commons Lang team
405
406