--- old/jaxp/src/com/sun/org/apache/xerces/internal/util/URI.java 2013-05-29 18:21:57.000000000 +0200 +++ new/jaxp/src/com/sun/org/apache/xerces/internal/util/URI.java 2013-05-29 18:21:57.000000000 +0200 @@ -20,6 +20,7 @@ package com.sun.org.apache.xerces.internal.util; +import com.sun.org.apache.xerces.internal.utils.Objects; import java.io.IOException; import java.io.Serializable; @@ -1212,7 +1213,7 @@ * @return the scheme-specific part for this URI */ public String getSchemeSpecificPart() { - StringBuffer schemespec = new StringBuffer(); + final StringBuilder schemespec = new StringBuilder(); if (m_host != null || m_regAuthority != null) { schemespec.append("//"); @@ -1297,7 +1298,7 @@ * @return the authority */ public String getAuthority() { - StringBuffer authority = new StringBuffer(); + final StringBuilder authority = new StringBuilder(); if (m_host != null || m_regAuthority != null) { authority.append("//"); @@ -1340,7 +1341,7 @@ */ public String getPath(boolean p_includeQueryString, boolean p_includeFragment) { - StringBuffer pathString = new StringBuffer(m_path); + final StringBuilder pathString = new StringBuilder(m_path); if (p_includeQueryString && m_queryString != null) { pathString.append('?'); @@ -1683,6 +1684,7 @@ * @return true if p_test is a URI with all values equal to this * URI, false otherwise */ + @Override public boolean equals(Object p_test) { if (p_test instanceof URI) { URI testURI = (URI) p_test; @@ -1711,13 +1713,27 @@ return false; } + @Override + public int hashCode() { + int hash = 5; + hash = 47 * hash + Objects.hashCode(this.m_scheme); + hash = 47 * hash + Objects.hashCode(this.m_userinfo); + hash = 47 * hash + Objects.hashCode(this.m_host); + hash = 47 * hash + this.m_port; + hash = 47 * hash + Objects.hashCode(this.m_path); + hash = 47 * hash + Objects.hashCode(this.m_queryString); + hash = 47 * hash + Objects.hashCode(this.m_fragment); + return hash; + } + /** * Get the URI as a string specification. See RFC 2396 Section 5.2. * * @return the URI string specification */ + @Override public String toString() { - StringBuffer uriSpecString = new StringBuffer(); + final StringBuilder uriSpecString = new StringBuilder(); if (m_scheme != null) { uriSpecString.append(m_scheme);