Author: adietish
Date: 2010-11-16 10:36:05 -0500 (Tue, 16 Nov 2010)
New Revision: 26622
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudImage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Image.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java
Log:
[JBIDE-7617] removed equals and hash code since it resulted in odd behaviors towards
selection
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-16 15:34:20
UTC (rev 26621)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-16 15:36:05
UTC (rev 26622)
@@ -1,6 +1,11 @@
2010-11-16 André Dietisheim <adietish(a)redhat.com>
+ * src/org/jboss/tools/deltacloud/core/client/Image.java:
+ * src/org/jboss/tools/deltacloud/core/DeltaCloudImage.java:
+ * src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java
* src/org/jboss/tools/deltacloud/core/client/Instance.java
+ [JBIDE-7617] removed equals and hash code since it resulted in odd behaviors towards
selection
+ * src/org/jboss/tools/deltacloud/core/client/Instance.java
(canStart):
(canStop):
(canReboot):
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudImage.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudImage.java 2010-11-16
15:34:20 UTC (rev 26621)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudImage.java 2010-11-16
15:36:05 UTC (rev 26622)
@@ -42,36 +42,4 @@
public String getId() {
return image.getId();
}
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((image == null) ? 0 : image.hashCode());
- return result;
- }
-
- /**
- * The current strategy regarding instances is to create new instances (and
- * not update instances). We therefore need equals to be able to match
- * domain objects. We might have to change that since in my experience it is
- * not a good choice to create new instances, better is to update the ones
- * that are available in the client.
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- DeltaCloudImage other = (DeltaCloudImage) obj;
- if (image == null) {
- if (other.image != null)
- return false;
- } else if (!image.equals(other.image))
- return false;
- return true;
- }
}
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java 2010-11-16
15:34:20 UTC (rev 26621)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudInstance.java 2010-11-16
15:36:05 UTC (rev 26622)
@@ -128,42 +128,4 @@
}
return client.performInstanceAction(action);
}
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((givenName == null) ? 0 : givenName.hashCode());
- result = prime * result + ((instance == null) ? 0 : instance.hashCode());
- return result;
- }
-
- /**
- * The current strategy regarding instances is to create new instances (and
- * not update instances). We therefore need equals to be able to match
- * domain objects. We might have to change that since in my experience it is
- * not a good choice to create new instances, better is to update the ones
- * that are available in the client.
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- DeltaCloudInstance other = (DeltaCloudInstance) obj;
- if (givenName == null) {
- if (other.givenName != null)
- return false;
- } else if (!givenName.equals(other.givenName))
- return false;
- if (instance == null) {
- if (other.instance != null)
- return false;
- } else if (!instance.equals(other.instance))
- return false;
- return true;
- }
}
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Image.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Image.java 2010-11-16
15:34:20 UTC (rev 26621)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Image.java 2010-11-16
15:36:05 UTC (rev 26622)
@@ -87,49 +87,4 @@
s += "Arch:\t\t" + getArchitecture() + "\n";
return s;
}
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((architecture == null) ? 0 : architecture.hashCode());
- result = prime * result + ((description == null) ? 0 : description.hashCode());
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Image other = (Image) obj;
- if (architecture == null) {
- if (other.architecture != null)
- return false;
- } else if (!architecture.equals(other.architecture))
- return false;
- if (description == null) {
- if (other.description != null)
- return false;
- } else if (!description.equals(other.description))
- return false;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- if (ownerId == null) {
- if (other.ownerId != null)
- return false;
- } else if (!ownerId.equals(other.ownerId))
- return false;
- return true;
- }
-
-
}
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java 2010-11-16
15:34:20 UTC (rev 26621)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java 2010-11-16
15:36:05 UTC (rev 26622)
@@ -266,77 +266,4 @@
return s;
}
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((cpu == null) ? 0 : cpu.hashCode());
- result = prime * result + ((imageId == null) ? 0 : imageId.hashCode());
- result = prime * result + ((keyname == null) ? 0 : keyname.hashCode());
- result = prime * result + ((memory == null) ? 0 : memory.hashCode());
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode());
- result = prime * result + ((profileId == null) ? 0 : profileId.hashCode());
- result = prime * result + ((realmId == null) ? 0 : realmId.hashCode());
- result = prime * result + ((storage == null) ? 0 : storage.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Instance other = (Instance) obj;
- if (cpu == null) {
- if (other.cpu != null)
- return false;
- } else if (!cpu.equals(other.cpu))
- return false;
- if (imageId == null) {
- if (other.imageId != null)
- return false;
- } else if (!imageId.equals(other.imageId))
- return false;
- if (keyname == null) {
- if (other.keyname != null)
- return false;
- } else if (!keyname.equals(other.keyname))
- return false;
- if (memory == null) {
- if (other.memory != null)
- return false;
- } else if (!memory.equals(other.memory))
- return false;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- if (ownerId == null) {
- if (other.ownerId != null)
- return false;
- } else if (!ownerId.equals(other.ownerId))
- return false;
- if (profileId == null) {
- if (other.profileId != null)
- return false;
- } else if (!profileId.equals(other.profileId))
- return false;
- if (realmId == null) {
- if (other.realmId != null)
- return false;
- } else if (!realmId.equals(other.realmId))
- return false;
- if (storage == null) {
- if (other.storage != null)
- return false;
- } else if (!storage.equals(other.storage))
- return false;
- return true;
- }
}
Show replies by date