You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Pe...@ibi.com on 2009/01/20 11:22:46 UTC
Small hashcode issue
This problem is reported by the Findbugs tool.
package org.apache.pdfbox.cos;
public class COSString extends COSBase
public int hashCode()
{
return getBytes().hashCode();
}
Invocation of hashCode on an array
The code invokes hashCode on an array. Calling hashCode on an array
returns the same value as System.identityHashCode, and ignores the
contents and length of the array. If you need a hashCode that depends on
the contents of an array a, use java.util.Arrays.hashCode(a).
This might be a better solution.
public int hashCode()
{
return java.util.Arrays.hashCode (getBytes());
}
Re: Small hashcode issue
Posted by Jukka Zitting <ju...@gmail.com>.
Hi Peter,
Would you mind posting your proposed changes to Jira? Then it would be
easier to track them.
BR,
Jukka Zitting