xref: /aosp_15_r20/external/apache-commons-lang/src/site/xdoc/upgradeto2_4.xml (revision 455610af95f3bf5f4bc8a9eda520f57e389a4c42)
1*455610afSAndroid Build Coastguard Worker<?xml version="1.0"?>
2*455610afSAndroid Build Coastguard Worker<!--
3*455610afSAndroid Build Coastguard WorkerLicensed to the Apache Software Foundation (ASF) under one or more
4*455610afSAndroid Build Coastguard Workercontributor license agreements.  See the NOTICE file distributed with
5*455610afSAndroid Build Coastguard Workerthis work for additional information regarding copyright ownership.
6*455610afSAndroid Build Coastguard WorkerThe ASF licenses this file to You under the Apache License, Version 2.0
7*455610afSAndroid Build Coastguard Worker(the "License"); you may not use this file except in compliance with
8*455610afSAndroid Build Coastguard Workerthe License.  You may obtain a copy of the License at
9*455610afSAndroid Build Coastguard Worker
10*455610afSAndroid Build Coastguard Worker     http://www.apache.org/licenses/LICENSE-2.0
11*455610afSAndroid Build Coastguard Worker
12*455610afSAndroid Build Coastguard WorkerUnless required by applicable law or agreed to in writing, software
13*455610afSAndroid Build Coastguard Workerdistributed under the License is distributed on an "AS IS" BASIS,
14*455610afSAndroid Build Coastguard WorkerWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15*455610afSAndroid Build Coastguard WorkerSee the License for the specific language governing permissions and
16*455610afSAndroid Build Coastguard Workerlimitations under the License.
17*455610afSAndroid Build Coastguard Worker-->
18*455610afSAndroid Build Coastguard Worker<document>
19*455610afSAndroid Build Coastguard Worker <properties>
20*455610afSAndroid Build Coastguard Worker  <title>2.4 Release Notes</title>
21*455610afSAndroid Build Coastguard Worker  <author email="[email protected]">Commons Documentation Team</author>
22*455610afSAndroid Build Coastguard Worker </properties>
23*455610afSAndroid Build Coastguard Worker<body>
24*455610afSAndroid Build Coastguard Worker
25*455610afSAndroid Build Coastguard Worker<section name="Lang 2.4 Release Notes">
26*455610afSAndroid Build Coastguard Worker<p>
27*455610afSAndroid Build Coastguard WorkerThese are the release notes and advice for upgrading Commons-Lang from
28*455610afSAndroid Build Coastguard Workerversion 2.3 to version 2.4. <br/><br/>See '<a href="article2_4.html">What's new in 2.4?</a>' for more information.
29*455610afSAndroid Build Coastguard Worker<source>
30*455610afSAndroid Build Coastguard WorkerINTRODUCTION:
31*455610afSAndroid Build Coastguard Worker
32*455610afSAndroid Build Coastguard WorkerThis document contains the release notes for the 2.4 version of Apache Commons Lang.
33*455610afSAndroid Build Coastguard WorkerCommons Lang is a set of utility functions and reusable components that should be of use in any Java environment.
34*455610afSAndroid Build Coastguard Worker
35*455610afSAndroid Build Coastguard WorkerLang 2.4 no longer attempts to target the Java 1.1 environment and now targets Java 1.2. While previous versions
36*455610afSAndroid Build Coastguard Workerwere built for 1.1, some parts were using methods that were only available in 1.2, and the Enum class had
37*455610afSAndroid Build Coastguard Workerbecome dependent on Java 1.3.
38*455610afSAndroid Build Coastguard Worker
39*455610afSAndroid Build Coastguard WorkerINCOMPATIBLE CHANGES WITH VERSION 2.3:
40*455610afSAndroid Build Coastguard Worker
41*455610afSAndroid Build Coastguard Worker- None
42*455610afSAndroid Build Coastguard Worker
43*455610afSAndroid Build Coastguard WorkerINCOMPATIBLE CHANGES WITH VERSION 2.2:
44*455610afSAndroid Build Coastguard Worker
45*455610afSAndroid Build Coastguard Worker- Calling stop on a suspended StopWatch will no longer change the underlying time.
46*455610afSAndroid Build Coastguard Worker  It's very unlikely anyone was relying on that bug as a feature.
47*455610afSAndroid Build Coastguard Worker
48*455610afSAndroid Build Coastguard WorkerADDITIONAL INCOMPATIBLE CHANGES WITH VERSION 2.0:
49*455610afSAndroid Build Coastguard Worker
50*455610afSAndroid Build Coastguard Worker- The Nestable interface defines the method indexOfThrowable(Class).
51*455610afSAndroid Build Coastguard WorkerPreviously the implementations checked only for a specific Class.
52*455610afSAndroid Build Coastguard WorkerNow they check for subclasses of that Class as well.
53*455610afSAndroid Build Coastguard WorkerFor most situations this will be the expected behavior (i.e. it's a bug fix).
54*455610afSAndroid Build Coastguard WorkerIf it causes problems, please use the ExceptionUtils.indexOfThrowable(Class) method instead.
55*455610afSAndroid Build Coastguard WorkerNote that the ExceptionUtils method is available in v1.0 and v2.0 of commons-lang and has not been changed.
56*455610afSAndroid Build Coastguard Worker(An alternative to this is to change the public static matchSubclasses flag on NestableDelegate.
57*455610afSAndroid Build Coastguard WorkerHowever, we don't recommend that as a long-term solution.)
58*455610afSAndroid Build Coastguard Worker
59*455610afSAndroid Build Coastguard Worker- The StopWatch class has had much extra validation added.
60*455610afSAndroid Build Coastguard WorkerIf your code previously relied on unusual aspects, it may no longer work.
61*455610afSAndroid Build Coastguard Worker
62*455610afSAndroid Build Coastguard Worker- Starting with version 2.1, Ant version 1.6.x is required to build. Copy
63*455610afSAndroid Build Coastguard Workerjunit.jar to ANT_HOME/lib. You can get JUnit from https://www.junit.org. See the developer's guide
64*455610afSAndroid Build Coastguard Workerfor more details.
65*455610afSAndroid Build Coastguard Worker
66*455610afSAndroid Build Coastguard WorkerDEPRECATIONS FROM 2.3 to 2.4:
67*455610afSAndroid Build Coastguard Worker
68*455610afSAndroid Build Coastguard Worker- ObjectUtils.appendIdentityToString(StringBuffer, Object) - has very odd semantics, use
69*455610afSAndroid Build Coastguard Worker  ObjectUtils.identityToString(StringBuffer, Object) instead.
70*455610afSAndroid Build Coastguard Worker
71*455610afSAndroid Build Coastguard Worker- public static java.util.Date add(java.util.Date, int, int) - it is not intended for this
72*455610afSAndroid Build Coastguard Worker  method to be public. Please let us know if you use this.
73*455610afSAndroid Build Coastguard Worker
74*455610afSAndroid Build Coastguard WorkerDEPRECATIONS FROM 2.2 to 2.3:
75*455610afSAndroid Build Coastguard Worker
76*455610afSAndroid Build Coastguard Worker- None
77*455610afSAndroid Build Coastguard Worker
78*455610afSAndroid Build Coastguard WorkerDEPRECATIONS FROM 2.1 to 2.2:
79*455610afSAndroid Build Coastguard Worker
80*455610afSAndroid Build Coastguard Worker- None
81*455610afSAndroid Build Coastguard Worker
82*455610afSAndroid Build Coastguard WorkerDEPRECATIONS FROM 2.0 to 2.1:
83*455610afSAndroid Build Coastguard Worker
84*455610afSAndroid Build Coastguard Worker- The enum package has been renamed to enums for JDK 1.5 compliance.
85*455610afSAndroid Build Coastguard WorkerAll functionality is identical, just the package has changed.
86*455610afSAndroid Build Coastguard WorkerThis package will be removed in v3.0.
87*455610afSAndroid Build Coastguard Worker
88*455610afSAndroid Build Coastguard Worker- NumberUtils.stringToInt - renamed to toInt
89*455610afSAndroid Build Coastguard Worker
90*455610afSAndroid Build Coastguard Worker- DateUtils - four constants, MILLIS_IN_* have been deprecated as they were defined
91*455610afSAndroid Build Coastguard Workeras int not long. The replacements are MILLIS_PER_*.
92*455610afSAndroid Build Coastguard Worker
93*455610afSAndroid Build Coastguard Worker
94*455610afSAndroid Build Coastguard WorkerBUG FIXES IN 2.4:
95*455610afSAndroid Build Coastguard Worker
96*455610afSAndroid Build Coastguard Worker    * [LANG-76 ] - EnumUtils.getEnum() doesn't work well in 1.5
97*455610afSAndroid Build Coastguard Worker    * [LANG-328] - LocaleUtils.toLocale() rejects strings with only language+variant
98*455610afSAndroid Build Coastguard Worker    * [LANG-334] - Enum is not thread-safe
99*455610afSAndroid Build Coastguard Worker    * [LANG-346] - Dates.round() behaves incorrectly for minutes and seconds
100*455610afSAndroid Build Coastguard Worker    * [LANG-349] - Deadlock using ReflectionToStringBuilder
101*455610afSAndroid Build Coastguard Worker    * [LANG-353] - Javadoc Example for EqualsBuilder is questionable
102*455610afSAndroid Build Coastguard Worker    * [LANG-360] - Why does appendIdentityToString return null?
103*455610afSAndroid Build Coastguard Worker    * [LANG-361] - BooleanUtils toBooleanObject javadoc does not match implementation
104*455610afSAndroid Build Coastguard Worker    * [LANG-363] - StringEscapeUtils..escapeJavaScript() method did not escape '/' into '\/', it will make IE render page incorrectly
105*455610afSAndroid Build Coastguard Worker    * [LANG-364] - Documentation bug for ignoreEmptyTokens accessors in StrTokenizer
106*455610afSAndroid Build Coastguard Worker    * [LANG-365] - BooleanUtils.toBoolean() - invalid drop-thru in case statement causes StringIndexOutOfBoundsException
107*455610afSAndroid Build Coastguard Worker    * [LANG-367] - FastDateFormat thread safety
108*455610afSAndroid Build Coastguard Worker    * [LANG-368] - FastDateFormat getDateInstance() and getDateTimeInstance() assume Locale.getDefault() won't change
109*455610afSAndroid Build Coastguard Worker    * [LANG-369] - ExceptionUtils not thread-safe
110*455610afSAndroid Build Coastguard Worker    * [LANG-372] - ToStringBuilder: MULTI_LINE_STYLE does not print anything from appendToString methods.
111*455610afSAndroid Build Coastguard Worker    * [LANG-380] - infinite loop in Fraction.reduce when numerator == 0
112*455610afSAndroid Build Coastguard Worker    * [LANG-381] - NumberUtils.min(floatArray) returns wrong value if floatArray[0] happens to be Float.NaN
113*455610afSAndroid Build Coastguard Worker    * [LANG-385] - https://commons.apache.org/proper/commons-lang/developerguide.html "Building" section is incorrect and incomplete
114*455610afSAndroid Build Coastguard Worker    * [LANG-393] - EqualsBuilder don't compare BigDecimals correctly
115*455610afSAndroid Build Coastguard Worker    * [LANG-399] - Javadoc bugs - cannot find object
116*455610afSAndroid Build Coastguard Worker    * [LANG-410] - Ambiguous / confusing names in StringUtils replace* methods
117*455610afSAndroid Build Coastguard Worker    * [LANG-412] - StrBuilder appendFixedWidth does not handle nulls
118*455610afSAndroid Build Coastguard Worker    * [LANG-414] - DateUtils.round() often fails
119*455610afSAndroid Build Coastguard Worker
120*455610afSAndroid Build Coastguard WorkerIMPROVEMENTS IN 2.4:
121*455610afSAndroid Build Coastguard Worker
122*455610afSAndroid Build Coastguard Worker    * [LANG-180] - adding a StringUtils.replace method that takes an array or List of replacement strings
123*455610afSAndroid Build Coastguard Worker    * [LANG-192] - Split camel case strings
124*455610afSAndroid Build Coastguard Worker    * [LANG-257] - Add new splitByWholeSeparatorPreserveAllTokens() methods to StringUtils
125*455610afSAndroid Build Coastguard Worker    * [LANG-269] - Shouldn't Commons Lang's StringUtils have a "common" string method?
126*455610afSAndroid Build Coastguard Worker    * [LANG-298] - ClassUtils.getShortClassName and ClassUtils.getPackageName and class of array
127*455610afSAndroid Build Coastguard Worker    * [LANG-321] - Add toArray() method to IntRange and LongRange classes
128*455610afSAndroid Build Coastguard Worker    * [LANG-322] - ClassUtils.getShortClassName(String) inefficient
129*455610afSAndroid Build Coastguard Worker    * [LANG-326] - StringUtils: startsWith / endsWith / startsWithIgnoreCase / endsWithIgnoreCase / removeStartIgnoreCase / removeEndIgnoreCase methods
130*455610afSAndroid Build Coastguard Worker    * [LANG-329] - Pointless synchronized in ThreadLocal.initialValue should be removed
131*455610afSAndroid Build Coastguard Worker    * [LANG-333] - ArrayUtils.toClass
132*455610afSAndroid Build Coastguard Worker    * [LANG-337] - Utility class constructor javadocs should acknowledge that they may sometimes be used, e.g. with Velocity.
133*455610afSAndroid Build Coastguard Worker    * [LANG-338] - truncateNicely method which avoids truncating in the middle of a word
134*455610afSAndroid Build Coastguard Worker    * [LANG-345] - Optimize HashCodeBuilder.append(Object)
135*455610afSAndroid Build Coastguard Worker    * [LANG-351] - Extension to ClassUtils: Obtain the primitive class from a wrapper
136*455610afSAndroid Build Coastguard Worker    * [LANG-356] - Add getStartTime to StopWatch
137*455610afSAndroid Build Coastguard Worker    * [LANG-362] - Add ExtendedMessageFormat to org.apache.commons.lang.text
138*455610afSAndroid Build Coastguard Worker    * [LANG-371] - ToStringStyle javadoc should show examples of styles
139*455610afSAndroid Build Coastguard Worker    * [LANG-374] - Add escaping for CSV columns to StringEscapeUtils
140*455610afSAndroid Build Coastguard Worker    * [LANG-375] - add SystemUtils.IS_OS_WINDOWS_VISTA field
141*455610afSAndroid Build Coastguard Worker    * [LANG-379] - Calculating A date fragment in any time-unit
142*455610afSAndroid Build Coastguard Worker    * [LANG-383] - Adding functionality to DateUtils to allow direct setting of various fields.
143*455610afSAndroid Build Coastguard Worker    * [LANG-402] - OSGi-ify Lang
144*455610afSAndroid Build Coastguard Worker    * [LANG-404] - Add Calendar flavour format methods to DateFormatUtils
145*455610afSAndroid Build Coastguard Worker    * [LANG-407] - StringUtils.length(String) returns null-safe length
146*455610afSAndroid Build Coastguard Worker    * [LANG-413] - Memory usage improvement for StringUtils#getLevenshteinDistance()
147*455610afSAndroid Build Coastguard Worker
148*455610afSAndroid Build Coastguard Worker</source>
149*455610afSAndroid Build Coastguard Worker</p>
150*455610afSAndroid Build Coastguard Worker</section>
151*455610afSAndroid Build Coastguard Worker
152*455610afSAndroid Build Coastguard Worker</body>
153*455610afSAndroid Build Coastguard Worker</document>
154