Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-120

[lang] public static boolean DateUtils.equals(Date dt1, Date dt2) ?

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.1
    • lang.time.*
    • 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)); }

      Attachments

        Activity

          People

            Unassigned Unassigned
            mpatron@influe.com Mickael Patron
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: