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