You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/02/13 18:20:35 UTC
DO NOT REPLY [Bug 26922] New: -
public static boolean DateUtils.equals(Date dt1, Date dt2) ?
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26922>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26922
public static boolean DateUtils.equals(Date dt1, Date dt2) ?
Summary: public static boolean DateUtils.equals(Date dt1, Date
dt2) ?
Product: Commons
Version: 2.0 Final
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: Other
Component: Lang
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: mpatron@influe.com
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));
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org