Groovy
  1. Groovy
  2. GROOVY-3332

The groovy.time.*Duration classes make use of java.sql.Date

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6-rc-2
    • Fix Version/s: 2.2.0-beta-1
    • Component/s: groovy-jdk
    • Labels:
      None

      Description

      The groovy.time.*Duration classes make use of java.sql.Date, but there seems to be no justification for doing so.

      java.sql.Date is basically the same as java.util.Date except for the toString() formatting. So the second assert fails while the first assert succeeds:

      use (org.codehaus.groovy.runtime.TimeCategory) {
      
       Date dt1 = 0.days.from.now
       Date dt2 = new Date(0.days.from.now.time)
      
       assert dt1 == dt2
       assert dt1.toString() == dt2.toString() 
      }
      
      1. groovy-3332.patch
        1 kB
        Brad Long
      2. Groovy3332Bug.groovy
        0.4 kB
        Brad Long

        Issue Links

          Activity

          Alexander Veit created issue -
          Brad Long made changes -
          Field Original Value New Value
          Attachment Groovy3332Bug.groovy [ 50301 ]
          Attachment groovy-3332.patch [ 50300 ]
          Pascal Schumacher made changes -
          Issue Type Bug [ 1 ] Improvement [ 4 ]
          Assignee Pascal Schumacher [ pschumacher ]
          Pascal Schumacher made changes -
          Resolution Fixed [ 1 ]
          Fix Version/s 2.2.0-beta-1 [ 19074 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Pascal Schumacher made changes -
          Link This issue is duplicated by GROOVY-6083 [ GROOVY-6083 ]
          Paul King made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
          Mark Thomas made changes -
          Workflow jira [ 12732328 ] Default workflow, editable Closed status [ 12744139 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
          Mark Thomas made changes -
          Workflow jira [ 12970153 ] Default workflow, editable Closed status [ 12977920 ]

            People

            • Assignee:
              Pascal Schumacher
              Reporter:
              Alexander Veit
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development