xref: /aosp_15_r20/external/apache-commons-lang/src/site/xdoc/upgradeto2_1.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.1 Release Notes</title>
21  <author email="[email protected]">Commons Documentation Team</author>
22 </properties>
23<body>
24
25<section name="Lang 2.1 Release Notes">
26<p>
27These are the release notes and advice for upgrading Commons-Lang from
28version 2.0 to version 2.1.
29<source>
30INTRODUCTION:
31
32This document contains the release notes for the 2.1 version of Apache Jakarta Commons Lang.
33Commons Lang is a set of utility functions and reusable components that
34should be of use in any Java environment.
35
36
37INCOMPATIBLE CHANGES:
38
39- The Nestable interface defines the method indexOfThrowable(Class).
40Previously the implementations checked only for a specific Class.
41Now they check for subclasses of that Class as well.
42For most situations this will be the expected behavior (i.e. it's a bug fix).
43If it causes problems, please use the ExceptionUtils.indexOfThrowable(Class) method instead.
44Note that the ExceptionUtils method is available in v1.0 and v2.0 of commons-lang and has not been changed.
45(An alternative to this is to change the public static matchSubclasses flag on NestableDelegate.
46However, we don't recommend that as a long-term solution.)
47
48- The StopWatch class has had much extra validation added.
49If your code previously relied on unusual aspects, it may no longer work.
50
51- Starting with version 2.1, Ant version 1.6.x is required to build. Copy
52junit.jar to ANT_HOME/lib. You can get JUnit from https://www.junit.org. See the developer's guide
53for more details.
54
55
56DEPRECATIONS:
57
58- The enum package has been renamed to enums for JDK 1.5 compliance.
59All functionality is identical, just the package has changed.
60This package will be removed in v3.0.
61
62- NumberUtils.stringToInt - renamed to toInt
63
64- DateUtils - four constants, MILLIS_IN_* have been deprecated as they were defined
65as int not long. The replacements are MILLIS_PER_*.
66
67
68NEW FEATURES:
69
70New:
71- Mutable package - contains basic classes that hold an Object or primitive
72and provide both get and set methods.
73- DurationFormatUtils - provides various methods for formatting durations
74- CharEncoding - definitions of constants for character encoding work
75- CharUtils - utilities for working with characters
76
77Updated:
78- ArrayUtils - many more methods, especially List-like methods
79- BooleanUtils - isTrue and isFalse methods that handle null
80- ClassUtils - primitive to wrapper class conversion methods
81- ClassUtils - class name comparator
82- IllegalClassException - extra constructor for common instanceof case
83- NotImplementedException - supports nested exceptions
84- ObjectUtils - hashcode method handling null
85- StringUtils - isAsciiPrintable to check the contents of a string
86             -- ordinalIndexOf to find the nth index of a string
87             -- various remove methods to remove parts of a string
88             -- various split methods to provide more control over splitting a string
89             -- defaultIfEmpty to default a string if null or empty
90- SystemUtils - methods to get system properties as File objects
91             -- extra constants representing system properties
92- Validate - new methods to check whether all elements in a collection are of a specific type
93- WordUtils - new methods to capitalize based on a set of specified delimiters
94
95- EqualsBuilder - now provides setter to internal state
96- ToStringStyle - new style, short prefix style
97- ReflectionToStringBuilder - more flags to control the output with regards to statics
98
99- ExceptionUtils - added indexOfType methods that check subclasses, thus leaving the existing
100indexOfThrowable method untouched (see incompatible changes section)
101
102- NumberUtils - various string to number parsing methods added
103
104- DateUtils - methods added to compare dates in various ways
105           -- method to parse a date string using multiple patterns
106- FastDateFormat - extra formatting methods that take in a millisecond long value
107                -- additional static factory methods
108- StopWatch - new methods for split behavior
109
110
111BUG FIXES:
112
11319331  General case: infinite loop: ToStringBuilder.reflectionToString
11423174  EqualsBuilder.append(Object[], Object[]) throws NPE
11523356  Make DurationFormatUtils public!
11623557  WordUtils.capitalizeFully(String str) should take a delimiters
11723683  New method for converting a primitive Class to its corresponding wrapper
11823430  Minor javadoc fixes for StringUtils.contains(String, String)
11923590  make optional parameters in FastDateFormat really optional
12024056  Documentation error in StringUtils.replace
12125227  StringEscapeUtils.unescapeHtml() doesn't handle hex entities
12225454  new StringUtils.replaceChars behaves differently from old Ch
12325560  DateUtils.truncate() is off by one hour when using a date in DST switch 'zone'
12425627  DateUtils constants should be long
12525683  Add method that validates Collection elements are a correct
12625849  Add SystemUtils methods for directory properties.
12726616  ClassCastException in Enum.equals(Object)
12826699  Tokenizer Enhancements: reset input string, static CSV
12926734  NullPointerException in EqualsBuilder.append(Object[], Object[])
13026877  Add SystemUtils.AWT_TOOLKIT and others.
13126922  public static boolean DateUtils.equals(Date dt1, Date dt2)
13227592  WordUtils capitalize improvement
13327876  ReflectionToStringBuilder.toString(null) throws exception by design
13427877  Make ClassUtils methods null-safe and not throw an IAE.
13528468  StringUtils.defaultString: Documentation error
13628554  Add hashCode-support to class ObjectUtils
13729082  Enhancement of ExceptionUtils.CAUSE_METHOD_NAMES
13829149  StringEscapeUtils.unescapeHtml() doesn't handle an empty entity
13929294  lang.math.Fraction class deficiencies
14029673  ExceptionUtils: new getCause() methodname (for tomcat)
14129794  Add convenience format(long) methods to FastDateForma
14230328  HashCodeBuilder does not use the same values as Boolean (fixed as documentation)
14330334  New class proposal: CharacterEncoding
14430674  parseDate class from HttpClient's DateParser class
14530815  ArrayUtils.isEquals() throws ClassCastException when array1
14630929  Nestable.indexOfThrowable(Class)  uses Class.equals() to match
14731395  DateUtils.truncate oddity at the far end of the Date spectrum
14831478  Compile error with JDK 5 "enum" is a keyword
14931572  o.a.c.lang.enum.ValuedEnum: 'enum' is a keyword in JDK 1.5.0
15031933  ToStringStyle setArrayEnd handled null incorrectly
15132133  SystemUtils fails init on HP-UX
15232198  Error in Javadoc for StringUtils.chomp(String, String)
15332625  Can't subclass EqualsBuilder because isEquals is private
15433067  EqualsBuilder.append(Object[], Object[]) crashes with a NullPointerException if an element of the first array is null
15533069  EqualsBuilder.append(Object[], Object[]) incorrectly checks that rhs[i] is instance of lhs[i]'s class
15633574  unbalanced ReflectionToStringBuilder
15733737  ExceptionUtils.addCauseMethodName(String) does not check for duplicates.
158</source>
159</p>
160</section>
161
162</body>
163</document>
164