Author: adietish
Date: 2010-12-29 15:12:25 -0500 (Wed, 29 Dec 2010)
New Revision: 27805
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
Log:
fixed NPE
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java 2010-12-29
19:42:03 UTC (rev 27804)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudObjectRepository.java 2010-12-29
20:12:25 UTC (rev 27805)
@@ -77,6 +77,15 @@
}
}
+ public int indexOf(E object) {
+ try {
+ lock();
+ return objects.indexOf(object);
+ } finally {
+ unlock();
+ }
+ }
+
protected E getById(C criteria) {
try {
lock();
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java 2010-12-29
19:42:03 UTC (rev 27804)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java 2010-12-29
20:12:25 UTC (rev 27805)
@@ -532,6 +532,7 @@
private Instance updateInstance(String xml, Instance instance) throws Exception {
Document document = getDocument(xml);
+ instance.setId(getAttributeValues(document, "instance",
"id").get(0));
instance.setName(getElementTextValues(document, "name").get(0));
instance.setOwnerId(getElementTextValues(document, "owner_id").get(0));
instance.setImageId(getIdFromHref(getAttributeValues(document, "image",
"href").get(0))); //$NON-NLS-1$ //$NON-NLS-2$
Show replies by date