[multiple changes]
2005-11-15 Tom Tromey <tromey@redhat.com> classpath/23890: * java/util/Calendar.java (equals): Include other calendar attributes. (hashCode): Updated. * java/util/GregorianCalendar.java (hashCode): New method. (equals): Use super.equals(). 2005-11-15 Sven de Marothy <sven@physto.se> * java/util/Calendar (setTimeInMillis): Recompute time fields. 2005-11-15 Mark Wielaard <mark@klomp.org> * java/util/SimpleTimeZone.java: Removed, fully merged now. * java/util/Date.java: Likewise. * sources.am: Regenerated. * Makefile.in: Regenerated. 2005-11-15 David Gilbert <david.gilbert@object-refinery.com> * java/util/Calendar.java: fixed minor problems in API docs, * java/util/Date.java: likewise, * java/util/ResourceBundle.java: likewise, * java/util/SimpleTimeZone.java: likewise, From-SVN: r107094
This commit is contained in:
parent
ab156144da
commit
46f32b2b90
8 changed files with 66 additions and 2349 deletions
|
@ -629,6 +629,7 @@ public abstract class Calendar implements Serializable, Cloneable
|
|||
clear();
|
||||
this.time = time;
|
||||
isTimeSet = true;
|
||||
computeFields();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -879,7 +880,6 @@ public abstract class Calendar implements Serializable, Cloneable
|
|||
|
||||
/**
|
||||
* Fills any unset fields in the time field list
|
||||
* @return true if the specified field has a value.
|
||||
*/
|
||||
protected void complete()
|
||||
{
|
||||
|
@ -897,8 +897,19 @@ public abstract class Calendar implements Serializable, Cloneable
|
|||
*/
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
return (o instanceof Calendar)
|
||||
&& getTimeInMillis() == ((Calendar) o).getTimeInMillis();
|
||||
if (! (o instanceof Calendar))
|
||||
return false;
|
||||
Calendar cal = (Calendar) o;
|
||||
if (getTimeInMillis() == ((Calendar) o).getTimeInMillis()
|
||||
&& cal.getFirstDayOfWeek() == getFirstDayOfWeek()
|
||||
&& cal.isLenient() == isLenient()
|
||||
&& cal.getMinimalDaysInFirstWeek() == getMinimalDaysInFirstWeek())
|
||||
{
|
||||
TimeZone self = getTimeZone();
|
||||
TimeZone oth = cal.getTimeZone();
|
||||
return self == null ? oth == null : self.equals(oth);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -909,7 +920,13 @@ public abstract class Calendar implements Serializable, Cloneable
|
|||
public int hashCode()
|
||||
{
|
||||
long time = getTimeInMillis();
|
||||
return (int) ((time & 0xffffffffL) ^ (time >> 32));
|
||||
int val = (int) ((time & 0xffffffffL) ^ (time >> 32));
|
||||
val += (getFirstDayOfWeek() + (isLenient() ? 1230 : 1237)
|
||||
+ getMinimalDaysInFirstWeek());
|
||||
TimeZone self = getTimeZone();
|
||||
if (self != null)
|
||||
val ^= self.hashCode();
|
||||
return val;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue