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