[Mulgara-dev] [Mulgara-svn] r1423 - trunk/src/jar/query/java/org/jrdf/graph

Paul Gearon gearon at ieee.org
Wed Dec 17 10:35:17 UTC 2008


I'm including the complete log here....

On Wed, Dec 17, 2008 at 8:09 PM, Life is hard, and then you die
<ronald at innovation.ch> wrote:
> On Tue, Dec 16, 2008 at 12:11:03PM -0800, pag at mulgara.org wrote:
>> Author: pag
>> Date: 2008-12-16 12:11:02 -0800 (Tue, 16 Dec 2008)
>> New Revision: 1423
>>
>> Modified:
>>    trunk/src/jar/query/java/org/jrdf/graph/AbstractURIReference.java
>> Log:
>> Changed hashCode to the hash of the string and not the URI
>>
>> Modified: trunk/src/jar/query/java/org/jrdf/graph/AbstractURIReference.java
>> ===================================================================
>> --- trunk/src/jar/query/java/org/jrdf/graph/AbstractURIReference.java 2008-12-16 09:13:51 UTC (rev 1422)
>> +++ trunk/src/jar/query/java/org/jrdf/graph/AbstractURIReference.java 2008-12-16 20:11:02 UTC (rev 1423)
>> @@ -194,6 +194,6 @@
>>     * @return A hash code for the URI.
>>     */
>>    public int hashCode() {
>> -    return uri.hashCode();
>> +    return toString().hashCode();
>
> Hmm, both this and the equals() implementation look wrong - why don't
> these both just delete to URI? E.g. why are URIReferences for
> 'http://FOOBAR/' and 'http://foobar/' different when the URI's are the
> same?

Did you mean "default" and not "delete"?

This is code that comes from JRDF, so you can ask Andrew about
equals(). The hashCode() function was updated to be the hash of
toString() at the request of Sesame, as the org.openrdf.model.URI
interface requires it.

>From the javadoc for org.openrdf.model.URI#hashCode():
   * The hash code of a URI is defined as the hash code of its
   * String-representation: toString().hashCode.

Regards,
Paul



More information about the Mulgara-dev mailing list