--- old/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java 2020-08-07 17:13:24.799280684 +0000 +++ new/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java 2020-08-07 17:13:24.501273020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ import java.math.BigDecimal; import java.math.BigInteger; import java.math.RoundingMode; +import java.util.Arrays; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; @@ -190,7 +191,7 @@ * @author Sunitha Reddy * @see javax.xml.datatype.Duration * @since 1.5 - * @LastModified: June 2018 + * @LastModified: Aug 2020 */ public class XMLGregorianCalendarImpl @@ -1706,22 +1707,7 @@ * @return hash code of this object. */ public int hashCode() { - - // Following two dates compare to EQUALS since in different timezones. - // 2000-01-15T12:00:00-05:00 == 2000-01-15T13:00:00-04:00 - // - // Must ensure both instances generate same hashcode by normalizing - // this to UTC timezone. - int timezone = getTimezone(); - if (timezone == DatatypeConstants.FIELD_UNDEFINED) { - timezone = 0; - } - XMLGregorianCalendar gc = this; - if (timezone != 0) { - gc = this.normalizeToTimezone(getTimezone()); - } - return gc.getYear() + gc.getMonth() + gc.getDay() + - gc.getHour() + gc.getMinute() + gc.getSecond(); + return super.hashCode(); }