[jira] [Created] (LANG-755) DateFormatUtils.format manipulates Calendar behaviour

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (LANG-755) DateFormatUtils.format manipulates Calendar behaviour

ASF GitHub Bot (Jira)
DateFormatUtils.format manipulates Calendar behaviour
-----------------------------------------------------

                 Key: LANG-755
                 URL: https://issues.apache.org/jira/browse/LANG-755
             Project: Commons Lang
          Issue Type: Bug
          Components: lang.time.*
            Reporter: hans-jürgen kozik
            Priority: Minor


@Test
public void testClearCalendar() throws Exception {
  Calendar calDate = Calendar.getInstance();
  c.clear(Calendar.MINUTE);
  System.out.println(calDate.isSet(Calendar.MINUTE)); --false
  System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(calDate));
  System.out.println(calDate.isSet(Calendar.MINUTE)); --true
}
 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (LANG-755) DateFormatUtils.format manipulates Calendar behaviour

ASF GitHub Bot (Jira)

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

hans-jürgen kozik updated LANG-755:
-----------------------------------

    Description:
{code}
@Test
public void testClearCalendar() throws Exception {
  Calendar calDate = Calendar.getInstance();
  c.clear(Calendar.MINUTE);
  System.out.println(calDate.isSet(Calendar.MINUTE)); --false
  System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(calDate));
  System.out.println(calDate.isSet(Calendar.MINUTE)); --true
}
{code}

  was:
{code:title=Bar.java|borderStyle=solid}
@Test
public void testClearCalendar() throws Exception {
  Calendar calDate = Calendar.getInstance();
  c.clear(Calendar.MINUTE);
  System.out.println(calDate.isSet(Calendar.MINUTE)); --false
  System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(calDate));
  System.out.println(calDate.isSet(Calendar.MINUTE)); --true
}
{code}


> DateFormatUtils.format manipulates Calendar behaviour
> -----------------------------------------------------
>
>                 Key: LANG-755
>                 URL: https://issues.apache.org/jira/browse/LANG-755
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.time.*
>            Reporter: hans-jürgen kozik
>            Priority: Minor
>
> {code}
> @Test
> public void testClearCalendar() throws Exception {
>   Calendar calDate = Calendar.getInstance();
>   c.clear(Calendar.MINUTE);
>   System.out.println(calDate.isSet(Calendar.MINUTE)); --false
>   System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(calDate));
>   System.out.println(calDate.isSet(Calendar.MINUTE)); --true
> }
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (LANG-755) DateFormatUtils.format manipulates Calendar behaviour

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

hans-jürgen kozik updated LANG-755:
-----------------------------------

    Description:
{code:title=Bar.java|borderStyle=solid}
@Test
public void testClearCalendar() throws Exception {
  Calendar calDate = Calendar.getInstance();
  c.clear(Calendar.MINUTE);
  System.out.println(calDate.isSet(Calendar.MINUTE)); --false
  System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(calDate));
  System.out.println(calDate.isSet(Calendar.MINUTE)); --true
}
{code}

  was:
@Test
public void testClearCalendar() throws Exception {
  Calendar calDate = Calendar.getInstance();
  c.clear(Calendar.MINUTE);
  System.out.println(calDate.isSet(Calendar.MINUTE)); --false
  System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(calDate));
  System.out.println(calDate.isSet(Calendar.MINUTE)); --true
}
 


> DateFormatUtils.format manipulates Calendar behaviour
> -----------------------------------------------------
>
>                 Key: LANG-755
>                 URL: https://issues.apache.org/jira/browse/LANG-755
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.time.*
>            Reporter: hans-jürgen kozik
>            Priority: Minor
>
> {code:title=Bar.java|borderStyle=solid}
> @Test
> public void testClearCalendar() throws Exception {
>   Calendar calDate = Calendar.getInstance();
>   c.clear(Calendar.MINUTE);
>   System.out.println(calDate.isSet(Calendar.MINUTE)); --false
>   System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(calDate));
>   System.out.println(calDate.isSet(Calendar.MINUTE)); --true
> }
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (LANG-755) DateFormatUtils.format manipulates Calendar behaviour

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

hans-jürgen kozik updated LANG-755:
-----------------------------------

    Description:
{code}
@Test
public void testClearCalendar() {
  Calendar cal = Calendar.getInstance();
  cal.clear(Calendar.MINUTE);
  System.out.println(cal.isSet(Calendar.MINUTE)); //false
  System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(cal));
  System.out.println(cal.isSet(Calendar.MINUTE)); //true
}
{code}

  was:
{code}
@Test
public void testClearCalendar() throws Exception {
  Calendar calDate = Calendar.getInstance();
  c.clear(Calendar.MINUTE);
  System.out.println(calDate.isSet(Calendar.MINUTE)); //false
  System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(calDate));
  System.out.println(calDate.isSet(Calendar.MINUTE)); //true
}
{code}


> DateFormatUtils.format manipulates Calendar behaviour
> -----------------------------------------------------
>
>                 Key: LANG-755
>                 URL: https://issues.apache.org/jira/browse/LANG-755
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.time.*
>            Reporter: hans-jürgen kozik
>            Priority: Minor
>
> {code}
> @Test
> public void testClearCalendar() {
>   Calendar cal = Calendar.getInstance();
>   cal.clear(Calendar.MINUTE);
>   System.out.println(cal.isSet(Calendar.MINUTE)); //false
>   System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(cal));
>   System.out.println(cal.isSet(Calendar.MINUTE)); //true
> }
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (LANG-755) DateFormatUtils.format manipulates Calendar behaviour

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

hans-jürgen kozik updated LANG-755:
-----------------------------------

    Description:
{code}
@Test
public void testClearCalendar() throws Exception {
  Calendar calDate = Calendar.getInstance();
  c.clear(Calendar.MINUTE);
  System.out.println(calDate.isSet(Calendar.MINUTE)); //false
  System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(calDate));
  System.out.println(calDate.isSet(Calendar.MINUTE)); //true
}
{code}

  was:
{code}
@Test
public void testClearCalendar() throws Exception {
  Calendar calDate = Calendar.getInstance();
  c.clear(Calendar.MINUTE);
  System.out.println(calDate.isSet(Calendar.MINUTE)); --false
  System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(calDate));
  System.out.println(calDate.isSet(Calendar.MINUTE)); --true
}
{code}


> DateFormatUtils.format manipulates Calendar behaviour
> -----------------------------------------------------
>
>                 Key: LANG-755
>                 URL: https://issues.apache.org/jira/browse/LANG-755
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.time.*
>            Reporter: hans-jürgen kozik
>            Priority: Minor
>
> {code}
> @Test
> public void testClearCalendar() throws Exception {
>   Calendar calDate = Calendar.getInstance();
>   c.clear(Calendar.MINUTE);
>   System.out.println(calDate.isSet(Calendar.MINUTE)); //false
>   System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(calDate));
>   System.out.println(calDate.isSet(Calendar.MINUTE)); //true
> }
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (LANG-755) DateFormatUtils.format manipulates Calendar behaviour

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/LANG-755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151068#comment-13151068 ]

Henri Yandell commented on LANG-755:
------------------------------------

Confirmed.

It appears to be a JDK bug, calling cal.get(Calendar.*) undoes the cal.clear(Calendar.*) call.
               

> DateFormatUtils.format manipulates Calendar behaviour
> -----------------------------------------------------
>
>                 Key: LANG-755
>                 URL: https://issues.apache.org/jira/browse/LANG-755
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.time.*
>            Reporter: hans-jürgen kozik
>            Priority: Minor
>
> {code}
> @Test
> public void testClearCalendar() {
>   Calendar cal = Calendar.getInstance();
>   cal.clear(Calendar.MINUTE);
>   System.out.println(cal.isSet(Calendar.MINUTE)); //false
>   System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(cal));
>   System.out.println(cal.isSet(Calendar.MINUTE)); //true
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply | Threaded
Open this post in threaded view
|

[jira] [Issue Comment Edited] (LANG-755) DateFormatUtils.format manipulates Calendar behaviour

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/LANG-755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151068#comment-13151068 ]

Henri Yandell edited comment on LANG-755 at 11/16/11 7:20 AM:
--------------------------------------------------------------

Confirmed.

It appears to be a JDK bug, calling cal.get(Calendar.\*) undoes the cal.clear(Calendar.\*) call.
               
      was (Author: bayard):
    Confirmed.

It appears to be a JDK bug, calling cal.get(Calendar.*) undoes the cal.clear(Calendar.*) call.
                 

> DateFormatUtils.format manipulates Calendar behaviour
> -----------------------------------------------------
>
>                 Key: LANG-755
>                 URL: https://issues.apache.org/jira/browse/LANG-755
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.time.*
>            Reporter: hans-jürgen kozik
>            Priority: Minor
>
> {code}
> @Test
> public void testClearCalendar() {
>   Calendar cal = Calendar.getInstance();
>   cal.clear(Calendar.MINUTE);
>   System.out.println(cal.isSet(Calendar.MINUTE)); //false
>   System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(cal));
>   System.out.println(cal.isSet(Calendar.MINUTE)); //true
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (LANG-755) DateFormatUtils.format manipulates Calendar behaviour

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

Henri Yandell updated LANG-755:
-------------------------------

    Fix Version/s: 3.2

We should definitely javadoc this. I'm not sure we can do much else. It'd be good to test on the latest JDK to see if it's been fixed.

Setting a 3.2 fixversion for the javadoc as it seems like a very non-intrusive change.
               

> DateFormatUtils.format manipulates Calendar behaviour
> -----------------------------------------------------
>
>                 Key: LANG-755
>                 URL: https://issues.apache.org/jira/browse/LANG-755
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.time.*
>            Reporter: hans-jürgen kozik
>            Priority: Minor
>             Fix For: 3.2
>
>
> {code}
> @Test
> public void testClearCalendar() {
>   Calendar cal = Calendar.getInstance();
>   cal.clear(Calendar.MINUTE);
>   System.out.println(cal.isSet(Calendar.MINUTE)); //false
>   System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(cal));
>   System.out.println(cal.isSet(Calendar.MINUTE)); //true
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply | Threaded
Open this post in threaded view
|

[jira] [Closed] (LANG-755) DateFormatUtils.format manipulates Calendar behaviour

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

Henri Yandell closed LANG-755.
------------------------------

    Resolution: Won't Fix

JDK bug. I've made a note in the javadoc of DateFormatUtils (r1299560).
               

> DateFormatUtils.format manipulates Calendar behaviour
> -----------------------------------------------------
>
>                 Key: LANG-755
>                 URL: https://issues.apache.org/jira/browse/LANG-755
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.time.*
>            Reporter: hans-jürgen kozik
>            Priority: Minor
>             Fix For: 3.2
>
>
> {code}
> @Test
> public void testClearCalendar() {
>   Calendar cal = Calendar.getInstance();
>   cal.clear(Calendar.MINUTE);
>   System.out.println(cal.isSet(Calendar.MINUTE)); //false
>   System.out.println(DateFormatUtils.ISO_DATETIME_FORMAT.format(cal));
>   System.out.println(cal.isSet(Calendar.MINUTE)); //true
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira