Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0
-
None
-
Operating System: All
Platform: All
-
26922
Description
Hello,
In org.apache.commons.lang.StringUtils, we can find StringUtils.equals(?,?).
org.apache.commons.lang.time.DateUtils should have the same. Like this :
/**
- <p>Compares two Dates, returning <code>true</code> if they are equal.</p>
* - <p><code>null</code>s are handled without exceptions. Two
<code>null</code> - references are considered to be equal.</p>
* - <pre>
- DateUtils.equals(null, null) = true
- DateUtils.equals(null, "abc") = false
- DateUtils.equals("abc", null) = false
- DateUtils.equals("abc", "abc") = true
- DateUtils.equals("abc", "ABC") = false
- </pre>
* - @see java.util.Date#equals(Object)
- @param dt1 the first Date, may be null
- @param dt2 the second Date, may be null
- @return <code>true</code> if the Dates are equal or both
<code>null</code>
*/
public static boolean equals(Date dt1, Date dt2) { return (dt1 == null ? dt2 == null : dt1.equals(dt2)); }