JDK-4082158 : GregorianCalendar.roll
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.1.4,1.1.5
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • OS: solaris_2.5.1,windows_95
  • CPU: x86,sparc
  • Submitted: 1997-09-26
  • Updated: 1998-02-24
  • Resolved: 1998-02-24
Related Reports
Relates :  
Description

Name: diC59631			Date: 09/26/97


GregorianCalendar c = new GregorianCalendar();
loop
	c.roll(GregorianCalendar.DATE,true);
end loop

This does not work over a month boundary.  It
fails to update the month.  (Rolling down does
the same thing.)  Therefore after August 31, we go
to August 1 instead of September 1.

I am using JavaWorkshop 2 and my classpath has 
jdk1.1.4/lib/classes.zip before the
JDK/lib/classes.zip
======================================================================

Comments
EVALUATION User error; the user is confusing the function of Calendar.roll() with Calendar.add(). The javadoc states clearly that Calendar.roll() does NOT change the value of the next larger field; that's why it's called ROLL. -alanl
2004-06-11

WORK AROUND Name: diC59631 Date: 09/26/97 ======================================================================
2004-06-11