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