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 Commons Lang Package 19 Version 2.4 20 Release Notes 21 22 23INTRODUCTION: 24 25This document contains the release notes for the 2.4 version of Apache Commons Lang. 26Commons Lang is a set of utility functions and reusable components that should be of use in any Java environment. 27 28Lang 2.4 no longer attempts to target the Java 1.1 environment and now targets Java 1.2. While previous versions 29were built for 1.1, some parts were using methods that were only available in 1.2, and the Enum class had 30become dependent on Java 1.3. 31 32INCOMPATIBLE CHANGES WITH VERSION 2.3: 33 34- None 35 36INCOMPATIBLE CHANGES WITH VERSION 2.2: 37 38- Calling stop on a suspended StopWatch will no longer change the underlying time. 39 It's very unlikely anyone was relying on that bug as a feature. 40 41ADDITIONAL INCOMPATIBLE CHANGES WITH VERSION 2.0: 42 43- The Nestable interface defines the method indexOfThrowable(Class). 44Previously the implementations checked only for a specific Class. 45Now they check for subclasses of that Class as well. 46For most situations this will be the expected behavior (i.e. it's a bug fix). 47If it causes problems, please use the ExceptionUtils.indexOfThrowable(Class) method instead. 48Note that the ExceptionUtils method is available in v1.0 and v2.0 of commons-lang and has not been changed. 49(An alternative to this is to change the public static matchSubclasses flag on NestableDelegate. 50However, we don't recommend that as a long-term solution.) 51 52- The StopWatch class has had much extra validation added. 53If your code previously relied on unusual aspects, it may no longer work. 54 55- Starting with version 2.1, Ant version 1.6.x is required to build. Copy 56junit.jar to ANT_HOME/lib. You can get JUnit from https://www.junit.org. See the developer's guide 57for more details. 58 59DEPRECATIONS FROM 2.3 to 2.4: 60 61- ObjectUtils.appendIdentityToString(StringBuffer, Object) - has very odd semantics, use 62 ObjectUtils.identityToString(StringBuffer, Object) instead. 63 64- public static java.util.Date add(java.util.Date, int, int) - it is not intended for this 65 method to be public. Please let us know if you use this. 66 67DEPRECATIONS FROM 2.2 to 2.3: 68 69- None 70 71DEPRECATIONS FROM 2.1 to 2.2: 72 73- None 74 75DEPRECATIONS FROM 2.0 to 2.1: 76 77- The enum package has been renamed to enums for JDK 1.5 compliance. 78All functionality is identical, just the package has changed. 79This package will be removed in v3.0. 80 81- NumberUtils.stringToInt - renamed to toInt 82 83- DateUtils - four constants, MILLIS_IN_* have been deprecated as they were defined 84as int not long. The replacements are MILLIS_PER_*. 85 86 87BUG FIXES IN 2.4: 88 89 * [LANG-76 ] - EnumUtils.getEnum() doesn't work well in 1.5 90 * [LANG-328] - LocaleUtils.toLocale() rejects strings with only language+variant 91 * [LANG-334] - Enum is not thread-safe 92 * [LANG-346] - Dates.round() behaves incorrectly for minutes and seconds 93 * [LANG-349] - Deadlock using ReflectionToStringBuilder 94 * [LANG-353] - Javadoc Example for EqualsBuilder is questionable 95 * [LANG-360] - Why does appendIdentityToString return null? 96 * [LANG-361] - BooleanUtils toBooleanObject javadoc does not match implementation 97 * [LANG-363] - StringEscapeUtils..escapeJavaScript() method did not escape '/' into '\/', it will make IE render page incorrectly 98 * [LANG-364] - Documentation bug for ignoreEmptyTokens accessors in StrTokenizer 99 * [LANG-365] - BooleanUtils.toBoolean() - invalid drop-thru in case statement causes StringIndexOutOfBoundsException 100 * [LANG-367] - FastDateFormat thread safety 101 * [LANG-368] - FastDateFormat getDateInstance() and getDateTimeInstance() assume Locale.getDefault() won't change 102 * [LANG-369] - ExceptionUtils not thread-safe 103 * [LANG-372] - ToStringBuilder: MULTI_LINE_STYLE does not print anything from appendToString methods. 104 * [LANG-380] - infinite loop in Fraction.reduce when numerator == 0 105 * [LANG-381] - NumberUtils.min(floatArray) returns wrong value if floatArray[0] happens to be Float.NaN 106 * [LANG-385] - https://commons.apache.org/proper/commons-lang/developerguide.html "Building" section is incorrect and incomplete 107 * [LANG-393] - EqualsBuilder don't compare BigDecimals correctly 108 * [LANG-399] - Javadoc bugs - cannot find object 109 * [LANG-410] - Ambiguous / confusing names in StringUtils replace* methods 110 * [LANG-412] - StrBuilder appendFixedWidth does not handle nulls 111 * [LANG-414] - DateUtils.round() often fails 112 113IMPROVEMENTS IN 2.4: 114 115 * [LANG-180] - adding a StringUtils.replace method that takes an array or List of replacement strings 116 * [LANG-192] - Split camel case strings 117 * [LANG-257] - Add new splitByWholeSeparatorPreserveAllTokens() methods to StringUtils 118 * [LANG-269] - Shouldn't Commons Lang's StringUtils have a "common" string method? 119 * [LANG-298] - ClassUtils.getShortClassName and ClassUtils.getPackageName and class of array 120 * [LANG-321] - Add toArray() method to IntRange and LongRange classes 121 * [LANG-322] - ClassUtils.getShortClassName(String) inefficient 122 * [LANG-326] - StringUtils: startsWith / endsWith / startsWithIgnoreCase / endsWithIgnoreCase / removeStartIgnoreCase / removeEndIgnoreCase methods 123 * [LANG-329] - Pointless synchronized in ThreadLocal.initialValue should be removed 124 * [LANG-333] - ArrayUtils.toClass 125 * [LANG-337] - Utility class constructor javadocs should acknowledge that they may sometimes be used, e.g. with Velocity. 126 * [LANG-338] - truncateNicely method which avoids truncating in the middle of a word 127 * [LANG-345] - Optimize HashCodeBuilder.append(Object) 128 * [LANG-351] - Extension to ClassUtils: Obtain the primitive class from a wrapper 129 * [LANG-356] - Add getStartTime to StopWatch 130 * [LANG-362] - Add ExtendedMessageFormat to org.apache.commons.lang.text 131 * [LANG-371] - ToStringStyle javadoc should show examples of styles 132 * [LANG-374] - Add escaping for CSV columns to StringEscapeUtils 133 * [LANG-375] - add SystemUtils.IS_OS_WINDOWS_VISTA field 134 * [LANG-379] - Calculating A date fragment in any time-unit 135 * [LANG-383] - Adding functionality to DateUtils to allow direct setting of various fields. 136 * [LANG-402] - OSGi-ify Lang 137 * [LANG-404] - Add Calendar flavour format methods to DateFormatUtils 138 * [LANG-407] - StringUtils.length(String) returns null-safe length 139 * [LANG-413] - Memory usage improvement for StringUtils#getLevenshteinDistance() 140