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