At Tue, 11 Mar 2014 11:18:57 +0100,
Claudio Bley wrote:
Signed-off-by: Claudio Bley <cbley(a)av-test.de>
---
src/main/java/org/libvirt/Connect.java | 39 +++++++++++++++++
src/main/java/org/libvirt/Domain.java | 52 ++++++++++++++++++++++-
src/test/java/org/libvirt/TestJavaBindings.java | 4 ++
3 files changed, 94 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/libvirt/Connect.java
b/src/main/java/org/libvirt/Connect.java
index fedc60e..7dca98a 100644
--- a/src/main/java/org/libvirt/Connect.java
+++ b/src/main/java/org/libvirt/Connect.java
@@ -89,6 +89,45 @@ public class Connect {
*/
protected ConnectionPointer VCP;
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ try {
+ result = prime * result + ((VCP == null) ? 0 : this.getURI().hashCode());
+ } catch (LibvirtException e) {
+ throw new RuntimeException("libvirt error testing connection
equality", e);
+ }
Darn copy'n'paste; just pretend it says "libvirt error generating hash
code", OK?! Likewise for the Domain class.
Claudio