jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/URI.java

Print this page

        

*** 21,31 **** * $Id: URI.java,v 1.1.4.1 2005/09/08 11:03:20 suresh_emailid Exp $ */ package com.sun.org.apache.xml.internal.serializer.utils; import java.io.IOException; ! import java.io.Serializable; /** * A class to represent a Uniform Resource Identifier (URI). This class * is designed to handle the parsing of URIs and provide access to --- 21,31 ---- * $Id: URI.java,v 1.1.4.1 2005/09/08 11:03:20 suresh_emailid Exp $ */ package com.sun.org.apache.xml.internal.serializer.utils; import java.io.IOException; ! import java.util.Objects; /** * A class to represent a Uniform Resource Identifier (URI). This class * is designed to handle the parsing of URIs and provide access to
*** 861,871 **** * @return the scheme-specific part for this URI */ public String getSchemeSpecificPart() { ! StringBuffer schemespec = new StringBuffer(); if (m_userinfo != null || m_host != null || m_port != -1) { schemespec.append("//"); } --- 861,871 ---- * @return the scheme-specific part for this URI */ public String getSchemeSpecificPart() { ! final StringBuilder schemespec = new StringBuilder(); if (m_userinfo != null || m_host != null || m_port != -1) { schemespec.append("//"); }
*** 953,963 **** */ public String getPath(boolean p_includeQueryString, boolean p_includeFragment) { ! StringBuffer pathString = new StringBuffer(m_path); if (p_includeQueryString && m_queryString != null) { pathString.append('?'); pathString.append(m_queryString); --- 953,963 ---- */ public String getPath(boolean p_includeQueryString, boolean p_includeFragment) { ! final StringBuilder pathString = new StringBuilder(m_path); if (p_includeQueryString && m_queryString != null) { pathString.append('?'); pathString.append(m_queryString);
*** 1319,1328 **** --- 1319,1329 ---- * @param p_test the Object to test for equality. * * @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) {
*** 1341,1359 **** } return false; } /** * Get the URI as a string specification. See RFC 2396 Section 5.2. * * @return the URI string specification */ public String toString() { ! StringBuffer uriSpecString = new StringBuffer(); if (m_scheme != null) { uriSpecString.append(m_scheme); uriSpecString.append(':'); --- 1342,1374 ---- } return false; } + @Override + public int hashCode() { + int hash = 5; + hash = 41 * hash + Objects.hashCode(this.m_scheme); + hash = 41 * hash + Objects.hashCode(this.m_userinfo); + hash = 41 * hash + Objects.hashCode(this.m_host); + hash = 41 * hash + this.m_port; + hash = 41 * hash + Objects.hashCode(this.m_path); + hash = 41 * hash + Objects.hashCode(this.m_queryString); + hash = 41 * 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() { ! final StringBuilder uriSpecString = new StringBuilder(); if (m_scheme != null) { uriSpecString.append(m_scheme); uriSpecString.append(':');
*** 1541,1551 **** /** * Determine whether a character is a hexadecimal character. * * * @param p_char the character to check ! * @return true if the char is betweeen '0' and '9', 'a' and 'f' * or 'A' and 'F', false otherwise */ private static boolean isHex(char p_char) { return (isDigit(p_char) || (p_char >= 'a' && p_char <= 'f') --- 1556,1566 ---- /** * Determine whether a character is a hexadecimal character. * * * @param p_char the character to check ! * @return true if the char is between '0' and '9', 'a' and 'f' * or 'A' and 'F', false otherwise */ private static boolean isHex(char p_char) { return (isDigit(p_char) || (p_char >= 'a' && p_char <= 'f')