You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Alex Marshall (JIRA)" <ji...@apache.org> on 2007/05/21 02:49:23 UTC

[jira] Updated: (LANG-335) Comparisons of Dates and Calendars to second precision

     [ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Marshall updated LANG-335:
-------------------------------

    Attachment: DateUtilsExtensions.java

DateUtilsExtensions.java contains sample implementations for equals and hashCode that were taken straight from the Sun 1.6.0 JDK implementation and modified to provide equals and hashCode functions to second-level precision.

> Comparisons of Dates and Calendars to second precision
> ------------------------------------------------------
>
>                 Key: LANG-335
>                 URL: https://issues.apache.org/jira/browse/LANG-335
>             Project: Commons Lang
>          Issue Type: New Feature
>    Affects Versions: 2.3
>         Environment: Windows, JDK 1.6.0, Eclipse 3.2
>            Reporter: Alex Marshall
>            Priority: Trivial
>         Attachments: DateUtilsExtensions.java
>
>
> The o.a.c.lang.time.DateUtils should have functions for comparing dates and Calendars to only second precision instead of millisecond.  The motivation for this is comparison of dates and Calendars in objects both before and after the objects have been committed to and retrieved from a database.  In theory the objects should be equal if 'equals' is run on them, but in practice they are not because the date fields do not have exactly the same millisecond values after they've been persisted to a database since times in many databases are only maintained to second-level precision (and without TimeZone information in many cases, to boot!)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [jira] Updated: (LANG-335) Comparisons of Dates and Calendars to second precision

Posted by Niall Pemberton <ni...@gmail.com>.
On 5/21/07, Niall Pemberton <ni...@gmail.com> wrote:
> On 5/21/07, Thorbjørn Ravn Andersen <th...@gmail.com> wrote:
> > Alex Marshall (JIRA) skrev  den 21-05-2007 02:49:
> > >      [ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
> > >
> > > Alex Marshall updated LANG-335:
> > > -------------------------------
> > >
> > >     Attachment: DateUtilsExtensions.java
> > >
> > > DateUtilsExtensions.java contains sample implementations for equals and hashCode that were taken straight from the Sun 1.6.0 JDK implementation and modified to provide equals and hashCode functions to second-level precision.
> > >
> > Clarify me on this - is it allowed to use GPL code in Apache projects?
>
> No, but this is even worse since JDK 1.6.0 source code is not under
> the GPL license or any kind of FOSS license.

btw thanks for highlighting this - I've closed the ticket and deleted
the attachment

> Niall
>
> > --
> >
> >   Thorbjørn
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [jira] Updated: (LANG-335) Comparisons of Dates and Calendars to second precision

Posted by Niall Pemberton <ni...@gmail.com>.
On 5/21/07, Thorbjørn Ravn Andersen <th...@gmail.com> wrote:
> Alex Marshall (JIRA) skrev  den 21-05-2007 02:49:
> >      [ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
> >
> > Alex Marshall updated LANG-335:
> > -------------------------------
> >
> >     Attachment: DateUtilsExtensions.java
> >
> > DateUtilsExtensions.java contains sample implementations for equals and hashCode that were taken straight from the Sun 1.6.0 JDK implementation and modified to provide equals and hashCode functions to second-level precision.
> >
> Clarify me on this - is it allowed to use GPL code in Apache projects?

No, but this is even worse since JDK 1.6.0 source code is not under
the GPL license or any kind of FOSS license.

Niall

> --
>
>   Thorbjørn

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [jira] Updated: (LANG-335) Comparisons of Dates and Calendars to second precision

Posted by Thorbjørn Ravn Andersen <th...@gmail.com>.
Alex Marshall (JIRA) skrev  den 21-05-2007 02:49:
>      [ https://issues.apache.org/jira/browse/LANG-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Alex Marshall updated LANG-335:
> -------------------------------
>
>     Attachment: DateUtilsExtensions.java
>
> DateUtilsExtensions.java contains sample implementations for equals and hashCode that were taken straight from the Sun 1.6.0 JDK implementation and modified to provide equals and hashCode functions to second-level precision.
>   
Clarify me on this - is it allowed to use GPL code in Apache projects?

-- 

  Thorbjørn