1 2Licensed to the Apache Software Foundation (ASF) under one or more 3contributor license agreements. See the NOTICE file distributed with 4this work for additional information regarding copyright ownership. 5The ASF licenses this file to You under the Apache License, Version 2.0 6(the "License"); you may not use this file except in compliance with 7the License. You may obtain a copy of the License at 8 9http://www.apache.org/licenses/LICENSE-2.0 10 11Unless required by applicable law or agreed to in writing, software 12distributed under the License is distributed on an "AS IS" BASIS, 13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14See the License for the specific language governing permissions and 15limitations under the License. 16 17============================================================================= 18 19 Release Notes for version 3.5 20 21 22HIGHLIGHTS 23========== 24 25Some of the highlights in this release include: 26 27o Added Java 9 detection to org.apache.commons.lang3.SystemUtils. 28o Support for shifting and swapping elements in 29 org.apache.commons.lang3.ArrayUtils. 30o New methods for generating random strings from different character classes 31 including alphabetic, alphanumeric and ASCII added to 32 org.apache.commons.lang3.RandomStringUtils. 33o Numerous extensions to org.apache.commons.lang3.StringUtils including 34 null safe compare variants, more remove and replace variants, rotation and 35 truncation. 36o Added org.apache.commons.lang3.ThreadUtils - a utility class to work with 37 instances of java.lang.Thread and java.lang.ThreadGroup. 38o Added annotations @EqualsExclude, @HashCodeExclude and @ToStringExclude to 39 mark fields which should be ignored by the reflective builders in the 40 org.apache.commons.lang3.builder package. 41o Support for various modify and retrieve value use cases added to the classes 42 in org.apache.commons.lang3.mutable. 43 44COMPATIBILITY 45============= 46 47Apache Commons Lang 3.5 is binary compatible with the 3.4 release. Users 48should not experience any problems when upgrading from 3.4 to 3.5. 49 50There has been an addition to the org.apache.commons.lang3.time.DatePrinter 51interface: 52 53o Added method 'public boolean parse(java.lang.String, java.text.ParsePosition, 54 java.util.Calendar)' 55o Added method 'public java.lang.Appendable format(long, java.lang.Appendable)' 56o Added method 'public java.lang.Appendable format(java.util.Date, 57 java.lang.Appendable)' 58o Added method 'public java.lang.Appendable format(java.util.Calendar, 59 java.lang.Appendable)' 60 61For this reason 3.5 is not strictly source compatible to 3.4. Since the 62DatePrinter interface is not meant to be implemented by clients, this 63change it not considered to cause any problems. 64 65JAVA 9 SUPPORT 66============== 67 68Java 9 introduces a new version-string scheme. Details of this new scheme are 69documented in JEP-223 (https://openjdk.org/jeps/223). In order to support 70JEP-223 two classes had to be changed: 71 72o org.apache.commons.lang3.JavaVersion 73 deprecated enum constant JAVA_1_9 74 introduced enum constant JAVA_9 75 76o org.apache.commons.lang3.SystemUtils 77 deprecated constant IS_JAVA_1_9 78 introduced constant IS_JAVA_9 79 80For more information see LANG-1197 81(https://issues.apache.org/jira/browse/LANG-1197). All other APIs are expected 82to work with Java 9. 83 84BUILDING ON JAVA 9 85================== 86 87Java 8 introduced the Unicode Consortium's Common Locale Data Repository as 88alternative source for locale data. Java 9 will use the CLDR provider as 89default provider for locale data (see https://openjdk.org/jeps/252). This 90causes a number of locale-sensitive test in Commons Lang to fail. In order 91to build Commons Lang 3.5 on Java 9, the locale provider has to be set to 92'JRE': 93 94 mvn -Djava.locale.providers=JRE clean install 95 96We are currently investigating ways to support building on Java 9 without 97further configuration. For more information see: 98https://issues.apache.org/jira/browse/LANG-1265 99 100 101NEW FEATURES 102============== 103 104o LANG-1275: Added a tryAcquire() method to TimedSemaphore. 105o LANG-1255: Add DateUtils.toCalendar(Date, TimeZone). Thanks to Kaiyuan Wang. 106o LANG-1023: Add WordUtils.wrap overload with customizable breakable character. 107 Thanks to Marko Bekhta. 108o LANG-787: Add method removeIgnoreCase(String, String) to StringUtils. Thanks 109 to Gokul Nanthakumar C. 110o LANG-1224: Extend RandomStringUtils with methods that generate strings 111 between a min and max length. Thanks to Caleb Cushing. 112o LANG-1257: Add APIs StringUtils.wrapIfMissing(String, char|String). Thanks to 113 Gary Gregory. 114o LANG-1253: Add RandomUtils#nextBoolean() method. Thanks to adilek. 115o LANG-1085: Add a circuit breaker implementation. Thanks to Oliver Heger and 116 Bruno P. Kinoshita. 117o LANG-1013: Add StringUtils.truncate(). Thanks to Thiago Andrade. 118o LANG-1195: Enhance MethodUtils to allow invocation of private methods. Thanks 119 to Derek C. Ashmore. 120o LANG-1189: Add getAndIncrement/getAndDecrement/getAndAdd/incrementAndGet/ 121 decrementAndGet/addAndGet in Mutable* classes. Thanks to 122 Haiyang Li and Matthew Bartenschlag. 123o LANG-1225: Add RandomStringUtils#randomGraph and #randomPrint which match 124 corresponding regular expression class. Thanks to Caleb Cushing. 125o LANG-1223: Add StopWatch#getTime(TimeUnit). Thanks to Nick Manley. 126o LANG-781: Add methods to ObjectUtils class to check for null elements in the 127 array. Thanks to Krzysztof Wolny. 128o LANG-1228: Prefer Throwable.getCause() in ExceptionUtils.getCause(). 129 Thanks to Brad Hess. 130o LANG-1233: DiffBuilder add method to allow appending from a DiffResult. 131 Thanks to Nick Manley. 132o LANG-1168: Add SystemUtils.IS_OS_WINDOWS_10 property. 133 Thanks to Pascal Schumacher. 134o LANG-1115: Add support for varargs in ConstructorUtils, MemberUtils, and 135 MethodUtils. Thanks to Jim Lloyd and Joe Ferner. 136o LANG-1134: Add methods to check numbers against NaN and infinite to 137 Validate. Thanks to Alan Smithee. 138o LANG-1220: Add tests for missed branches in DateUtils. 139 Thanks to Casey Scarborough. 140o LANG-1146: z/OS identification in SystemUtils. 141 Thanks to Gabor Liptak. 142o LANG-1192: FastDateFormat support of the week-year component (uppercase 'Y'). 143 Thanks to Dominik Stadler. 144o LANG-1169: Add StringUtils methods to compare a string to multiple strings. 145 Thanks to Rafal Glowinski, Robert Parr and Arman Sharif. 146o LANG-1185: Add remove by regular expression methods in StringUtils. 147o LANG-1139: Add replace by regular expression methods in StringUtils. 148o LANG-1171: Add compare methods in StringUtils. 149o LANG-1174: Add sugar to RandomUtils. Thanks to Punkratz312. 150o LANG-1154: FastDateFormat APIs that use a StringBuilder. Thanks to 151 Gary Gregory. 152o LANG-1149: Ability to throw checked exceptions without declaring them. Thanks 153 to Gregory Zak. 154o LANG-1153: Implement ParsePosition api for FastDateParser. 155o LANG-1137: Add check for duplicate event listener in EventListenerSupport. 156 Thanks to Matthew Aguirre. 157o LANG-1135: Add method containsAllWords to WordUtils. Thanks to 158 Eduardo Martins. 159o LANG-1132: ReflectionToStringBuilder doesn't throw IllegalArgumentException 160 when the constructor's object param is null. Thanks to Jack Tan. 161o LANG-701: StringUtils join with var args. Thanks to James Sawle. 162o LANG-1105: Add ThreadUtils - A utility class which provides helper methods 163 related to java.lang.Thread Issue: LANG-1105. Thanks to 164 Hendrik Saly. 165o LANG-1031: Add annotations to exclude fields from ReflectionEqualsBuilder, 166 ReflectionToStringBuilder and ReflectionHashCodeBuilder. Thanks 167 to Felipe Adorno. 168o LANG-1127: Use JUnit rules to set and reset the default Locale and TimeZone. 169o LANG-1119: Add rotate(string, int) method to StringUtils. Thanks to 170 Loic Guibert. 171o LANG-1099: Add swap and shift operations for arrays to ArrayUtils. Thanks to 172 Adrian Ber. 173o LANG-1050: Change nullToEmpty methods to generics. Thanks to James Sawle. 174o LANG-1074: Add a method to ArrayUtils for removing all occurrences of a given 175 element Issue: LANG-1074. Thanks to Haiyang Li. 176 177FIXED BUGS 178============ 179 180o LANG-1261: ArrayUtils.contains returns false for instances of subtypes. 181o LANG-1252: Rename NumberUtils.isNumber, isCreatable to better reflect 182 createNumber. Also, accommodated for "+" symbol as prefix in 183 isCreatable and isNumber. Thanks to Rob Tompkins. 184o LANG-1230: Remove unnecessary synchronization from registry lookup in 185 EqualsBuilder and HashCodeBuilder. Thanks to Philippe Marschall. 186o LANG-1214: Handle "void" in ClassUtils.getClass(). Thanks to Henry Tung. 187o LANG-1250: SerializationUtils#deserialize has unnecessary code and a comment 188 for that. Thanks to Glease Wang. 189o LANG-1190: TypeUtils.isAssignable throws NullPointerException when fromType 190 has type variables and toType generic superclass specifies type 191 variable. Thanks to Pascal Schumacher. 192o LANG-1226: StringUtils#normalizeSpace does not trim the string anymore. 193 Thanks to Pascal Schumacher. 194o LANG-1251: SerializationUtils.ClassLoaderAwareObjectInputStream should use 195 static initializer to initialize primitiveTypes map. Thanks to 196 Takuya Ueshin. 197o LANG-1248: FastDatePrinter Memory allocation regression. Thanks to 198 Benoit Wiart. 199o LANG-1018: Fix precision loss on NumberUtils.createNumber(String). Thanks to 200 Nick Manley. 201o LANG-1199: Fix implementation of StringUtils.getJaroWinklerDistance(). Thanks 202 to M. Steiger. 203o LANG-1244: Fix dead links in StringUtils.getLevenshteinDistance() javadoc. 204 Thanks to jjbankert. 205o LANG-1242: "\u2284":"?" mapping missing from 206 EntityArrays#HTML40_EXTENDED_ESCAPE. Thanks to Neal Stewart. 207o LANG-901: StringUtils#startsWithAny/endsWithAny is case-sensitive - 208 documented as case-insensitive. Thanks to Matthew Bartenschlag. 209o LANG-1232: DiffBuilder: Add null check on fieldName when appending Object or 210 Object[]. Thanks to Nick Manley. 211o LANG-1178: ArrayUtils.removeAll(Object array, int... indices) should do the 212 clone, not its callers. Thanks to Henri Yandell. 213o LANG-1120: StringUtils.stripAccents should remove accents from "Ł" and "ł". 214 Thanks to kaching88. 215o LANG-1205: NumberUtils.createNumber() behaves inconsistently with 216 NumberUtils.isNumber(). Thanks to pbrose. 217o LANG-1222: Fix for incorrect comment on StringUtils.containsIgnoreCase 218 method. Thanks to Adam J. 219o LANG-1221: Fix typo on appendIfMissing javadoc. Thanks to Pierre Templier. 220o LANG-1202: parseDateStrictly doesn't pass specified locale. Thanks to 221 Markus Jelsma. 222o LANG-1219: FastDateFormat doesn't respect summer daylight in some localized 223 strings. Thanks to Jarek. 224o LANG-1175: Remove Ant-based build. 225o LANG-1194: Limit max heap memory for consistent Travis CI build. 226o LANG-1186: Fix NullPointerException in FastDateParser$TimeZoneStrategy. 227 Thanks to NickManley. 228o LANG-1193: ordinalIndexOf("abc", "ab", 1) gives incorrect answer of -1 229 (correct answer should be 0); revert fix for LANG-1077. Thanks to 230 Qin Li. 231o LANG-1002: Several predefined ISO FastDateFormats in DateFormatUtils are 232 incorrect. Thanks to Michael Osipov. 233o LANG-1152: StringIndexOutOfBoundsException or field over-write for large year 234 fields in FastDateParser. Thanks to Pas Filip. 235o LANG-1141: StrLookup.systemPropertiesLookup() no longer reacts on changes on 236 system properties. 237o LANG-1147: EnumUtils *BitVector issue with more than 32 values Enum. Thanks 238 to Loic Guibert. 239o LANG-1059: Capitalize javadoc is incorrect. Thanks to Colin Casey. 240o LANG-1122: Inconsistent behavior of swap for malformed inputs. Thanks to 241 Adrian Ber. 242o LANG-1130: Fix critical issues reported by SonarQube. 243o LANG-1131: StrBuilder.equals(StrBuilder) doesn't check for null inputs. 244o LANG-1128: JsonToStringStyle doesn't handle chars and objects correctly. 245 Thanks to Jack Tan. 246o LANG-1126: DateFormatUtilsTest.testSMTP depends on the default Locale. 247o LANG-1123: Unit test FastDatePrinterTimeZonesTest needs a timezone set. 248 Thanks to Christian P. Momon. 249o LANG-916: DateFormatUtils.format does not correctly change Calendar 250 TimeZone in certain situations. Thanks to Christian P. Momon. 251o LANG-1116: DateUtilsTest.testLang530 fails for some timezones. Thanks to 252 Aaron Sheldon. 253o LANG-1114: TypeUtils.ParameterizedType#equals doesn't work with wildcard 254 types. Thanks to Andy Coates. 255o LANG-1118: StringUtils.repeat('z', -1) throws NegativeArraySizeException. 256 Thanks to Loic Guibert. 257o LANG-1111: Fix FindBugs warnings in DurationFormatUtils. 258o LANG-1162: StringUtils#equals fails with Index OOBE on non-Strings with 259 identical leading prefix.. 260o LANG-1163: There are no tests for CharSequenceUtils.regionMatches. 261o LANG-1200: Fix Javadoc of StringUtils.ordinalIndexOf. Thanks to BarkZhang. 262o LANG-1191: Incorrect Javadoc 263 StringUtils.containsAny(CharSequence, CharSequence...). Thanks to 264 qed, Brent Worden and Gary Gregory. 265 266CHANGES 267========= 268o LANG-1197: Prepare Java 9 detection. 269o LANG-1262: CompareToBuilder.append(Object, Object, Comparator) method is too 270 big to be inlined. Thanks to Ruslan Cheremin. 271o LANG-1259: Javadoc for ArrayUtils.isNotEmpty() is slightly misleading. Thanks 272 to Dominik Stadler. 273o LANG-1247: FastDatePrinter generates extra Date objects. Thanks to 274 Benoit Wiart. 275o LANG-1229: HashCodeBuilder.append(Object,Object) is too big to be inlined, 276 which prevents whole builder to be scalarized. Thanks to 277 Ruslan Cheremin. 278o LANG-1243: Simplify ArrayUtils removeElements by using new decrementAndGet() 279 method. 280o LANG-1240: Optimize BitField constructor implementation. Thanks to zhanhb. 281o LANG-1206: Improve CharSetUtils.squeeze() performance. Thanks to 282 Mohammed Alfallaj. 283o LANG-1176: Improve ArrayUtils removeElements time complexity to O(n). Thanks 284 to Jeffery Yuan. 285o LANG-1234: getLevenshteinDistance with a threshold: optimize implementation 286 if the strings lengths differ more than the threshold. Thanks to 287 Jonatan Jönsson. 288o LANG-1151: Performance improvements for NumberUtils.isParsable. Thanks to 289 Juan Pablo Santos Rodríguez. 290o LANG-1218: EqualsBuilder.append(Object,Object) is too big to be inlined, 291 which prevents whole builder to be scalarized. Thanks to 292 Ruslan Cheremin. 293o LANG-1210: StringUtils#startsWithAny has error in Javadoc. Thanks to 294 Matthias Niehoff. 295o LANG-1208: StrSubstitutor can preserve escapes. Thanks to Samuel Karp. 296o LANG-1182: Clarify Javadoc of StringUtils.containsAny(). Thanks to 297 Larry West and Pascal Schumacher. 298o LANG-1183: Making replacePattern/removePattern methods null safe in 299 StringUtils. 300o LANG-1057: Replace StringBuilder with String concatenation for better 301 optimization. Thanks to Otávio Santana. 302o LANG-1075: Deprecate SystemUtils.FILE_SEPARATOR and 303 SystemUtils.PATH_SEPARATOR. 304o LANG-979: TypeUtils.parameterizeWithOwner - wrong format descriptor for 305 "invalid number of type parameters". Thanks to Bruno P. Kinoshita. 306o LANG-1112: MultilineRecursiveToStringStyle largely unusable due to being 307 package-private. 308o LANG-1058: StringUtils.uncapitalize performance improvement. Thanks to 309 Leo Wang. 310o LANG-1069: CharSet.getInstance documentation does not clearly explain how 311 to include negation character in set. Thanks to Arno Noordover. 312o LANG-1107: Fix parsing edge cases in FastDateParser. 313o LANG-1273: Added new property IS_OS_MAC_OSX_EL_CAPITAN in SystemUtils. Thanks 314 to Jake Wang. 315 316============================================================================= 317 318 Release Notes for version 3.4 319 320 321COMPATIBILITY 322============= 323 324Commons Lang 3.4 is fully binary compatible to the last release and can 325therefore be used as a drop in replacement for 3.3.2. Note that the value of 326org.apache.commons.lang3.time.DurationFormatUtils.ISO_EXTENDED_FORMAT_PATTERN 327has changed, which may affect clients using the constant. Furthermore the 328constant is used internally in 329o DurationFormatUtils.formatDurationISO(long) 330o DurationFormatUtils.formatPeriodISO(long, long) 331 332For more information see https://issues.apache.org/jira/browse/LANG-1000. 333 334NEW FEATURES 335============== 336 337o LANG-821: Support OS X versions in SystemUtils. Thanks to Timo Kockert. 338o LANG-1103: Add SystemUtils.IS_JAVA_1_9 339o LANG-1093: Add ClassUtils.getAbbreviatedName(). Thanks to Fabian Lange. 340o LANG-1082: Add option to disable the "objectsTriviallyEqual" test in 341 DiffBuilder. Thanks to Jonathan Baker. 342o LANG-1015: Add JsonToStringStyle implementation to ToStringStyle. Thanks to 343 Thiago Andrade. 344o LANG-1080: Add NoClassNameToStringStyle implementation of ToStringStyle. 345 Thanks to Innokenty Shuvalov. 346o LANG-883: Add StringUtils.containsAny(CharSequence, CharSequence...) method. 347 Thanks to Daniel Stewart. 348o LANG-1052: Multiline recursive to string style. Thanks to Jan Matèrne. 349o LANG-536: Add isSorted() to ArrayUtils. Thanks to James Sawle. 350o LANG-1033: Add StringUtils.countMatches(CharSequence, char) 351o LANG-1021: Provide methods to retrieve all fields/methods annotated with a 352 specific type. Thanks to Alexander Müller. 353o LANG-1016: NumberUtils#isParsable method(s). Thanks to 354 Juan Pablo Santos Rodríguez. 355o LANG-999: Add fuzzy String matching logic to StringUtils. Thanks to 356 Ben Ripkens. 357o LANG-994: Add zero copy read method to StrBuilder. Thanks to 358 Mikhail Mazursky. 359o LANG-993: Add zero copy write method to StrBuilder. Thanks to 360 Mikhail Mazursky. 361o LANG-1044: Add method MethodUtils.invokeExactMethod(Object, String) 362o LANG-1045: Add method MethodUtils.invokeMethod(Object, String) 363 364FIXED BUGS 365============ 366 367o LANG-794: SystemUtils.IS_OS_WINDOWS_2008, VISTA are incorrect. Thanks to 368 Timo Kockert. 369o LANG-1104: Parse test fails for TimeZone America/Sao_Paulo 370o LANG-948: Exception while using ExtendedMessageFormat and escaping braces. 371 Thanks to Andrey Khobnya. 372o LANG-1092: Wrong formatting of time zones with daylight saving time in 373 FastDatePrinter 374o LANG-1090: FastDateParser does not set error indication in ParsePosition 375o LANG-1089: FastDateParser does not handle excess hours as per 376 SimpleDateFormat 377o LANG-1061: FastDateParser error - timezones not handled correctly. Thanks to 378 dmeneses. 379o LANG-1087: NumberUtils#createNumber() returns positive BigDecimal when 380 negative Float is expected. Thanks to Renat Zhilkibaev. 381o LANG-1081: DiffBuilder.append(String, Object left, Object right) does not do 382 a left.equals(right) check. Thanks to Jonathan Baker. 383o LANG-1055: StrSubstitutor.replaceSystemProperties does not work consistently. 384 Thanks to Jonathan Baker. 385o LANG-1083: Add (T) casts to get unit tests to pass in old JDK. Thanks to 386 Jonathan Baker. 387o LANG-1073: Read wrong component type of array in add in ArrayUtils. 388 Thanks to haiyang li. 389o LANG-1077: StringUtils.ordinalIndexOf("aaaaaa", "aa", 2) != 3 in StringUtils. 390 Thanks to haiyang li. 391o LANG-1072: Duplicated "0x" check in createBigInteger in NumberUtils. Thanks 392 to haiyang li. 393o LANG-1064: StringUtils.abbreviate description doesn't agree with the 394 examples. Thanks to B.J. Herbison. 395o LANG-1041: Fix MethodUtilsTest so it does not depend on JDK method ordering. 396 Thanks to Alexandre Bartel. 397o LANG-1000: ParseException when trying to parse UTC dates with Z as zone 398 designator using DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT 399o LANG-1035: Javadoc for EqualsBuilder.reflectionEquals() is unclear 400o LANG-1001: ISO 8601 misspelled throughout the Javadocs. Thanks to 401 Michael Osipov. 402o LANG-1088: FastDateParser should be case-insensitive 403o LANG-995: Fix bug with stripping spaces on last line in WordUtils.wrap(). 404 Thanks to Andrey Khobnya. 405 406CHANGES 407========= 408 409o LANG-1102: Make logic for comparing OS versions in SystemUtils smarter 410o LANG-1091: Shutdown thread pools in test cases. Thanks to Fabian Lange. 411o LANG-1101: FastDateParser and FastDatePrinter support 'X' format 412o LANG-1100: Avoid memory allocation when using date formatting to StringBuffer. 413 Thanks to mbracher. 414o LANG-935: Possible performance improvement on string escape functions. 415 Thanks to Fabian Lange, Thomas Neidhart. 416o LANG-1098: Avoid String allocation in StrBuilder.append(CharSequence). Thanks 417 to Mikhail Mazurskiy, Fabian Lange. 418o LANG-1098: Update maven-checkstyle-plugin to 2.14. Thanks to Micha? Kordas. 419o LANG-1097: Update org.easymock:easymock to 3.3.1. Thanks to Micha? Kordas. 420o LANG-1096: Update maven-pmd-plugin to 3.4. Thanks to Micha? Kordas. 421o LANG-1095: Update maven-antrun-plugin to 1.8. Thanks to Micha? Kordas. 422o LANG-877: Performance improvements for StringEscapeUtils. Thanks to 423 Fabian Lange. 424o LANG-1071: Fix wrong examples in Javadoc of 425 StringUtils.replaceEachRepeatedly(...), 426 StringUtils.replaceEach(...) Thanks to Arno Noordover. 427o LANG-827: CompareToBuilder's doc doesn't specify precedence of fields it 428 uses in performing comparisons 429o LANG-1020: Improve performance of normalize space. Thanks to Libor Ondrusek. 430o LANG-1027: org.apache.commons.lang3.SystemUtils#isJavaVersionAtLeast should 431 return true by default 432o LANG-1026: Bring static method references in StringUtils to consistent style. 433 Thanks to Alex Yursha. 434o LANG-1017: Use non-ASCII digits in Javadoc examples for 435 StringUtils.isNumeric. Thanks to Christoph Schneegans. 436o LANG-1008: Change min/max methods in NumberUtils/IEEE754rUtils from array 437 input parameters to varargs. Thanks to Thiago Andrade. 438o LANG-1006: Add wrap (with String or char) to StringUtils. Thanks to 439 Thiago Andrade. 440o LANG-1005: Extend DurationFormatUtils#formatDurationISO default pattern to 441 match #formatDurationHMS. Thanks to Michael Osipov. 442o LANG-1007: Fixing NumberUtils JAVADoc comments for max methods. Thanks to 443 Thiago Andrade. 444o LANG-731: Better Javadoc for BitField class 445o LANG-1004: DurationFormatUtils#formatDurationHMS implementation does not 446 correspond to Javadoc and vice versa. Thanks to Michael Osipov. 447o LANG-1003: DurationFormatUtils are not able to handle negative 448 durations/periods 449o LANG-998: Javadoc is not clear on preferred pattern to instantiate 450 FastDateParser / FastDatePrinter 451 452============================================================================= 453 454 Release Notes for version 3.3.2 455 456NEW FEATURES 457============== 458 459o LANG-989: Add org.apache.commons.lang3.SystemUtils.IS_JAVA_1_8 460 461FIXED BUGS 462============ 463 464o LANG-992: NumberUtils#isNumber() returns false for "0.0", "0.4790", et al 465 466============================================================================= 467 468 Release Notes for version 3.3.1 469 470FIXED BUGS 471============ 472 473o LANG-987: DateUtils.getFragmentInDays(Date, Calendar.MONTH) returns wrong 474 days 475o LANG-983: DurationFormatUtils does not describe format string fully 476o LANG-981: DurationFormatUtils#lexx does not detect unmatched quote char 477o LANG-984: DurationFormatUtils does not handle large durations correctly 478o LANG-982: DurationFormatUtils.formatDuration(61999, "s.SSSS") - ms field 479 size should be 4 digits 480o LANG-978: Failing tests with Java 8 b128 481 482============================================================================= 483 484 Release Notes for version 3.3 485 486NEW FEATURES 487============== 488 489o LANG-955: Add methods for removing all invalid characters according to 490 XML 1.0 and XML 1.1 in an input string to StringEscapeUtils. 491 Thanks to Adam Hooper. 492o LANG-970: Add APIs MutableBoolean setTrue() and setFalse() 493o LANG-962: Add SerializationUtils.roundtrip(T extends Serializable) to 494 serialize then deserialize 495o LANG-637: There should be a DifferenceBuilder with a 496 ReflectionDifferenceBuilder implementation 497o LANG-944: Add the Jaro-Winkler string distance algorithm to StringUtils. 498 Thanks to Rekha Joshi. 499o LANG-417: New class ClassPathUtils with methods for turning FQN into 500 resource path 501o LANG-834: Validate: add inclusiveBetween and exclusiveBetween overloads 502 for primitive types 503o LANG-900: New RandomUtils class. Thanks to Duncan Jones. 504o LANG-966: Add IBM OS/400 detection 505 506FIXED BUGS 507============ 508 509o LANG-621: ReflectionToStringBuilder.toString does not debug 3rd party object 510 fields within 3rd party object. Thanks to Philip Hodges, 511 Thomas Neidhart. 512o LANG-977: NumericEntityEscaper incorrectly encodes supplementary characters. 513 Thanks to Chris Karcher. 514o LANG-973: Make some private fields final 515o LANG-971: NumberUtils#isNumber(String) fails to reject invalid Octal numbers 516o LANG-972: NumberUtils#isNumber does not allow for hex 0XABCD 517o LANG-969: StringUtils.toEncodedString(byte[], Charset) needlessly throws 518 UnsupportedEncodingException. Thanks to Matt Bishop. 519o LANG-946: ConstantInitializerTest fails when building with IBM JDK 7 520o LANG-954: uncaught PatternSyntaxException in FastDateFormat on Android. 521 Thanks to Michael Keppler. 522o LANG-936: StringUtils.getLevenshteinDistance with too big of a threshold 523 returns wrong result. Thanks to Yaniv Kunda, Eli Lindsey. 524o LANG-943: Test DurationFormatUtilsTest.testEdgeDuration fails in 525 JDK 1.6, 1.7 and 1.8, BRST time zone 526o LANG-613: ConstructorUtils.getAccessibleConstructor() Does Not Check the 527 Accessibility of Enclosing Classes 528o LANG-951: Fragments are wrong by 1 day when using fragment YEAR or MONTH. 529 Thanks to Sebastian Götz. 530o LANG-950: FastDateParser does not handle two digit year parsing like 531 SimpleDateFormat 532o LANG-949: FastDateParserTest.testParses does not test FastDateParser 533o LANG-915: Wrong locale handling in LocaleUtils.toLocale(). 534 Thanks to Sergio Fernández. 535 536CHANGES 537========= 538 539o LANG-961: org.apache.commons.lang3.reflect.FieldUtils.removeFinalModifier(Field) 540 does not clean up after itself 541o LANG-958: FastDateParser javadoc incorrectly states that SimpleDateFormat 542 is used internally 543o LANG-956: Improve Javadoc of WordUtils.wrap methods 544o LANG-939: Move Documentation from user guide to package-info files 545o LANG-953: Convert package.html files to package-info.java files 546o LANG-940: Fix deprecation warnings 547o LANG-819: EnumUtils.generateBitVector needs a "? extends" 548 549============================================================================= 550 551 Release Notes for version 3.2.1 552 553BUG FIXES 554=========== 555 556o LANG-937: Fix missing Hamcrest dependency in Ant Build 557o LANG-941: Test failure in LocaleUtilsTest when building with JDK 8 558o LANG-942: Test failure in FastDateParserTest and FastDateFormat_ParserTest 559 when building with JDK8. Thanks to Bruno P. Kinoshita, 560 Henri Yandell. 561o LANG-938: Build fails with test failures when building with JDK 8 562 563============================================================================= 564 565 Release Notes for version 3.2 566 567COMPATIBILITY WITH 3.1 568======================== 569 570This release introduces backwards incompatible changes in 571org.apache.commons.lang3.time.FastDateFormat: 572o Method 'protected java.util.List parsePattern()' has been removed 573o Method 'protected java.lang.String parseToken(java.lang.String, int[])' has 574 been removed 575o Method 'protected org.apache.commons.lang3.time.FastDateFormat$NumberRule 576 selectNumberRule(int, int)' has been removed 577 578These changes were the result of [LANG-462]. It is assumed that this change 579will not break clients as Charles Honton pointed out on 25/Jan/12: 580" 581 1. Methods "FastDateFormat$NumberRule selectNumberRule(int, int)" and 582 "List<Rule> parsePattern()" couldn't have been overridden because 583 NumberRule and Rule were private to FastDateFormat. 584 2. Due to the factory pattern used, it's unlikely other two methods would have 585 been overridden. 586 3. The four methods are highly implementation specific. I consider it a 587 mistake that the methods were exposed. 588" 589For more information see https://issues.apache.org/jira/browse/LANG-462. 590 591NEW FEATURES 592============== 593 594o LANG-934: Add removeFinalModifier to FieldUtils 595o LANG-863: Method returns number of inheritance hops between parent and 596 subclass. Thanks to Daneel S. Yaitskov. 597o LANG-774: Added isStarted, isSuspended and isStopped to StopWatch. 598 Thanks to Erhan Bagdemir. 599o LANG-848: Added StringUtils.isBlank/isEmpty CharSequence... methods. 600 Thanks to Alexander Muthmann. 601o LANG-926: Added ArrayUtils.reverse(array, from, to) methods. 602o LANG-795: StringUtils.toString(byte[], String) deprecated in favour of a new 603 StringUtils.toString(byte[], CharSet). Thanks to Aaron Digulla. 604o LANG-893: StrSubstitutor now supports default values for variables. 605 Thanks to Woonsan Ko. 606o LANG-913: Adding .gitignore to commons-lang. Thanks to Allon Mureinik. 607o LANG-837: Add ObjectUtils.toIdentityString methods that support 608 StringBuilder, StrBuilder, and Appendable. 609o LANG-886: Added CharSetUtils.containsAny(String, String). 610o LANG-797: Added escape/unescapeJson to StringEscapeUtils. 611o LANG-875: Added appendIfMissing and prependIfMissing methods to StringUtils. 612o LANG-870: Add StringUtils.LF and StringUtils.CR values. 613o LANG-873: Add FieldUtils getAllFields() to return all the fields defined in 614 the given class and super classes. 615o LANG-835: StrBuilder should support StringBuilder as an input parameter. 616o LANG-857: StringIndexOutOfBoundsException in CharSequenceTranslator. 617o LANG-856: Code refactoring in NumberUtils. 618o LANG-855: NumberUtils#createBigInteger does not allow for hex and octal 619 numbers. 620o LANG-854: NumberUtils#createNumber - does not allow for hex numbers to be 621 larger than Long. 622o LANG-853: StringUtils join APIs for primitives. 623o LANG-841: Add StringUtils API to call String.replaceAll in DOTALL a.k.a. 624 single-line mode. 625o LANG-825: Create StrBuilder APIs similar to 626 String.format(String, Object...). 627o LANG-675: Add Triple class (ternary version of Pair). 628o LANG-462: FastDateFormat supports parse methods. 629 630BUG FIXES 631=========== 632 633o LANG-932: Spelling fixes. Thanks to Ville Skyttä. 634o LANG-929: OctalUnescaper tried to parse all of \279. 635o LANG-928: OctalUnescaper had bugs when parsing octals starting with a zero. 636o LANG-905: EqualsBuilder returned true when comparing arrays, even when the 637 elements are different. 638o LANG-917: Fixed exception when combining custom and choice format in 639 ExtendedMessageFormat. Thanks to Arne Burmeister. 640o LANG-902: RandomStringUtils.random javadoc was incorrectly promising letters 641 and numbers would, as opposed to may, appear Issue:. Thanks to 642 Andrzej Winnicki. 643o LANG-921: BooleanUtils.xor(boolean...) produces wrong results. 644o LANG-896: BooleanUtils.toBoolean(String str) javadoc is not updated. Thanks 645 to Mark Bryan Yu. 646o LANG-879: LocaleUtils test fails with new Locale "ja_JP_JP_#u-ca-japanese" 647 of JDK7. 648o LANG-836: StrSubstitutor does not support StringBuilder or CharSequence. 649 Thanks to Arnaud Brunet. 650o LANG-693: Method createNumber from NumberUtils doesn't work for floating 651 point numbers other than Float Issue: LANG-693. Thanks to 652 Calvin Echols. 653o LANG-887: FastDateFormat does not use the locale specific cache correctly. 654o LANG-754: ClassUtils.getShortName(String) will now only do a reverse lookup 655 for array types. 656o LANG-881: NumberUtils.createNumber() Javadoc says it does not work for octal 657 numbers. 658o LANG-865: LocaleUtils.toLocale does not parse strings starting with an 659 underscore. 660o LANG-858: StringEscapeUtils.escapeJava() and escapeEcmaScript() do not 661 output the escaped surrogate pairs that are Java parsable. 662o LANG-849: FastDateFormat and FastDatePrinter generates Date objects 663 wastefully. 664o LANG-845: Spelling fixes. 665o LANG-844: Fix examples contained in javadoc of StringUtils.center methods. 666o LANG-832: FastDateParser does not handle unterminated quotes correctly. 667o LANG-831: FastDateParser does not handle white-space properly. 668o LANG-830: FastDateParser could use \Q \E to quote regexes. 669o LANG-828: FastDateParser does not handle non-Gregorian calendars properly. 670o LANG-826: FastDateParser does not handle non-ASCII digits correctly. 671o LANG-822: NumberUtils#createNumber - bad behavior for leading "--". 672o LANG-818: FastDateFormat's "z" pattern does not respect timezone of Calendar 673 instances passed to format(). 674o LANG-817: Add org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS_8. 675o LANG-813: StringUtils.equalsIgnoreCase doesn't check string reference 676 equality. 677o LANG-810: StringUtils.join() endIndex, bugged for loop. 678o LANG-807: RandomStringUtils throws confusing IAE when end <= start. 679o LANG-805: RandomStringUtils.random(count, 0, 0, false, false, universe, 680 random) always throws java.lang.ArrayIndexOutOfBoundsException. 681o LANG-802: LocaleUtils - unnecessary recursive call in SyncAvoid class. 682o LANG-800: Javadoc bug in DateUtils#ceiling for Calendar and Object versions. 683o LANG-788: SerializationUtils throws ClassNotFoundException when cloning 684 primitive classes. 685o LANG-786: StringUtils equals() relies on undefined behavior. 686o LANG-783: Documentation bug: StringUtils.split. 687o LANG-777: jar contains velocity template of release notes. 688o LANG-776: TypeUtilsTest contains incorrect type assignability assertion. 689o LANG-775: TypeUtils.getTypeArguments() misses type arguments for 690 partially-assigned classes. 691o LANG-773: ImmutablePair doc contains nonsense text. 692o LANG-772: ClassUtils.PACKAGE_SEPARATOR Javadoc contains garbage text. 693o LANG-765: EventListenerSupport.ProxyInvocationHandler no longer defines 694 serialVersionUID. 695o LANG-764: StrBuilder is now serializable. 696o LANG-761: Fix Javadoc Ant warnings. 697o LANG-747: NumberUtils does not handle Long Hex numbers. 698o LANG-743: Javadoc bug in static inner class DateIterator. 699 700CHANGES 701========= 702 703o LANG-931: Misleading Javadoc comment in StrBuilderReader class. Thanks 704 to Christoph Schneegans. 705o LANG-910: StringUtils.normalizeSpace now handles non-breaking spaces 706 (Unicode 00A0). Thanks to Timur Yarosh. 707o LANG-804: Redundant check for zero in HashCodeBuilder ctor. Thanks to 708 Allon Mureinik. 709o LANG-884: Simplify FastDateFormat; eliminate boxing. 710o LANG-882: LookupTranslator now works with implementations of CharSequence 711 other than String. 712o LANG-846: Provide CharSequenceUtils.regionMatches with a proper green 713 implementation instead of inefficiently converting to Strings. 714o LANG-839: ArrayUtils removeElements methods use unnecessary HashSet. 715o LANG-838: ArrayUtils removeElements methods clone temporary index arrays 716 unnecessarily. 717o LANG-799: DateUtils#parseDate uses default locale; add Locale support. 718o LANG-798: Use generics in SerializationUtils. 719 720CHANGES WITHOUT TICKET 721======================== 722 723o Fixed URLs in javadoc to point to new oracle.com pages 724 725============================================================================= 726 727 Release Notes for version 3.1 728 729NEW FEATURES 730============== 731 732o LANG-801: Add Conversion utility to convert between data types on byte level 733o LANG-760: Add API StringUtils.toString(byte[] input, String charsetName) 734o LANG-756: Add APIs ClassUtils.isPrimitiveWrapper(Class<?>) and 735 isPrimitiveOrWrapper(Class<?>) 736o LANG-695: SystemUtils.IS_OS_UNIX doesn't recognize FreeBSD as a Unix system 737 738BUG FIXES 739=========== 740 741o LANG-749: Incorrect Bundle-SymbolicName in Manifest 742o LANG-746: NumberUtils does not handle upper-case hex: 0X and -0X 743o LANG-744: StringUtils throws java.security.AccessControlException on Google 744 App Engine 745o LANG-741: Ant build has wrong component.name 746o LANG-698: Document that the Mutable numbers don't work as expected with 747 String.format 748 749CHANGES 750========= 751 752o LANG-758: Add an example with whitespace in StringUtils.defaultIfEmpty 753o LANG-752: Fix createLong() so it behaves like createInteger() 754o LANG-751: Include the actual type in the Validate.isInstance and 755 isAssignableFrom exception messages 756o LANG-748: Deprecating chomp(String, String) 757o LANG-736: CharUtils static final array CHAR_STRING is not needed to compute 758 CHAR_STRING_ARRAY 759 760============================================================================= 761 762 Release Notes for version 3.0 763 764ADDITIONS 765=========== 766 767o LANG-276: MutableBigDecimal and MutableBigInteger. 768o LANG-285: Wish : method unaccent. 769o LANG-358: ObjectUtils.coalesce. 770o LANG-386: LeftOf/RightOfNumber in Range convenience methods necessary. 771o LANG-435: Add ClassUtils.isAssignable() variants with autoboxing. 772o LANG-444: StringUtils.emptyToNull. 773o LANG-482: Enhance StrSubstitutor to support nested ${var-${subvr}} expansion 774o LANG-482: StrSubstitutor now supports substitution in variable names. 775o LANG-496: A generic implementation of the Lazy initialization pattern. 776o LANG-497: Addition of ContextedException and ContextedRuntimeException. 777o LANG-498: Add StringEscapeUtils.escapeText() methods. 778o LANG-499: Add support for the handling of ExecutionExceptions. 779o LANG-501: Add support for background initialization. 780o LANG-529: Add a concurrent package. 781o LANG-533: Validate: support for validating blank strings. 782o LANG-537: Add ArrayUtils.toArray to create generic arrays. 783o LANG-545: Add ability to create a Future for a constant. 784o LANG-546: Add methods to Validate to check whether the index is valid for 785 the array/list/string. 786o LANG-553: Add TypeUtils class to provide utility code for working with generic 787 types. 788o LANG-559: Added isAssignableFrom and isInstanceOf validation methods. 789o LANG-559: Added validState validation method. 790o LANG-560: New TimedSemaphore class. 791o LANG-582: Provide an implementation of the ThreadFactory interface. 792o LANG-588: Create a basic Pair<L, R> class. 793o LANG-594: DateUtils equal & compare functions up to most significant field. 794o LANG-601: Add Builder Interface / Update Builders to Implement It. 795o LANG-609: Support lazy initialization using atomic variables 796o LANG-610: Extend exception handling in ConcurrentUtils to runtime exceptions. 797o LANG-614: StringUtils.endsWithAny method 798o LANG-640: Add normalizeSpace to StringUtils 799o LANG-644: Provide documentation about the new concurrent package 800o LANG-649: BooleanUtils.toBooleanObject to support single character input 801o LANG-651: Add AnnotationUtils 802o LANG-653: Provide a very basic ConcurrentInitializer implementation 803o LANG-655: Add StringUtils.defaultIfBlank() 804o LANG-667: Add a Null-safe compare() method to ObjectUtils 805o LANG-676: Documented potential NPE if auto-boxing occurs for some BooleanUtils 806 methods 807o LANG-678: Add support for ConcurrentMap.putIfAbsent() 808o LANG-692: Add hashCodeMulti varargs method 809o LANG-697: Add FormattableUtils class 810o LANG-684: Levenshtein Distance Within a Given Threshold 811 812REMOVALS 813========== 814 815o LANG-438: Remove @deprecateds. 816o LANG-492: Remove code handled now by the JDK. 817o LANG-493: Remove code that does not hold enough value to remain. 818o LANG-590: Remove JDK 1.2/1.3 bug handling in 819 StringUtils.indexOf(String, String, int). 820o LANG-673: WordUtils.abbreviate() removed 821o LANG-691: Removed DateUtils.UTC_TIME_ZONE 822 823IMPROVEMENTS 824============== 825 826o LANG-290: EnumUtils for JDK 5.0. 827o LANG-336: Finally start using generics. 828o LANG-355: StrBuilder should implement CharSequence and Appendable. 829o LANG-396: Investigate for vararg usages. 830o LANG-424: Improve Javadoc for StringUtils class. 831o LANG-458: Refactor Validate.java to eliminate code redundancy. 832o LANG-479: Document where in SVN trunk is. 833o LANG-504: bring ArrayUtils.isEmpty to the generics world. 834o LANG-505: Rewrite StringEscapeUtils. 835o LANG-507: StringEscapeUtils.unescapeJava should support \u+ notation. 836o LANG-510: Convert StringUtils API to take CharSequence. 837o LANG-513: Better EnumUtils. 838o LANG-528: Mutable classes should implement an appropriately typed Mutable 839 interface. 840o LANG-539: Compile commons.lang for CDC 1.1/Foundation 1.1. 841o LANG-540: Make NumericEntityEscaper immutable. 842o LANG-541: Replace StringBuffer with StringBuilder. 843o LANG-548: Use Iterable on API instead of Collection. 844o LANG-551: Replace Range classes with generic version. 845o LANG-562: Change Maven groupId. 846o LANG-563: Change Java package name. 847o LANG-570: Do the test cases really still require main() and suite() methods? 848o LANG-579: Add new Validate methods. 849o LANG-599: ClassUtils.getClass(): Allow Dots as Inner Class Separators. 850o LANG-605: DefaultExceptionContext overwrites values in recursive situations. 851o LANG-668: Change ObjectUtils min() & max() functions to use varargs rather 852 than just two parameters 853o LANG-681: Push down WordUtils to "text" sub-package. 854o LANG-711: Add includeantruntime=false to javac targets to quell warnings in 855 ant 1.8.1 and better (and modest performance gain). 856o LANG-713: Increase test coverage of FieldUtils read methods and tweak 857 javadoc. 858o LANG-718: build.xml Java 1.5+ updates. 859 860BUG FIXES 861=========== 862 863o LANG-11: Depend on JDK 1.5+. 864o LANG-302: StrBuilder does not implement clone(). 865o LANG-339: StringEscapeUtils.escapeHtml() escapes multibyte characters like 866 Chinese, Japanese, etc. 867o LANG-369: ExceptionUtils not thread-safe. 868o LANG-418: Javadoc incorrect for StringUtils.endsWithIgnoreCase. 869o LANG-428: StringUtils.isAlpha, isAlphanumeric and isNumeric now return false 870 for "" 871o LANG-439: StringEscapeUtils.escapeHTML() does not escape chars (0x00-0x20). 872o LANG-448: Lower Ascii Characters don't get encoded by Entities.java. 873o LANG-468: JDK 1.5 build/runtime failure on LANG-393 (EqualsBuilder). 874o LANG-474: Fixes for thread safety. 875o LANG-478: StopWatch does not resist to system time changes. 876o LANG-480: StringEscapeUtils.escapeHtml incorrectly converts unicode 877 characters above U+00FFFF into 2 characters. 878o LANG-481: Possible race-conditions in hashCode of the range classes. 879o LANG-564: Improve StrLookup API documentation. 880o LANG-568: @SuppressWarnings("unchecked") is used too generally. 881o LANG-571: ArrayUtils.add(T[: array, T element) can create unexpected 882 ClassCastException. 883o LANG-585: exception.DefaultExceptionContext.getFormattedExceptionMessage 884 catches Throwable. 885o LANG-596: StrSubstitutor should also handle the default properties of a 886 java.util.Properties class 887o LANG-600: Javadoc is incorrect for public static int 888 lastIndexOf(String str, String searchStr). 889o LANG-602: ContextedRuntimeException no longer an 'unchecked' exception. 890o LANG-606: EqualsBuilder causes StackOverflowException. 891o LANG-608: Some StringUtils methods should take an int character instead of 892 char to use String API features. 893o LANG-617: StringEscapeUtils.escapeXML() can't process UTF-16 supplementary 894 characters 895o LANG-624: SystemUtils.getJavaVersionAsFloat throws 896 StringIndexOutOfBoundsException on Android runtime/Dalvik VM 897o LANG-629: Charset may not be threadsafe, because the HashSet is not synch. 898o LANG-638: NumberUtils createNumber throws a StringIndexOutOfBoundsException 899 when argument containing "e" and "E" is passed in 900o LANG-643: Javadoc StringUtils.left() claims to throw on negative len, but 901 doesn't 902o LANG-645: FastDateFormat.format() outputs incorrect week of year because 903 locale isn't respected 904o LANG-646: StringEscapeUtils.unescapeJava doesn't handle octal escapes and 905 Unicode with extra u 906o LANG-656: Example StringUtils.indexOfAnyBut("zzabyycdxx", '') = 0 incorrect 907o LANG-658: Some entities like Ö are not matched properly against its 908 ISO8859-1 representation 909o LANG-659: EntityArrays typo: {"\u2122", "−"}, // minus sign, U+2212 910 ISOtech 911o LANG-66: StringEscaper.escapeXml() escapes characters > 0x7f. 912o LANG-662: org.apache.commons.lang3.math.Fraction does not reduce 913 (Integer.MIN_VALUE, 2^k) 914o LANG-663: org.apache.commons.lang3.math.Fraction does not always succeed in 915 multiplyBy and divideBy 916o LANG-664: NumberUtils.isNumber(String) is not right when the String is 917 "1.1L" 918o LANG-672: Doc bug in DateUtils#ceiling 919o LANG-677: DateUtils.isSameLocalTime compares using 12-hour clock and not 920 24-hour 921o LANG-685: EqualsBuilder synchronizes on HashCodeBuilder. 922o LANG-703: StringUtils.join throws NPE when toString returns null for one of 923 objects in collection 924o LANG-710: StringIndexOutOfBoundsException when calling unescapeHtml4("") 925o LANG-714: StringUtils doc/comment spelling fixes. 926o LANG-715: CharSetUtils.squeeze() speedup. 927o LANG-716: swapCase and *capitalize speedups. 928 929 930Historical list of changes: https://commons.apache.org/lang/changes-report.html 931 932For complete information on Commons Lang, including instructions on how to 933submit bug reports, patches, or suggestions for improvement, see the 934Apache Commons Lang website: 935 936https://commons.apache.org/lang/ 937 938Have fun! 939-Apache Commons Lang team 940 941