On 27/08/2014 17:05, schu...@apache.org wrote:
> Author: schultz
> Date: Wed Aug 27 16:05:38 2014
> New Revision: 1620923
> 
> URL: http://svn.apache.org/r1620923
> Log:
> Added missing hashCode method.

Two questions.

1. Why do you think this method is missing? I'm pretty sure (although
I'm going to need to install it to check) that FindBugs is now going
complain about a missing equals(XMLString) method.

2. Why were length and offset (both part of XMLString's state) not
included in the hashcode calculation?

Mark


> 
> Modified:
>     tomcat/trunk/java/org/apache/jasper/xmlparser/XMLString.java
> 
> Modified: tomcat/trunk/java/org/apache/jasper/xmlparser/XMLString.java
> URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/xmlparser/XMLString.java?rev=1620923&r1=1620922&r2=1620923&view=diff
> ==============================================================================
> --- tomcat/trunk/java/org/apache/jasper/xmlparser/XMLString.java (original)
> +++ tomcat/trunk/java/org/apache/jasper/xmlparser/XMLString.java Wed Aug 27 
> 16:05:38 2014
> @@ -25,6 +25,8 @@
>  
>  package org.apache.jasper.xmlparser;
>  
> +import java.util.Arrays;
> +
>  /**
>   * This class is used as a structure to pass text contained in the underlying
>   * character buffer of the scanner. The offset and length fields allow the
> @@ -138,6 +140,11 @@ public class XMLString {
>      //
>      // Object methods
>      //
> +    @Override
> +    public int hashCode()
> +    {
> +        return Arrays.hashCode(ch);
> +    }
>  
>      /** Returns a string representation of this object. */
>      @Override
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to