jankotek / blueprints

A Property Graph Model Interface
http://blueprints.tinkerpop.com
Other
2 stars 1 forks source link

Override hashCode and equals for MEdge and MVertex classes #2

Closed ncolomer closed 11 years ago

ncolomer commented 11 years ago

I faced a bug while storing MEdge and MVertex in a HashMap. Under certain circumstances, I was not able to retrieve them. To reproduce the issue, I found no other way than create and loop over a large amount of elements (~10k), probably because instances was cached by MapDB. Related unit tests are provided in the patch.

PS1: The Property Graph Model Test Suite does not make use of Elements implementation hashCode() and equals() methods, instead they rely on the ElementHelper.areEquals() static method. I don't know why?

PS2: unused imports in existing test classes was cleaned (using Intellij auto-formatter :)