linikujp / owltools

Automatically exported from code.google.com/p/owltools
0 stars 0 forks source link

incorrect implementation of hashCode() in OWLGraphEdge #67

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, 

The hashCode method of OWLGraphEdge relies on the hashCode method of 
OWLQuantifiedProperty, which is not overridden. It also relies on the hashCode 
method of OWLObject, and I don't know if owlapi actually implemented this 
method.

As a result, two equal OWLGraphEdge (o1.equals(o2) returns true) have different 
hashCode (o1.hashCode().equals(o2.hashCode()) returns false). 

As a result, two equals OWLGraphEdge can be added to a same Set. 

I would really appreciate if you could fix that :p

Original issue reported on code.google.com by frederic...@gmail.com on 31 May 2013 at 5:42

GoogleCodeExporter commented 9 years ago
I mean (o1.hashCode() == o2.hashCode()) returns false of course

Original comment by frederic...@gmail.com on 31 May 2013 at 5:55

GoogleCodeExporter commented 9 years ago
Oops! We'll fix this ASAP on monday.

Original comment by cmung...@gmail.com on 1 Jun 2013 at 12:34

GoogleCodeExporter commented 9 years ago
Changes made in r1382.

TODO: We need to check, if this new hashcode and equals methods are a 
performance issue or not. 
Also we need to decide, whether all fields of OWLQuantifiedProperty are 
required for the calculation.

Original comment by HDie...@lbl.gov on 1 Jun 2013 at 12:51

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I don't know for the performance, but this update solves the issue. Thank you.

Original comment by frederic...@gmail.com on 1 Jun 2013 at 3:51

GoogleCodeExporter commented 9 years ago

Original comment by HDie...@lbl.gov on 15 Jul 2013 at 10:46