commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 26922] New: - public static boolean DateUtils.equals(Date dt1, Date dt2) ?
Date Fri, 13 Feb 2004 17:20:35 GMT
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


Mime
View raw message